|
@@ -213,7 +213,10 @@
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="addInspection"
|
|
@click="addInspection"
|
|
|
- v-if="form.items.length == 0 || clientEnvironmentId == 9"
|
|
|
|
|
|
|
+ v-if="
|
|
|
|
|
+ (form.items.length == 0 && clientEnvironmentId != 9) ||
|
|
|
|
|
+ clientEnvironmentId == 9
|
|
|
|
|
+ "
|
|
|
>选择质检方案</el-button
|
|
>选择质检方案</el-button
|
|
|
>
|
|
>
|
|
|
</template>
|
|
</template>
|
|
@@ -384,7 +387,8 @@
|
|
|
getDetail,
|
|
getDetail,
|
|
|
selfInspectionReport,
|
|
selfInspectionReport,
|
|
|
specialInspectionReport,
|
|
specialInspectionReport,
|
|
|
- addInspectionsTerm
|
|
|
|
|
|
|
+ addInspectionsTerm,
|
|
|
|
|
+ deleteInspectionItems
|
|
|
} from '@/api/produce/qualityInspection.js';
|
|
} from '@/api/produce/qualityInspection.js';
|
|
|
import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
import inspectionTemplatePop from '@/views/produce/components/bom/qualityTesting/inspectionTemplate.vue';
|
|
import inspectionTemplatePop from '@/views/produce/components/bom/qualityTesting/inspectionTemplate.vue';
|
|
@@ -450,6 +454,12 @@
|
|
|
computed: {
|
|
computed: {
|
|
|
columns() {
|
|
columns() {
|
|
|
return [
|
|
return [
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 50,
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
width: 50,
|
|
width: 50,
|
|
|
type: 'index',
|
|
type: 'index',
|
|
@@ -476,21 +486,21 @@
|
|
|
slot: 'toolList',
|
|
slot: 'toolList',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
label: '工具名称',
|
|
label: '工具名称',
|
|
|
- minWidth: 120
|
|
|
|
|
|
|
+ minWidth: 150
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'havePleaseEntrust',
|
|
prop: 'havePleaseEntrust',
|
|
|
slot: 'havePleaseEntrust',
|
|
slot: 'havePleaseEntrust',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
label: '是否请托',
|
|
label: '是否请托',
|
|
|
- minWidth: 70
|
|
|
|
|
|
|
+ minWidth: 140
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'status',
|
|
prop: 'status',
|
|
|
slot: 'status',
|
|
slot: 'status',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
label: '检验状态',
|
|
label: '检验状态',
|
|
|
- minWidth: 70
|
|
|
|
|
|
|
+ minWidth: 140
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'selfCheckDesc',
|
|
prop: 'selfCheckDesc',
|
|
@@ -635,6 +645,58 @@
|
|
|
this.$refs.inspectionTemplateRef.open('first');
|
|
this.$refs.inspectionTemplateRef.open('first');
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ deleteInspection() {
|
|
|
|
|
+ if (this.selection.length === 0) {
|
|
|
|
|
+ this.$message.warning('请先选择要删除的检验项');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.$confirm(
|
|
|
|
|
+ `确定要删除选中的 ${this.selection.length} 条检验项吗?`,
|
|
|
|
|
+ '提示',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(async () => {
|
|
|
|
|
+ const deleteIds = this.selection
|
|
|
|
|
+ .map((item) => item.id)
|
|
|
|
|
+ .filter(Boolean);
|
|
|
|
|
+
|
|
|
|
|
+ if (deleteIds.length > 0) {
|
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '删除中...',
|
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ await deleteInspectionItems({
|
|
|
|
|
+ recordId: this.form.id,
|
|
|
|
|
+ itemIds: deleteIds
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ this.$message.success('删除成功');
|
|
|
|
|
+ this.selection = [];
|
|
|
|
|
+ await this.getData();
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const selectionSet = new Set(this.selection);
|
|
|
|
|
+ this.form.items = this.form.items.filter(
|
|
|
|
|
+ (item) => !selectionSet.has(item)
|
|
|
|
|
+ );
|
|
|
|
|
+ this.selection = [];
|
|
|
|
|
+ this.$message.success('删除成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
async changeSel({ id }) {
|
|
async changeSel({ id }) {
|
|
|
const { data } = await getTemplateById(id);
|
|
const { data } = await getTemplateById(id);
|
|
|
|
|
|