|
|
@@ -55,19 +55,19 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="设备编码:" prop="assetCode">
|
|
|
+ <el-form-item label="设备编码:" prop="extInfo.assetCode">
|
|
|
<el-input
|
|
|
- v-model="form.assetCode"
|
|
|
+ v-model="form.extInfo.assetCode"
|
|
|
readonly
|
|
|
@click.native="chooseAsset"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="设备名称:" prop="assetName">
|
|
|
+ <el-form-item label="设备名称:" prop="extInfo.assetName">
|
|
|
<el-input
|
|
|
disabled
|
|
|
- v-model="form.assetName"
|
|
|
+ v-model="form.extInfo.assetName"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -139,14 +139,14 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="所属工作中心:" prop="workCenterId">
|
|
|
+ <el-form-item label="所属工作中心:" prop="extInfo.workCenterId">
|
|
|
<el-select
|
|
|
- v-model="form.workCenterId"
|
|
|
+ v-model="form.extInfo.workCenterId"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in options.productionLineId"
|
|
|
+ v-for="item in options.workCenterList"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
:value="item.id"
|
|
|
@@ -156,14 +156,14 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="可执行工序:" prop="processId">
|
|
|
+ <el-form-item label="可执行工序:" prop="extInfo.produceId">
|
|
|
<el-select
|
|
|
- v-model="form.processId"
|
|
|
+ v-model="form.extInfo.produceId"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in options.productionLineId"
|
|
|
+ v-for="item in options.produceList"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
:value="item.id"
|
|
|
@@ -172,7 +172,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-
|
|
|
+
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="状态:" prop="enabled">
|
|
|
<el-select
|
|
|
@@ -200,19 +200,8 @@
|
|
|
v-model="form.extInfo.meterTime"
|
|
|
placeholder="请输入"
|
|
|
/>
|
|
|
- <el-select
|
|
|
- class="s2"
|
|
|
- v-model="form.extInfo.meterTimeUnit"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in options.meterTimeUnit"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <DictSelection style="width:30%" dictName="计量单位" clearable v-model="form.extInfo.meterMeasuringUnit">
|
|
|
+ </DictSelection>
|
|
|
<span class="s3">/</span>
|
|
|
<el-select
|
|
|
class="s2"
|
|
|
@@ -274,6 +263,8 @@ import {
|
|
|
} from '@/api/factoryModel';
|
|
|
import { getUserPage } from '@/api/system/organization';
|
|
|
import AssetSelection from './AssetSelection.vue';
|
|
|
+import producetask from '@/api/technology/production';
|
|
|
+import work from '@/api/technology/work';
|
|
|
export default {
|
|
|
components: {
|
|
|
AssetSelection
|
|
|
@@ -307,7 +298,12 @@ export default {
|
|
|
workshopId: '', // 车间
|
|
|
principalDep: '', // 负责人部门
|
|
|
meterTimeUnit: '时', // 节拍时间单位
|
|
|
- meterTime: '' // 节拍时间
|
|
|
+ meterTime: '' ,// 节拍时间
|
|
|
+ assetCode:'', //设备编码
|
|
|
+ assetName:'' ,//设备名称
|
|
|
+ meterMeasuringUnit:'', // 节拍计量单位
|
|
|
+ workCenterId:null, //所属工作中心
|
|
|
+ produceId:null //可执行工序
|
|
|
},
|
|
|
id: '',
|
|
|
leaderId: '', // 负责人
|
|
|
@@ -333,11 +329,27 @@ export default {
|
|
|
'extInfo.principalDep': [
|
|
|
{ required: true, message: '请输入', trigger: 'change' }
|
|
|
],
|
|
|
+ 'extInfo.assetCode': [
|
|
|
+ { required: true, message: '请选择', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ 'extInfo.assetName': [
|
|
|
+ { required: true, message: '请选择', trigger: 'change' }
|
|
|
+ ],
|
|
|
'extInfo.workshopId': {
|
|
|
required: true,
|
|
|
message: '请输入',
|
|
|
trigger: 'change'
|
|
|
},
|
|
|
+ 'extInfo.workCenterId':{
|
|
|
+ required: true,
|
|
|
+ message: '请输入',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ 'extInfo.produceId':{
|
|
|
+ required: true,
|
|
|
+ message: '请输入',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
productionLineId: {
|
|
|
required: true,
|
|
|
message: '请输入',
|
|
|
@@ -355,6 +367,8 @@ export default {
|
|
|
options: {
|
|
|
leaderId: [],
|
|
|
workshopId: [],
|
|
|
+ workCenterList:[],
|
|
|
+ produceList:[],
|
|
|
enabled: [
|
|
|
{
|
|
|
label: '生效',
|
|
|
@@ -403,11 +417,13 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
chooseAsset(){
|
|
|
- this.$refs.equipmentTable.open()
|
|
|
+ this.$refs.equipmentTable.open(this.form.extInfo)
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
assetConfirm(data){
|
|
|
-
|
|
|
+ this.form.extInfo.assetCode = data.code
|
|
|
+ this.form.extInfo.assetName = data.name
|
|
|
+ this.form.extInfo.assetId = data.id
|
|
|
},
|
|
|
|
|
|
open(type, row) {
|
|
|
@@ -435,6 +451,8 @@ export default {
|
|
|
this.getUserPage();
|
|
|
}
|
|
|
}
|
|
|
+ this.getListWorkCenter()
|
|
|
+ this.getListProduce()
|
|
|
},
|
|
|
/* 保存编辑 */
|
|
|
save() {
|
|
|
@@ -447,13 +465,19 @@ export default {
|
|
|
if (this.type == 'add') {
|
|
|
delete this.form.id;
|
|
|
}
|
|
|
- this.form.workstationSubstanceList =
|
|
|
- this.$refs.equipmentTable.datasource.map((n) => {
|
|
|
- return {
|
|
|
- type: 1,
|
|
|
- substanceId: n.id
|
|
|
- };
|
|
|
- });
|
|
|
+ // this.form.workstationSubstanceList =
|
|
|
+ // this.$refs.equipmentTable.datasource.map((n) => {
|
|
|
+ // return {
|
|
|
+ // type: 1,
|
|
|
+ // substanceId: n.id
|
|
|
+ // };
|
|
|
+ // });
|
|
|
+ this.form.workstationSubstanceList = [
|
|
|
+ {
|
|
|
+ type: 1,
|
|
|
+ substanceId: this.form.extInfo.assetId
|
|
|
+ }
|
|
|
+ ]
|
|
|
saveOrUpdate_gw(this.form)
|
|
|
.then((msg) => {
|
|
|
this.loading = false;
|
|
|
@@ -486,6 +510,21 @@ export default {
|
|
|
parentIdField: 'parentId'
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ // 获取工作中心
|
|
|
+ getListWorkCenter(){
|
|
|
+ work.list({ pageNum: 1, size: -1 }).then(res=>{
|
|
|
+ this.options.workCenterList = res.list;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取工序
|
|
|
+ getListProduce(){
|
|
|
+ producetask.list({ pageNum: 1, size: -1 }).then(res=>{
|
|
|
+ this.options.produceList = res.list;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 获取车间
|
|
|
getListWorkshopByParentId() {
|
|
|
listWorkshopByParentId(this.form.extInfo.factoryId).then((res) => {
|
|
|
@@ -560,6 +599,7 @@ export default {
|
|
|
.workMeter-warp {
|
|
|
.s1 {
|
|
|
width: 30%;
|
|
|
+ margin-right: 10px;
|
|
|
}
|
|
|
.s2 {
|
|
|
width: 20%;
|