|
@@ -314,6 +314,65 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="不良类型"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ v-if="form.recordingMethod != 1"
|
|
|
|
|
+ prop="badTypeId"
|
|
|
|
|
+ width="180"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="row.badTypeId"
|
|
|
|
|
+ placeholder="请选择不良类型"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ remote
|
|
|
|
|
+ filterable
|
|
|
|
|
+ :remote-method="getBadTypeList"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @change="badTypeChange(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in badTypeList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="不良名称"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="badNameId"
|
|
|
|
|
+ width="180"
|
|
|
|
|
+ v-if="form.recordingMethod != 1"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="row.badNameId"
|
|
|
|
|
+ placeholder="请选择不良名称"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ remote
|
|
|
|
|
+ filterable
|
|
|
|
|
+ :remote-method="(name) => getBadNameList(name, row.badTypeId)"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @change="badNameChange(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in badNameList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="操作"
|
|
label="操作"
|
|
|
align="center"
|
|
align="center"
|
|
@@ -555,7 +614,8 @@
|
|
|
import { getCodeList } from '@/api/login';
|
|
import { getCodeList } from '@/api/login';
|
|
|
import { inspectionProjectStatus } from '@/enum/dict.js';
|
|
import { inspectionProjectStatus } from '@/enum/dict.js';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
-
|
|
|
|
|
|
|
+ import { getList as getBadNameList } from '@/api/unacceptedProduct/unqualifiedName';
|
|
|
|
|
+ import { getList as getBadTypeList } from '@/api/unacceptedProduct/unqualifiedType';
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
mixins: [dictMixins],
|
|
|
|
|
|
|
@@ -595,6 +655,10 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ // 不良品类型列表
|
|
|
|
|
+ badTypeList: [],
|
|
|
|
|
+ // 不良名称列表
|
|
|
|
|
+ badNameList: [],
|
|
|
inspectionProjectStatus,
|
|
inspectionProjectStatus,
|
|
|
disposeTypeList: {
|
|
disposeTypeList: {
|
|
|
1: '返工',
|
|
1: '返工',
|
|
@@ -1128,7 +1192,8 @@
|
|
|
this.activeNameKK = this.activeName;
|
|
this.activeNameKK = this.activeName;
|
|
|
this.reload({ qualityWorkerId: this.ids });
|
|
this.reload({ qualityWorkerId: this.ids });
|
|
|
let direction = this.$getDirection();
|
|
let direction = this.$getDirection();
|
|
|
-
|
|
|
|
|
|
|
+ this.getBadTypeList();
|
|
|
|
|
+ this.getBadNameList();
|
|
|
direction.on('keyup', function (e, val) {
|
|
direction.on('keyup', function (e, val) {
|
|
|
if (e.keyCode == 39) {
|
|
if (e.keyCode == 39) {
|
|
|
direction.next();
|
|
direction.next();
|
|
@@ -1145,6 +1210,48 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 不良类型改变
|
|
|
|
|
+ badTypeChange(row) {
|
|
|
|
|
+ row.badTypeName = null;
|
|
|
|
|
+ // 赋值badTypeName
|
|
|
|
|
+ const badType = this.badTypeList.find(
|
|
|
|
|
+ (item) => item.id === row.badTypeId
|
|
|
|
|
+ );
|
|
|
|
|
+ if (badType) {
|
|
|
|
|
+ row.badTypeName = badType.name;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.getBadNameList('', row.badTypeId);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 不良名称改变
|
|
|
|
|
+ badNameChange(row) {
|
|
|
|
|
+ // 赋值badNameName
|
|
|
|
|
+ const badItem = this.badNameList.find(
|
|
|
|
|
+ (item) => item.id === row.badNameId
|
|
|
|
|
+ );
|
|
|
|
|
+ if (badItem) {
|
|
|
|
|
+ row.badNameName = badItem.name;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 查询不良类型
|
|
|
|
|
+ async getBadTypeList(name = '') {
|
|
|
|
|
+ const res = await getBadTypeList({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ size: 50,
|
|
|
|
|
+ name: name
|
|
|
|
|
+ });
|
|
|
|
|
+ this.badTypeList = res.list;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 查询不良名称
|
|
|
|
|
+ async getBadNameList(name = '', badTypeId = 0) {
|
|
|
|
|
+ const res = await getBadNameList({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ size: 50,
|
|
|
|
|
+ name: name,
|
|
|
|
|
+ badTypeId: badTypeId
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('this.badNameList', this.badNameList);
|
|
|
|
|
+ this.badNameList = res.list;
|
|
|
|
|
+ },
|
|
|
//合格数量变化设置样品清单 全减并且不拆包才执行
|
|
//合格数量变化设置样品清单 全减并且不拆包才执行
|
|
|
async setSampleList(val, total) {
|
|
async setSampleList(val, total) {
|
|
|
this.$set(this.sampleList[0], 'measureQuantity', val);
|
|
this.$set(this.sampleList[0], 'measureQuantity', val);
|
|
@@ -1487,8 +1594,8 @@
|
|
|
this.$emit('setSchemeList', this.templateList);
|
|
this.$emit('setSchemeList', this.templateList);
|
|
|
// this.schemeList = this.templateList;
|
|
// this.schemeList = this.templateList;
|
|
|
this.schemePagination.total = this.templateList.length;
|
|
this.schemePagination.total = this.templateList.length;
|
|
|
- if(this.form.recordingMethod == 1){
|
|
|
|
|
- this.$emit('setSchemeListChange')
|
|
|
|
|
|
|
+ if (this.form.recordingMethod == 1) {
|
|
|
|
|
+ this.$emit('setSchemeListChange');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handDel(index) {
|
|
handDel(index) {
|