fix:交接记录显示问题&检验时物料批次的排序
This commit is contained in:
parent
45497e82a1
commit
ffcbe833cf
|
|
@ -558,20 +558,47 @@ export default {
|
|||
}
|
||||
this.form.count_ok = this.form.count - this.form.count_notok;
|
||||
},
|
||||
compare(name){
|
||||
return function(a,b){
|
||||
let value1 = a[name];
|
||||
let value2 = b[name];
|
||||
return value2 - value1
|
||||
}
|
||||
},
|
||||
//获取物料批次
|
||||
getMaterialBatch() {
|
||||
let that = this;
|
||||
let obj = {page: 0, count__gte: 0, count_xtest__gte: 0};
|
||||
if(that.mode == "sizeAdd"||that.mode == "sizeEdit"||that.mode == "sizeShow"){
|
||||
console.log('sizeAdd')
|
||||
obj.material__process__name = '一次超洗'
|
||||
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
obj.belong_dept=res[0].id;
|
||||
that.getMaterials(obj);
|
||||
}
|
||||
})
|
||||
// obj.material__process__name = '一次超洗'
|
||||
}else {
|
||||
console.log('facadeAdd')
|
||||
obj.material__process__name = '二次超洗'
|
||||
// obj.material__process__name = '二次超洗'
|
||||
that.$API.system.dept.list.req({name__contains:'外观',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
obj.belong_dept=res[0].id;
|
||||
that.getMaterials(obj);
|
||||
}
|
||||
that.$API.wpm.wmaterial.list
|
||||
.req(obj)
|
||||
.then((res) => {
|
||||
})
|
||||
}
|
||||
// that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
// res.sort(that.compare("count"));
|
||||
// console.log('res',res)
|
||||
// that.options = res;
|
||||
// });
|
||||
},
|
||||
getMaterials(obj){
|
||||
let that = this;
|
||||
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
res.sort(that.compare("count"));
|
||||
console.log('res',res)
|
||||
that.options = res;
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -116,13 +116,14 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="交接物料">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addMaterial"></el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addMaterial" v-if="mode!=='show'"></el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||
<el-col :span="11">
|
||||
<el-form-item label="交接物料">
|
||||
<el-select
|
||||
v-if="mode!=='show'"
|
||||
v-model="listItem.wm"
|
||||
placeholder="交接物料"
|
||||
filterable
|
||||
|
|
@ -144,6 +145,7 @@
|
|||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input v-else v-model="listItem.batch" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
|
|
@ -153,6 +155,7 @@
|
|||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:disabled="mode==='show'"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="交接数量"
|
||||
|
|
@ -160,7 +163,7 @@
|
|||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-col :span="2" v-if="mode!=='show'">
|
||||
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -483,6 +486,7 @@ export default {
|
|||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
console.log('this.form',this.form);
|
||||
if(data.type==30){
|
||||
this.getUserList3();
|
||||
}else{
|
||||
|
|
|
|||
Loading…
Reference in New Issue