Merge remote-tracking branch 'origin/zhc4dev'

zhc4dev
zhc077 2 years ago
commit faa9e51df6
  1. 69
      ant-design-vue-jeecg/src/views/hanger/ZyHangPointList.vue
  2. 3
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue
  3. 197
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointForm.vue
  4. 8
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  5. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangPointController.java
  6. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHangPoint.java
  7. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangPointService.java
  8. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangPointServiceImpl.java

@ -4,6 +4,21 @@
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="吊挂编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.code" placeholder="请输入吊挂编号"></a-input>
</a-form-model-item>
</a-col><a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="工站编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.point" placeholder="请输入工站编号"></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
@ -13,11 +28,11 @@
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('吊挂工位表')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('吊挂工位表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<a-button type="primary" icon="import">导入</a-button> <!-- <a-button type="primary" icon="import">导入</a-button>-->
</a-upload> <!-- </a-upload>-->
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@ -47,43 +62,12 @@
class="j-table-force-nowrap" class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a-divider type="vertical" /> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span> </span>
</a-table> </a-table>
@ -124,7 +108,7 @@
{ {
title:'吊挂编号', title:'吊挂编号',
align:"center", align:"center",
dataIndex: 'code_dictText' dataIndex: 'code'
}, },
{ {
title:'工站编号', title:'工站编号',
@ -132,7 +116,7 @@
dataIndex: 'point' dataIndex: 'point'
}, },
{ {
title:'工位id', title:'工位名称',
align:"center", align:"center",
dataIndex: 'stationId_dictText' dataIndex: 'stationId_dictText'
}, },
@ -151,7 +135,7 @@
deleteBatch: "/org.jeecg.modules.hanger/zyHangPoint/deleteBatch", deleteBatch: "/org.jeecg.modules.hanger/zyHangPoint/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.hanger/zyHangPoint/exportXls", exportXlsUrl: "/org.jeecg.modules.hanger/zyHangPoint/exportXls",
importExcelUrl: "org.jeecg.modules.hanger/zyHangPoint/importExcel", importExcelUrl: "org.jeecg.modules.hanger/zyHangPoint/importExcel",
}, },
dictOptions:{}, dictOptions:{},
superFieldList:[], superFieldList:[],
@ -177,7 +161,4 @@
} }
} }
} }
</script> </script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -61,6 +61,8 @@
<a-form-model-item label="管理人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="administrator"> <a-form-model-item label="管理人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="administrator">
<!-- <a-input v-model="model.administrator" placeholder="请输入管理人"></a-input>--> <!-- <a-input v-model="model.administrator" placeholder="请输入管理人"></a-input>-->
<j-select-user-by-dep v-model="model.administrator" :multi="false"/> <j-select-user-by-dep v-model="model.administrator" :multi="false"/>
<!-- <j-dict-select-tag type="list" v-model="model.administrator"-->
<!-- placeholder="请选择管理人" :dict-code="enterprisesManager"/>-->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -105,6 +107,7 @@ export default {
}, },
data () { data () {
return { return {
// enterprisesManager: "sys_user,realname,id",
model:{ model:{
status:1, status:1,
}, },

@ -5,17 +5,26 @@
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="吊挂编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"> <a-form-model-item label="吊挂编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code">
<j-dict-select-tag type="list" v-model="model.code" dictCode="" placeholder="请选择吊挂编号" /> <j-dict-select-tag type="list" v-model="model.code" dictCode="zy_hang,code,code"
placeholder="请选择吊挂编号"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="工站编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="point"> <a-form-model-item label="工站编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="point">
<a-input v-model="model.point" placeholder="请输入工站编号" ></a-input> <a-input v-model="model.point" placeholder="请输入工站编号"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="工位id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId"> <a-form-model-item label="工位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId">
<j-dict-select-tag type="list" v-model="model.stationId" dictCode="" placeholder="请选择工位id" /> <j-dict-select-tag type="list" v-model="model.stationId" dictCode="station,station_name,id"
placeholder="请选择工位"/>
<!-- <j-tree-select v-model="model.departId"-->
<!-- dict="station,station_name,id"-->
<!-- pidField="depart_id"-->
<!-- placeholder="请选择车间"-->
<!-- hasChildField="1"-->
<!-- >-->
<!-- </j-tree-select>-->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -26,93 +35,111 @@
<script> <script>
import { httpAction, getAction } from '@/api/manage' import {httpAction, getAction} from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util' import {validateDuplicateValue} from '@/utils/util'
export default { export default {
name: 'ZyHangPointForm', name: 'ZyHangPointForm',
components: { components: {},
}, props: {
props: { //
// disabled: {
disabled: { type: Boolean,
type: Boolean, default: false,
default: false, required: false
required: false }
},
data() {
return {
model: {},
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {
code: [
{required: true, message: '吊挂编号不能为空'},
// {pattern: /^\d{0,6}$/, message: '!'},
],
stationId: [
{required: true, message: '工位编号不能为空'},
{pattern: /^\d{0,200}$/, message: '长度过长!'},
],
},
url: {
add: "/org.jeecg.modules.hanger/zyHangPoint/add",
getLastPointCode: "/org.jeecg.modules.hanger/zyHangPoint/getLastPointCode",
edit: "/org.jeecg.modules.hanger/zyHangPoint/edit",
queryById: "/org.jeecg.modules.hanger/zyHangPoint/queryById"
} }
}
},
computed: {
formDisabled() {
return this.disabled
}, },
data () { },
return { created() {
model:{ //model
}, this.modelDefault = JSON.parse(JSON.stringify(this.model));
labelCol: { },
xs: { span: 24 }, methods: {
sm: { span: 5 }, add() {
}, this.getLastPointCode();
wrapperCol: { this.edit(this.modelDefault);
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
stationId: [
{ required: false},
{ pattern: /^\d{6,16}$/, message: '请输入6到16位数字!'},
],
},
url: {
add: "/org.jeecg.modules.hanger/zyHangPoint/add",
edit: "/org.jeecg.modules.hanger/zyHangPoint/edit",
queryById: "/org.jeecg.modules.hanger/zyHangPoint/queryById"
}
}
}, },
computed: {
formDisabled(){ getLastPointCode() {
return this.disabled getAction(this.url.getLastPointCode, {}).then((res) => {
}, if (res.success) {
this.model.point = res.result;
this.$forceUpdate();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
confirmLoading = false;
})
}, },
created () {
//model edit(record) {
this.modelDefault = JSON.parse(JSON.stringify(this.model)); this.model = Object.assign({}, record);
this.visible = true;
}, },
methods: { submitForm() {
add () { const that = this;
this.edit(this.modelDefault); //
}, this.$refs.form.validate(valid => {
edit (record) { if (valid) {
this.model = Object.assign({}, record); that.confirmLoading = true;
this.visible = true; let httpurl = '';
}, let method = '';
submitForm () { if (!this.model.id) {
const that = this; httpurl += this.url.add;
// method = 'post';
this.$refs.form.validate(valid => { } else {
if (valid) { httpurl += this.url.edit;
that.confirmLoading = true; method = 'put';
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
} }
httpAction(httpurl, this.model, method).then((res) => {
}) if (res.success) {
}, that.$message.success(res.message);
} that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
} }
}
</script> </script>

@ -282,7 +282,6 @@ export default {
// }, // },
}, },
methods: { methods: {
jumpPage1(record) { jumpPage1(record) {
this.$router.push({ this.$router.push({
path: '/productplan/ProductplanManage', path: '/productplan/ProductplanManage',
@ -308,19 +307,22 @@ export default {
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.loadData();
}) })
}, },
getPaiWeiTu(record) { async getPaiWeiTu(record) {
// alert(JSON.stringify(record)); // alert(JSON.stringify(record));
getAction(this.url.paiweitu, record).then((res) => { getAction(this.url.paiweitu, record).then((res) => {
if (res.success) { if (res.success) {
console.log("the paiweitu----------" + JSON.stringify(res.result)) // console.log("the paiweitu----------" + JSON.stringify(res.result));
// alert(JSON.stringify(res.result));
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.loadData();
}) })
}, },
} }

@ -57,6 +57,13 @@ public class ZyHangPointController extends JeecgController<ZyHangPoint, IZyHangP
return Result.OK(pageList); return Result.OK(pageList);
} }
@ApiOperation(value = "吊挂工位表-获取是后的吊拉编码", notes = "吊挂工位表-获取是后的吊拉编码")
@GetMapping(value = "/getLastPointCode")
public Result<?> getLastPointCode(HttpServletRequest req) {
return Result.OK(zyHangPointService.getLastPointCode());
}
/** /**
* 添加 * 添加
* *
@ -67,6 +74,8 @@ public class ZyHangPointController extends JeecgController<ZyHangPoint, IZyHangP
@ApiOperation(value = "吊挂工位表-添加", notes = "吊挂工位表-添加") @ApiOperation(value = "吊挂工位表-添加", notes = "吊挂工位表-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyHangPoint zyHangPoint) { public Result<?> add(@RequestBody ZyHangPoint zyHangPoint) {
String pointCode = zyHangPointService.getLastPointCode();
zyHangPoint.setPoint(pointCode);
zyHangPointService.save(zyHangPoint); zyHangPointService.save(zyHangPoint);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -77,5 +78,6 @@ public class ZyHangPoint implements Serializable {
*/ */
@Excel(name = "工位id", width = 15) @Excel(name = "工位id", width = 15)
@ApiModelProperty(value = "工位id") @ApiModelProperty(value = "工位id")
@Dict(dictTable = "station", dicCode = "id", dicText = "station_name")
private String stationId; private String stationId;
} }

@ -12,4 +12,5 @@ import org.jeecg.modules.hanger.entity.ZyHangPoint;
*/ */
public interface IZyHangPointService extends IService<ZyHangPoint> { public interface IZyHangPointService extends IService<ZyHangPoint> {
String getLastPointCode();
} }

@ -1,11 +1,15 @@
package org.jeecg.modules.hanger.service.impl; package org.jeecg.modules.hanger.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.hanger.entity.ZyHangPoint; import org.jeecg.modules.hanger.entity.ZyHangPoint;
import org.jeecg.modules.hanger.mapper.ZyHangPointMapper; import org.jeecg.modules.hanger.mapper.ZyHangPointMapper;
import org.jeecg.modules.hanger.service.IZyHangPointService; import org.jeecg.modules.hanger.service.IZyHangPointService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.List;
/** /**
* @Description: 吊挂工位表 * @Description: 吊挂工位表
@ -16,4 +20,17 @@ import org.springframework.stereotype.Service;
@Service @Service
public class ZyHangPointServiceImpl extends ServiceImpl<ZyHangPointMapper, ZyHangPoint> implements IZyHangPointService { public class ZyHangPointServiceImpl extends ServiceImpl<ZyHangPointMapper, ZyHangPoint> implements IZyHangPointService {
@Override
public String getLastPointCode() {
List<ZyHangPoint> pointList = this.list(new LambdaQueryWrapper<ZyHangPoint>().orderByDesc(ZyHangPoint::getPoint));
String code = "";
if (ObjectUtils.isEmpty(pointList)) {
code = "P100";
} else {
String[] dgs = pointList.get(0).getPoint().split("P");
int val = new Integer(dgs[1]).intValue() + 1;
code = "P" + val + "";
}
return code;
}
} }

Loading…
Cancel
Save