|
|
@@ -1,42 +1,92 @@
|
|
|
<template>
|
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never" v-loading="loading">
|
|
|
- <order-search @search="getList" ref="searchRef"> </order-search>
|
|
|
+ <order-search @search="reload" ref="searchRef"> </order-search>
|
|
|
<ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" :pageSize="20"
|
|
|
- :pageSizes="[20, 30, 40, 50, 100]">
|
|
|
+ :pageSizes="[20, 30, 40, 50, 100]">
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:toolbar>
|
|
|
<el-button type="primary" slot="reference" :disabled="selection.length == 0"
|
|
|
@click="disposeList(1)">批量处置</el-button>
|
|
|
|
|
|
-<!-- <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove" style="margin-left: 10px">-->
|
|
|
-<!-- <template v-slot:reference>-->
|
|
|
-<!-- <el-button :disabled="selection.length == 0" type="danger">批量删除</el-button>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-popconfirm>-->
|
|
|
+ <!-- <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove" style="margin-left: 10px">-->
|
|
|
+ <!-- <template v-slot:reference>-->
|
|
|
+ <!-- <el-button :disabled="selection.length == 0" type="danger">批量删除</el-button>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-popconfirm>-->
|
|
|
</template>
|
|
|
<template v-slot:action="{ row }">
|
|
|
-<!-- <el-popconfirm class="ele-action" title="确定要删除吗?" v-if="row.disposalStatus == null" @confirm="remove(row)">-->
|
|
|
-<!-- <template v-slot:reference>-->
|
|
|
-<!-- <el-link type="danger" :underline="false" icon="el-icon-delete">-->
|
|
|
-<!-- 删除-->
|
|
|
-<!-- </el-link>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-popconfirm>-->
|
|
|
- <el-link slot="reference" type="primary" :underline="false" icon="el-icon-edit" v-if="row.disposalStatus == null"
|
|
|
- @click="disposeList(2, row)">
|
|
|
+ <!-- <el-popconfirm class="ele-action" title="确定要删除吗?" v-if="row.disposalStatus == null" @confirm="remove(row)">-->
|
|
|
+ <!-- <template v-slot:reference>-->
|
|
|
+ <!-- <el-link type="danger" :underline="false" icon="el-icon-delete">-->
|
|
|
+ <!-- 删除-->
|
|
|
+ <!-- </el-link>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-popconfirm>-->
|
|
|
+ <el-link slot="reference" type="primary" :underline="false" icon="el-icon-edit"
|
|
|
+ v-if="row.disposalStatus == null" @click="disposeList(2, row)">
|
|
|
处置
|
|
|
</el-link>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
|
|
|
- <el-dialog :visible.sync="dialogVisible" width="10%" @close="close">
|
|
|
- <DictSelection dictName="不良品处理类型" :filterArr="all ? ['返工返修'] : []" v-model="disposeType" />
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <el-dialog :visible.sync="dialogVisible" width="35%" @close="close" title="处置">
|
|
|
+
|
|
|
+ <el-form ref="form1" :model="formData" label-width="80px">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="产品编码">
|
|
|
+ <el-input v-model="formData.categoryCode" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="产品名称">
|
|
|
+ <el-input v-model="formData.categoryName" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="批次号">
|
|
|
+ <el-input v-model="formData.batchNo" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="刻码">
|
|
|
+ <el-input v-model="formData.engrave" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="类型">
|
|
|
+ <template>
|
|
|
+ <template v-if="this.qualityType == 1">
|
|
|
+ <el-select v-model="formData.disposalStatus" placeholder="请选择" style="width: 100%;" clearable>
|
|
|
+ <el-option v-for="item in disposalStatusListType" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-if="this.qualityType == 2">
|
|
|
+ <el-select v-model="formData.disposalStatus" placeholder="请选择" style="width: 100%;" clearable>
|
|
|
+ <el-option v-for="item in disposalStatusList" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <!-- <DictSelection dictName="不良品处理类型" :filterArr="all ? ['返工返修'] : []" v-model="current.disposalStatus" /> -->
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消 </el-button>
|
|
|
- <el-button type="primary" @click="dispose()">确 定</el-button>
|
|
|
- </span>
|
|
|
+ <el-button type="primary" @click="handleDispose()">确 定</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
<Edit ref="edit" @success="save" />
|
|
|
</div>
|
|
|
@@ -67,8 +117,56 @@ export default {
|
|
|
// datasource: [],
|
|
|
disposeType: '',
|
|
|
dialogVisible: false,
|
|
|
- current: null,
|
|
|
- all: false
|
|
|
+ current: {},
|
|
|
+ formData: {},
|
|
|
+ all: false,
|
|
|
+ qualityType: null,
|
|
|
+ //来料
|
|
|
+ disposalStatusListType: [
|
|
|
+ {
|
|
|
+ value: 5,
|
|
|
+ label: '让步接收'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 9,
|
|
|
+ label: '退货'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ //生产
|
|
|
+ disposalStatusList: [
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: '返工'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: '返修'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: '报废'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 4,
|
|
|
+ label: '降级使用'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 5,
|
|
|
+ label: '让步接收'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 6,
|
|
|
+ label: '留样'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 7,
|
|
|
+ label: '消耗'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 8,
|
|
|
+ label: '回用'
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -81,7 +179,7 @@ export default {
|
|
|
columnKey: 'selection',
|
|
|
align: 'center',
|
|
|
selectable: (row, index) => {
|
|
|
- return row.status == 0; //
|
|
|
+ return row.status == 0;
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -200,6 +298,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
// this.getList();
|
|
|
+ this.qualityType = this.$route.query.qualityType;
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
@@ -220,6 +319,12 @@ export default {
|
|
|
console.log(arr, 'arr')
|
|
|
return arr.list;
|
|
|
},
|
|
|
+ reload(where) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.searchRef && this.$refs.searchRef.reload)
|
|
|
+ this.$refs.searchRef.reload({ page: 1, where: where });
|
|
|
+ })
|
|
|
+ },
|
|
|
remove(row) {
|
|
|
let ids = row ? [row.id] : this.selection.map((item) => item.id);
|
|
|
deleteUnacceptedProductDetail(ids).then((res) => {
|
|
|
@@ -229,7 +334,7 @@ export default {
|
|
|
},
|
|
|
close() {
|
|
|
this.all = false;
|
|
|
- this.disposeType = ''
|
|
|
+ this.formData.disposalStatus = ''
|
|
|
},
|
|
|
// // 处置
|
|
|
disposeList(type, row) {
|
|
|
@@ -237,15 +342,17 @@ export default {
|
|
|
this.all = true;
|
|
|
} else {
|
|
|
this.current = row;
|
|
|
+ console.log(this.current, 'row');
|
|
|
}
|
|
|
+ this.formData = { ...row };
|
|
|
this.dialogVisible = true;
|
|
|
// let ids = this.current ? [this.current.id] : this.selection.map((item) => item.id);
|
|
|
},
|
|
|
- async dispose() {
|
|
|
- if (!this.disposeType) {
|
|
|
+ async handleDispose() {
|
|
|
+ if (!this.formData.disposalStatus) {
|
|
|
return;
|
|
|
}
|
|
|
- this.$refs.edit.open(this.all ? this.selection : [this.current], this.disposeType);
|
|
|
+ this.$refs.edit.open(this.all ? this.selection : [this.current], this.formData.disposalStatus);
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
async save(data) {
|
|
|
@@ -264,7 +371,7 @@ export default {
|
|
|
this.dialogVisible = false;
|
|
|
this.current = null;
|
|
|
this.$message.success('处置成功!');
|
|
|
- this.getList();
|
|
|
+ this.reload();
|
|
|
}
|
|
|
}
|
|
|
};
|