Commit 3c877aba authored by 沈翠玲's avatar 沈翠玲

Merge branch 'dev' of http://git.local.topsunit.com/mes/mes-ui into dev

parents 035b7c94 b4c47508
......@@ -39,31 +39,17 @@
<el-row>
<el-col :span="12">
<el-form-item label="工作中心编码" prop="workstationCode">
<el-input v-model="form.workstationCode" placeholder="请输入工作中心编码">
<el-button slot="append" icon="el-icon-search" @click="handleWorkstationSelect" />
</el-input>
<el-input disabled v-model="form.workstationCode" placeholder="请输入产品名称" />
</el-form-item>
<WorkstationSelect ref="brSelectworkstation"
@onSelected="val => onWorkstationSelect(val, 'workstation')"
:workstationCode="form.workstationCode">
</WorkstationSelect>
</el-col>
<el-col :span="12">
<el-form-item label="工作单元" prop="workunitCode">
<el-input v-model="form.workunitCode" placeholder="工作单元">
<el-button slot="append" icon="el-icon-search"
@click="$refs.codeSelect.showFlag = true"></el-button>
</el-input>
<el-input disabled v-model="form.workunitCode" placeholder="请输入产品名称" />
</el-form-item>
</el-col>
</el-row>
<WorkstationSelect ref="brSelectworkstation"
@onSelected="val => onWorkstationSelect(val, 'workstation')"
:workstationCode="form.workstationCode">
</WorkstationSelect>
<codeSelect ref="codeSelect" :workstationId="form.workstationId"
@onSelected="val => onWorkstationSelect(val, 'unit')"></codeSelect>
<el-row>
<el-col :span="12">
......@@ -101,7 +87,17 @@ export default {
id: {
type: String,
default: ''
},
workunitCodes:{
default: undefined
},
workstationCodes:{
default: undefined
},
workstationNames: {
default: undefined
}
},
data() {
return {
......@@ -131,7 +127,6 @@ export default {
open: false,
// 查询参数
queryParams: {
itemId: null,
sapItemCode: null,
itemName: null,
......@@ -162,37 +157,26 @@ export default {
};
},
watch: {
workunitCodes(val) {
console.log('sdfsd', val)
this.form.workunitCode = val
},
workstationCodes(val) {
this.form.workstationCode = val
},
workstationNames(val) {
this.form.workstationName = val
}
},
created() {
if (this.$attrs.optType !== 'add') {
this.getList();
this.getList();
}
console.log('workstationCodes', this.workstationCodes)
this.addWorkstantion()
},
methods: {
// onItemSelect(list) {
// // console.log(list, 'list')
// const datas = list.map(item => {
// return {
// toolWarehouseId: item.toolWarehouseId,
// toolMachinesId: item.toolMachinesId,
// type: item.type,
// toolCode: item.toolCode,
// toolName: item.toolName,
// itemCode: item.itemCode,
// sapItemCode: item.sapItemCode,
// itemName: item.itemName,
// local: item.local,
// processId: Number(item.processId),
// processName: item.processName,
// warehouse: item.warehouse,
// warehouseDesc: item.warehouseDesc,
// }
// })
// this.tmToolRequestItemList = this.tmToolRequestItemList.concat(datas)
// this.$emit('sum')
// },
/** 新增按钮操作 */
handleAdd() {
this.reset();
......@@ -201,14 +185,22 @@ export default {
this.optType = "add";
},
addWorkstantion(){
this.form={
workstationCode: this.workstationCodes,
workunitCode: this.workunitCodes,
workstationName: this.workstationNames,
}
},
handleItemSelect() {
this.$refs.brSelectpro.showFlag = true;
},
onItemSelect(row) {
if (row != undefined && row != null) {
this.form.itemId = row.itemId;
this.form.sapItemCode = row.sapItemCode;
this.form.itemName = row.itemName;
this.$set(this.form,'itemId',row.itemId)
this.$set(this.form,'sapItemCode',row.sapItemCode)
this.$set(this.form,'itemName',row.itemName)
}
},
......@@ -224,6 +216,21 @@ export default {
this.$modal.confirm('申请数量需要输入数字');
return;
}
if(this.form.applyNum==null){
this.open=true;
this.$modal.confirm('申请数量需要输入数字');
return;
}
if(this.form.workstationCode==null){
this.open=true;
this.$modal.confirm('工作中心编码不能为空,请先选任务单');
return;
}
if(this.form.workunitCode==null){
this.open=true;
this.$modal.confirm('工作单元编码不能为空,请先选任务单');
return;
}
this.$refs["form"].validate((valid) => {
if (valid) {
......@@ -237,27 +244,6 @@ export default {
});
this.open = false;
},
handleWorkstationSelect() {
this.$refs.brSelectworkstation.showFlag = true;
},
onWorkstationSelect(row, type) {
console.log('row', type, row)
if (row != undefined && row != null) {
if (type === 'unit') {
// this.form.workunitName = row.workunitName
this.$set(this.form, 'workunitCode', row.workunitCode)
this.form.workstationId = row.workstationId;
this.form.workstationCode = row.workstationCode;
this.form.workstationName = row.workstationName;
} else {
this.form.workstationId = row.workstationId;
this.form.workstationCode = row.workstationCode;
this.form.workstationName = row.workstationName;
}
}
},
/**删除行 */
deleteRow(index) {
this.tableData.splice(index, 1);
......@@ -290,19 +276,13 @@ export default {
},
// 表单重置
reset() {
this.form = {
itemId: null,
sapItemCode: null,
itemName: null,
applyNum: null,
workunitId: null,
workunitName: null,
workunitCode: null,
workstationCode: null,
workstationId: null,
workstationName: null,
};
this.resetForm("form");
this.form.itemId=null;
this.form.sapItemCode=null;
this.form.itemName=null;
this.form.applyNum=null;
//this.resetForm("form");
},
......
......@@ -323,8 +323,8 @@
</el-form>
<el-divider content-position="center">申请单物料</el-divider>
<el-card shadow="always" class="box-card">
<requestIndex v-if="opens" ref="materialRequestRef" :quantity="form.requestNum" :id="form.materialRequestId"
:optType="optType"></requestIndex>
<requestIndex v-if="opens" ref="materialRequestRef" :quantity="form.requestNum" :id="form.materialRequestId"
:optType="optType" :workunitCodes="form.workunitCode" :workstationNames="form.workstationName" :workstationCodes="form.workstationCode"></requestIndex>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType == 'view'">返回</el-button>
......@@ -529,6 +529,9 @@ export default {
this.form.taskName = row.taskName;
this.form.arrangeCode = row.arrangeCode;
this.form.startTime = row.scheduleStartDate;
this.$set(this.form,'workstationCode',row.workstationCode)
this.form.workunitCode=row.workunitCode;
this.form.workstationName=row.workstationName;
this.$set(this.form,'endTime',row.scheduleEndDate)
} else if (type === 'arangeSelect') {
this.form.arrangeCode = row.arrangeCode;
......@@ -680,6 +683,7 @@ export default {
this.opens = true;
this.gCode();
this.setDate();
console.log('sdfds', this.form)
this.title = "添加领料申请";
this.optType = "add";
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment