|
|
@@ -10,7 +10,112 @@
|
|
|
:maxable="true"
|
|
|
>
|
|
|
<el-form ref="form1" :model="formData" :rules="rules" label-width="120px">
|
|
|
- <el-row>
|
|
|
+ <el-form-item label="处置方式:" prop="disposeType">
|
|
|
+ <el-select
|
|
|
+ v-model="formData.disposeType"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in disposeList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <template v-if="formData.disposeType == 6">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="留样日期:" prop="sampleDate" align="center">
|
|
|
+ <el-date-picker
|
|
|
+ class="w100"
|
|
|
+ v-model="formData.sampleDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="请输入"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6"> </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="margin-top: 12px">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item
|
|
|
+ label="留样条件:"
|
|
|
+ prop="sampleCondition"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="formData.sampleCondition"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="margin-top: 12px">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item
|
|
|
+ label="生产商/受托生产:"
|
|
|
+ prop="producerManufacturer"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="formData.producerManufacturer"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="margin-top: 12px">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="留样地点:" prop="samplePlace" align="center">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="formData.samplePlace"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="margin-top: 12px">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="留样备注:" prop="sampleRemark" align="center">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="formData.sampleRemark"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row style="margin-top: 12px">
|
|
|
+ <el-col :span="24"> </el-col>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-if="this.formData.disposeType !== 8">
|
|
|
+ <el-form-item label="入库仓库:" prop="depotId" align="center">
|
|
|
+ <el-select style="width: 100%" v-model="formData.depotId">
|
|
|
+ <el-option
|
|
|
+ v-for="item in warehouseList"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ @click.native="chooseWarehouse(item)"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- <el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="处置方式" prop="disposalStatus" align="center">
|
|
|
<el-select
|
|
|
@@ -141,7 +246,7 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
+ </el-row> -->
|
|
|
</el-form>
|
|
|
<template v-slot:footer>
|
|
|
<el-button @click="handleClose">取消</el-button>
|
|
|
@@ -151,42 +256,53 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { warehouseList } from '@/api/inspectionWork';
|
|
|
+ // import { warehouseList } from '@/api/inspectionWork';
|
|
|
+
|
|
|
+ import { getWarehouseList } from '@/api/samplemanagement';
|
|
|
|
|
|
export default {
|
|
|
components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
+ allList: [
|
|
|
+ { value: 1, label: '返工' },
|
|
|
+ { value: 2, label: '返修' },
|
|
|
+ { value: 3, label: '报废' },
|
|
|
+ { value: 4, label: '降级使用' },
|
|
|
+ { value: 5, label: '让步接收' },
|
|
|
+ { value: 6, label: '留样' },
|
|
|
+ { value: 7, label: '消耗' },
|
|
|
+ { value: 8, label: '回用/归批' },
|
|
|
+ { value: 9, label: '转试销' },
|
|
|
+ { value: 10, label: '退货' }
|
|
|
+ ],
|
|
|
title: '',
|
|
|
visible: false,
|
|
|
rowIndex: 0,
|
|
|
type: '',
|
|
|
formData: {
|
|
|
- disposalStatus: '',
|
|
|
+ disposeType: '',
|
|
|
sampleDate: '',
|
|
|
- disposeTime: '',
|
|
|
sampleCondition: '',
|
|
|
producerManufacturer: '',
|
|
|
samplePlace: '',
|
|
|
- sampleRemark: ''
|
|
|
+ sampleRemark: '',
|
|
|
+ depotId: '',
|
|
|
+ depotName: ''
|
|
|
},
|
|
|
qualityType: '',
|
|
|
warehouseList: [],
|
|
|
// 表单验证规则
|
|
|
rules: {
|
|
|
- disposeTime: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请选择处置时间',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ],
|
|
|
- disposalStatus: [
|
|
|
+ disposeType: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '请选择处置方式',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
+ ],
|
|
|
+ depotId: [
|
|
|
+ { required: true, message: '请选择仓库', trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
|
disposalStatusList: [
|
|
|
@@ -239,10 +355,27 @@
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ disposeList() {
|
|
|
+ if (this.$route.query.qualityType == 1) {
|
|
|
+ return this.allList.filter((item) => [5, 10].includes(item.value));
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.$route.query.qualityType == 2 ||
|
|
|
+ this.$route.query.qualityType == 3
|
|
|
+ ) {
|
|
|
+ return this.allList.filter(
|
|
|
+ (item) => item.value !== 8 && item.value !== 10
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return this.allList;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- created() {
|
|
|
- this.getWarehouseList();
|
|
|
+ async created() {
|
|
|
+ // this.getWarehouseList();
|
|
|
+ this.warehouseList = await getWarehouseList();
|
|
|
},
|
|
|
methods: {
|
|
|
handleWarehouseChange(val) {
|
|
|
@@ -252,24 +385,25 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- async getWarehouseList() {
|
|
|
- let res = await warehouseList({});
|
|
|
- this.warehouseList = res.map((item) => {
|
|
|
- item.disposeWarehouseName = item.name;
|
|
|
- item.disposeWarehouseId = item.id;
|
|
|
- return {
|
|
|
- ...item
|
|
|
- };
|
|
|
- });
|
|
|
- },
|
|
|
+ // async getWarehouseList() {
|
|
|
+ // let res = await warehouseList({});
|
|
|
+ // this.warehouseList = res.map((item) => {
|
|
|
+ // item.disposeWarehouseName = item.name;
|
|
|
+ // item.disposeWarehouseId = item.id;
|
|
|
+ // return {
|
|
|
+ // ...item
|
|
|
+ // };
|
|
|
+ // });
|
|
|
+ // },
|
|
|
async openDispose(index, row, type, qualityType) {
|
|
|
- this.visible = true;
|
|
|
if (index != null) {
|
|
|
this.formData = JSON.parse(JSON.stringify(row));
|
|
|
} else {
|
|
|
this.formData = {};
|
|
|
}
|
|
|
+ console.log(this.formData);
|
|
|
|
|
|
+ this.visible = true;
|
|
|
this.rowIndex = index;
|
|
|
this.type = type;
|
|
|
this.qualityType = qualityType;
|
|
|
@@ -285,6 +419,25 @@
|
|
|
this.visible = false;
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ chooseWarehouse(item) {
|
|
|
+ console.log(item);
|
|
|
+ this.formData.depotId = item.id;
|
|
|
+ this.formData.depotName = item.name;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'formData.disposeType': {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
+ this.formData.sampleCondition = '';
|
|
|
+ this.formData.sampleDate = '';
|
|
|
+ this.formData.samplePlace = '';
|
|
|
+ this.formData.sampleRemark = '';
|
|
|
+ this.formData.producerManufacturer = '';
|
|
|
+ this.formData.depotId = '';
|
|
|
+ this.formData.depotName = '';
|
|
|
+ },
|
|
|
+ // immediate: true
|
|
|
}
|
|
|
}
|
|
|
};
|