质量不合格部分缺陷修改
parent
19d5b99955
commit
1722abe0ab
@ -0,0 +1,118 @@
|
|||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<u-modal v-model="isshow" @cancel="cancel" @confirm="confirm" :show-cancel-button="true" :show-title="false">
|
||||||
|
<uni-table class="badtable" ref="table" border emptyText="">
|
||||||
|
<uni-tr v-for="(item, index) in tagslist" :key="index">
|
||||||
|
<uni-td>{{ item.label }}</uni-td>
|
||||||
|
<uni-td width="50">
|
||||||
|
<u-input v-model="item.numberall" />
|
||||||
|
</uni-td>
|
||||||
|
<uni-td style="display: flex">
|
||||||
|
<!-- <uni-data-select
|
||||||
|
v-model="item.defect"
|
||||||
|
:localdata="defectList"
|
||||||
|
@change="selectProductlocCode7($event,item,index)"
|
||||||
|
></uni-data-select> -->
|
||||||
|
<jPicker style="height: 80rpx" moren="请选择" sureColor="#ff0000" @bindpicker="selectProductlocCode7($event, item, index)" showKey="label" valKey="value" :val="item.defect" :options="item.defectList" />
|
||||||
|
<!-- <u-icon size="28" name="close" @click="cleardefect(item.defect,index)"></u-icon> -->
|
||||||
|
</uni-td>
|
||||||
|
</uni-tr>
|
||||||
|
</uni-table>
|
||||||
|
</u-modal>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import jPicker from '@/components/J-Picker/jPicker.vue';
|
||||||
|
import model from './model';
|
||||||
|
//import UniTd from '../uni-table/components/uni-td/uni-td.vue';
|
||||||
|
export default {
|
||||||
|
name: 'badtable',
|
||||||
|
components: {
|
||||||
|
jPicker,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
model: model,
|
||||||
|
isshow: false,
|
||||||
|
tagslist: [],
|
||||||
|
tagslistcopy: [],
|
||||||
|
itemindex: '',
|
||||||
|
range: [
|
||||||
|
{ value: 0, label: '篮球' },
|
||||||
|
{ value: 1, label: '足球' },
|
||||||
|
{ value: 2, label: '游泳' },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: ['options', 'moren', 'showKey', 'valKey', 'val', 'position', 'disabled', 'bgColor', 'sureColor', 'focus', 'defectList'],
|
||||||
|
methods: {
|
||||||
|
async open(item, index) {
|
||||||
|
console.log(item, index);
|
||||||
|
this.itemindex = index;
|
||||||
|
|
||||||
|
this.tagslist = JSON.parse(JSON.stringify(item.babtype));
|
||||||
|
this.tagslist.forEach((item) => {
|
||||||
|
item.defectList = [];
|
||||||
|
|
||||||
|
//console.log("item.defectList0```````:", item);
|
||||||
|
});
|
||||||
|
for (let tag of this.tagslist) {
|
||||||
|
await this.model.getdefectList(tag.defectCode);
|
||||||
|
tag.defectList = this.model.alldefectList;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('this.tagslist是什么样的:', this.tagslist);
|
||||||
|
this.tagslistcopy = JSON.parse(JSON.stringify(this.tagslist));
|
||||||
|
this.isshow = true;
|
||||||
|
},
|
||||||
|
selectProductlocCode7(e, item, index) {
|
||||||
|
this.tagslist[index].defect = e.pickerName.value;
|
||||||
|
//item.defect = e.pickerName.value;
|
||||||
|
console.log('e:', item);
|
||||||
|
console.log('this.tagslist[index]:', this.tagslist[index]);
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.tagslist = this.tagslistcopy;
|
||||||
|
this.tagslist.forEach((item) => {
|
||||||
|
if (item.numberall == '') {
|
||||||
|
item.numberall = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$emit('bindtypelist', this.tagslist, this.itemindex);
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
this.tagslist.forEach((item) => {
|
||||||
|
if (item.numberall == '') {
|
||||||
|
item.numberall = 0;
|
||||||
|
}
|
||||||
|
console.log('item:', item.defect);
|
||||||
|
// if(item.defect == undefined){
|
||||||
|
// item.defect = '';
|
||||||
|
// }
|
||||||
|
if (item.numberall != 0 && item.defect == undefined) {
|
||||||
|
item.defect = '';
|
||||||
|
}
|
||||||
|
// else if(item.numberall==0 && item.defect == undefined){
|
||||||
|
// item.defect = '';
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
console.log('this.tagslist:', this.tagslist);
|
||||||
|
this.$emit('bindtypelist', this.tagslist, this.itemindex);
|
||||||
|
},
|
||||||
|
cleardefect(params, index) {
|
||||||
|
this.tagslist[index].defect = undefined;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.content {
|
||||||
|
padding: 20rpx;
|
||||||
|
margin: 30rpx;
|
||||||
|
}
|
||||||
|
.badtable {
|
||||||
|
padding: 20rpx;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,49 @@
|
|||||||
|
import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
|
||||||
|
import store from '@/store';
|
||||||
|
import http from '@/utils/request';
|
||||||
|
import { url } from '@/utils/url';
|
||||||
|
@Module({
|
||||||
|
namespaced: true,
|
||||||
|
dynamic: true,
|
||||||
|
store,
|
||||||
|
name: 'page.raw.badtable',
|
||||||
|
})
|
||||||
|
export class badtable extends VuexModule {
|
||||||
|
locList2: any = [];
|
||||||
|
materialtypeList: any = '';
|
||||||
|
@MutationAction
|
||||||
|
async getmaterialTypePDA() {
|
||||||
|
const result: any = await http.get(url.lanjuquality.Materialinspection.getDictData, {
|
||||||
|
//loginName: session.loginName,
|
||||||
|
params: {
|
||||||
|
dictType: 'material_type_oa',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(result);
|
||||||
|
const materialtypeList: [] = result;
|
||||||
|
const locList2 = materialtypeList.map((item: any) => ({
|
||||||
|
label: item.ymdTypeName,
|
||||||
|
value: item.ymdType,
|
||||||
|
}));
|
||||||
|
return { locList2 };
|
||||||
|
}
|
||||||
|
alldefectList: any = [];
|
||||||
|
@MutationAction
|
||||||
|
async getdefectList(params) {
|
||||||
|
const result: any = await http.get(url.lanjuquality.Materialinspection.getClassInfoList, {
|
||||||
|
//loginName: session.loginName,
|
||||||
|
params: {
|
||||||
|
defectCode: params,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(result);
|
||||||
|
const materialtypeList: [] = result.data;
|
||||||
|
const alldefectList = materialtypeList.map((item: any) => ({
|
||||||
|
label: item.className,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
return { alldefectList };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default getModule(badtable);
|
Loading…
Reference in New Issue