|
|
@@ -43,14 +43,26 @@
|
|
|
dictName="取样类型"
|
|
|
v-model="form.qualityMode"
|
|
|
clearable
|
|
|
+ @change="changeQualityMode"
|
|
|
:disabled="btnType == 'detail' || btnType == 'issued'"
|
|
|
></DictSelection>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="检验标准" prop="inspectionStandards">
|
|
|
+ <el-form-item label="计量类型" prop="inspectionStandards">
|
|
|
<!-- 计量 计重 -->
|
|
|
- <el-select style="width: 100%" v-model="form.inspectionStandards" placeholder="请选择">
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.inspectionStandards"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="changeInspectionType"
|
|
|
+ :disabled="
|
|
|
+ btnType == 'detail' ||
|
|
|
+ btnType == 'issued' ||
|
|
|
+ btnType == 'add' ||
|
|
|
+ btnType == 'edit'
|
|
|
+ "
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in inspectionStandardsList"
|
|
|
:label="item.label"
|
|
|
@@ -58,13 +70,30 @@
|
|
|
:key="item.value"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
+
|
|
|
+ <!-- <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.inspectionStandards"
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="
|
|
|
+ btnType == 'detail' ||
|
|
|
+ btnType == 'issued' ||
|
|
|
+ btnType == 'add' ||
|
|
|
+ btnType == 'edit'
|
|
|
+ "
|
|
|
+ /> -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="编码:" prop="code">
|
|
|
- <el-input clearable v-model="form.code" placeholder="请输入" disabled />
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.code"
|
|
|
+ placeholder="请输入"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
@@ -114,11 +143,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <div style="text-align: right;margin-bottom: 22px;">
|
|
|
+ <div style="text-align: right; margin-bottom: 22px">
|
|
|
<div @click="toggleExpand">
|
|
|
- <div v-if="isExpanded">
|
|
|
- <i class="el-icon-arrow-up"></i>收起
|
|
|
- </div>
|
|
|
+ <div v-if="isExpanded"> <i class="el-icon-arrow-up"></i>收起 </div>
|
|
|
<div v-if="!isExpanded">
|
|
|
<i class="el-icon-arrow-down"></i>展开更多
|
|
|
</div>
|
|
|
@@ -223,12 +250,18 @@
|
|
|
type="number"
|
|
|
v-model="form.productNumber"
|
|
|
:disabled="quantityShow ? false : true"
|
|
|
+ @input="changeProductNumber"
|
|
|
+ @change="changeProductNumber"
|
|
|
>
|
|
|
<!-- *** 之前只有主数据的显示 现在主数据 + 生产检验类型的都显示-->
|
|
|
<!-- :disabled="form.planSource == '5' ? false : true" -->
|
|
|
- <template
|
|
|
- #append
|
|
|
- >{{ form.dimension == 3 ? form.packingUnit : form.dimension == 2 ? form.measureUnit : categoryInfo.measuringUnit }}</template>
|
|
|
+ <template #append>{{
|
|
|
+ form.dimension == 3
|
|
|
+ ? form.packingUnit
|
|
|
+ : form.dimension == 2
|
|
|
+ ? form.measureUnit
|
|
|
+ : categoryInfo.measuringUnit
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -311,7 +344,10 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="附件:" prop="accessory">
|
|
|
- <fileUpload v-model="form.accessory" :type="btnType == 'detail' ? 'view' : ''" />
|
|
|
+ <fileUpload
|
|
|
+ v-model="form.accessory"
|
|
|
+ :type="btnType == 'detail' ? 'view' : ''"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -321,411 +357,515 @@
|
|
|
<productionPlan ref="productionPlanRef" @choose="handleChoose" />
|
|
|
<workOrder ref="workOrderRef" @choose="handleChoose" />
|
|
|
<produceOrder ref="produceOrderRef" @choose="handleChoose" />
|
|
|
- <EquipmentDialog ref="equipmentRefs" @choose="handleMainChoose" :type="2" :treeIds="['9']" />
|
|
|
+ <EquipmentDialog
|
|
|
+ ref="equipmentRefs"
|
|
|
+ @choose="handleMainChoose"
|
|
|
+ :type="2"
|
|
|
+ :treeIds="['9']"
|
|
|
+ />
|
|
|
<stokledger ref="stokledgerRef" @choose="handleStokledgerChoose" />
|
|
|
</el-form>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
-import fileUpload from '@/components/addDoc/index.vue';
|
|
|
+ import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
+ import fileUpload from '@/components/addDoc/index.vue';
|
|
|
|
|
|
-import warehousing from './warehousing';
|
|
|
-import productionPlan from './productionPlan';
|
|
|
-import workOrder from './workOrder';
|
|
|
-import produceOrder from './produceOrder';
|
|
|
-import EquipmentDialog from './equipmentDialog';
|
|
|
-import stokledger from './stokledger';
|
|
|
+ import warehousing from './warehousing';
|
|
|
+ import productionPlan from './productionPlan';
|
|
|
+ import workOrder from './workOrder';
|
|
|
+ import produceOrder from './produceOrder';
|
|
|
+ import EquipmentDialog from './equipmentDialog';
|
|
|
+ import stokledger from './stokledger';
|
|
|
|
|
|
-//接口
|
|
|
-import { getUserPage } from '@/api/system/organization';
|
|
|
-import { getByCode } from '@/api/system/dictionary-data';
|
|
|
-import { rules } from 'eslint-config-prettier';
|
|
|
+ //接口
|
|
|
+ import { getUserPage } from '@/api/system/organization';
|
|
|
+ import { getByCode } from '@/api/system/dictionary-data';
|
|
|
+ import { rules } from 'eslint-config-prettier';
|
|
|
|
|
|
-import { getDetailInfo } from '@/api/inspectionPlan/index.js';
|
|
|
+ import { getDetailInfo } from '@/api/inspectionPlan/index.js';
|
|
|
|
|
|
-export default {
|
|
|
- components: {
|
|
|
- EquipmentDialog,
|
|
|
- produceOrder,
|
|
|
- workOrder,
|
|
|
- productionPlan,
|
|
|
- warehousing,
|
|
|
- deptSelect,
|
|
|
- fileUpload,
|
|
|
- stokledger
|
|
|
- },
|
|
|
- props: {
|
|
|
- form: {
|
|
|
- type: Object,
|
|
|
- default: () => {}
|
|
|
- },
|
|
|
- btnType: {
|
|
|
- type: String,
|
|
|
- default: ''
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ EquipmentDialog,
|
|
|
+ produceOrder,
|
|
|
+ workOrder,
|
|
|
+ productionPlan,
|
|
|
+ warehousing,
|
|
|
+ deptSelect,
|
|
|
+ fileUpload,
|
|
|
+ stokledger
|
|
|
},
|
|
|
- packingLists: {
|
|
|
- type: Array,
|
|
|
- default: () => []
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- quantityShow() {
|
|
|
- if (this.btnType == 'detail') {
|
|
|
- return false;
|
|
|
+ props: {
|
|
|
+ form: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {}
|
|
|
+ },
|
|
|
+ btnType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ packingLists: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ },
|
|
|
+ isChangeNumber: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true
|
|
|
+ },
|
|
|
+ isChangeType: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true
|
|
|
}
|
|
|
- let flag =
|
|
|
- this.form.planSource == '5' ||
|
|
|
- this.form.planSource == '2' ||
|
|
|
- this.form.planSource == '3' ||
|
|
|
- this.form.planSource == '4';
|
|
|
- return flag;
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- 'form.productNumber': {
|
|
|
- handler(newVal) {
|
|
|
- // 现在生产检验所有的类型也用这个
|
|
|
- // if (newVal && this.form.planSource == '5') { //主数据来源才生效
|
|
|
- if (newVal && this.quantityShow) {
|
|
|
- this.$emit('changeProductNumberModel', newVal);
|
|
|
- this.form.totalWeight = this.categoryInfo.netWeight * newVal || 0;
|
|
|
- } else {
|
|
|
- console.log('清空样品清单');
|
|
|
- this.$emit('table2');
|
|
|
+ },
|
|
|
+
|
|
|
+ computed: {
|
|
|
+ quantityShow() {
|
|
|
+ if (this.btnType == 'detail') {
|
|
|
+ return false;
|
|
|
}
|
|
|
+ let flag =
|
|
|
+ this.form.planSource == '5' ||
|
|
|
+ this.form.planSource == '2' ||
|
|
|
+ this.form.planSource == '3' ||
|
|
|
+ this.form.planSource == '4';
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'form.productNumber': {
|
|
|
+ handler(newVal) {
|
|
|
+ // if (this.form.productNumber) {
|
|
|
+ // this.isInforChangeNumber = false;
|
|
|
+ // }
|
|
|
+ // 现在生产检验所有的类型也用这个
|
|
|
+ // if (newVal && this.form.planSource == '5') { //主数据来源才生效
|
|
|
+ // if (newVal && this.quantityShow && !this.isInforChangeNumber) {
|
|
|
+ // this.$emit('changeProductNumberModel', newVal);
|
|
|
+ // this.form.totalWeight = this.categoryInfo.netWeight * newVal || 0;
|
|
|
+ // } else {
|
|
|
+ // console.log('清空样品清单1');
|
|
|
+ // this.isInforChangeNumber = true;
|
|
|
+ // this.$emit('table2');
|
|
|
+ // }
|
|
|
+ console.log(this.btnType);
|
|
|
+ if (newVal && this.quantityShow && !this.isInforChangeNumber) {
|
|
|
+ this.$emit('changeProductNumberModel', newVal);
|
|
|
+ this.form.totalWeight = this.categoryInfo.netWeight * newVal || 0;
|
|
|
+ } else {
|
|
|
+ console.log('清空样品清单1');
|
|
|
+ this.isInforChangeNumber = true;
|
|
|
+ this.$emit('table2');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // immediate: false
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ 'form.qualityMode': {
|
|
|
+ handler(newVal) {
|
|
|
+ console.log(321321);
|
|
|
+ // if (newVal && !this.isInfoChangeModel) {
|
|
|
+ // this.$emit('changeModel', newVal);
|
|
|
+ // console.log(45464646464);
|
|
|
+ // } else {
|
|
|
+ // console.log('清空样品清单2');
|
|
|
+ // this.isInfoChangeModel = true;
|
|
|
+ // this.$emit('table2');
|
|
|
+ // }
|
|
|
+ // if (this.form.qualityMode) {
|
|
|
+ // this.isInfoChangeModel = false;
|
|
|
+ // }
|
|
|
+ console.log(this.btnType, this.isInfoChangeModel, '=====>');
|
|
|
+ if (newVal && !this.isInfoChangeModel) {
|
|
|
+ console.log(
|
|
|
+ this.btnType,
|
|
|
+ this.isInfoChangeModel,
|
|
|
+ '--------------->'
|
|
|
+ );
|
|
|
+ this.$emit('changeModel', newVal);
|
|
|
+ console.log(45464646464);
|
|
|
+ } else {
|
|
|
+ console.log('清空样品清单2');
|
|
|
+ this.isInfoChangeModel = true;
|
|
|
+ this.$emit('table2');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // immediate: false
|
|
|
+ immediate: true
|
|
|
},
|
|
|
- immediate: false
|
|
|
+ 'form.inspectionStandards': {
|
|
|
+ handler(newVal) {
|
|
|
+ // if (this.form.inspectionStandards) {
|
|
|
+ // this.isInfoChangeType = false;
|
|
|
+ // }
|
|
|
+ // console.log(this.btnType);
|
|
|
+ // if (newVal && !this.isInfoChangeType) {
|
|
|
+ // this.$emit('getInspectionStandards', newVal);
|
|
|
+ // } else {
|
|
|
+ // this.isInfoChangeType = true;
|
|
|
+ // console.log('清空样品清单3');
|
|
|
+ // this.$emit('table2');
|
|
|
+ // }
|
|
|
+ console.log(this.btnType);
|
|
|
+ // console.log(465413);
|
|
|
+ if (newVal) {
|
|
|
+ console.log('=====<><><><><');
|
|
|
+ this.$emit('getInspectionStandards', newVal);
|
|
|
+ } else {
|
|
|
+ this.isInfoChangeType = true;
|
|
|
+ console.log('清空样品清单3');
|
|
|
+ this.$emit('table2');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // immediate: false
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ 'form.type': {
|
|
|
+ handler(newVal) {
|
|
|
+ if (!newVal) {
|
|
|
+ this.form.planSource = '';
|
|
|
+ this.form.planSourceCode = '';
|
|
|
+ this.form.productName = '';
|
|
|
+ this.form.productCode = '';
|
|
|
+ this.form.batchNo = '';
|
|
|
+ this.form.specification = '';
|
|
|
+ this.form.modelType = '';
|
|
|
+ this.form.brandNo = '';
|
|
|
+ this.form.productNumber = '';
|
|
|
+ this.form.qualifiedNumber = '';
|
|
|
+ this.form.unqualifiedNumber = '';
|
|
|
+ this.form.qualificationRate = '';
|
|
|
+ this.form.totalWeight = '';
|
|
|
+ this.form.sampleNumber = '';
|
|
|
+ this.sourceList = [];
|
|
|
+ this.$emit('resetTable');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: false
|
|
|
+ },
|
|
|
+ 'form.planSource': {
|
|
|
+ handler(newVal) {
|
|
|
+ if (!newVal) {
|
|
|
+ this.form.planSource = '';
|
|
|
+ this.form.planSourceCode = '';
|
|
|
+ this.form.productName = '';
|
|
|
+ this.form.productCode = '';
|
|
|
+ this.form.batchNo = '';
|
|
|
+ this.form.specification = '';
|
|
|
+ this.form.modelType = '';
|
|
|
+ this.form.brandNo = '';
|
|
|
+ this.form.productNumber = '';
|
|
|
+ this.form.qualifiedNumber = '';
|
|
|
+ this.form.unqualifiedNumber = '';
|
|
|
+ this.form.qualificationRate = '';
|
|
|
+ this.form.totalWeight = '';
|
|
|
+ this.form.sampleNumber = '';
|
|
|
+ this.$emit('resetTable');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: false
|
|
|
+ }
|
|
|
},
|
|
|
- 'form.qualityMode': {
|
|
|
- handler(newVal) {
|
|
|
- if (newVal) {
|
|
|
- this.$emit('changeModel', newVal);
|
|
|
- } else {
|
|
|
- console.log('清空样品清单');
|
|
|
- this.$emit('table2');
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ executorList: [],
|
|
|
+ sourceList: [],
|
|
|
+ inspectionStandardsList: [],
|
|
|
+ rules: {
|
|
|
+ name: [{ required: true, message: '请输入', trigger: 'blur' }],
|
|
|
+ qualityMode: [
|
|
|
+ { required: true, message: '请选择检验方式', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ inspectionStandards: [
|
|
|
+ { required: true, message: '请选择检验标准', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ type: [{ required: true, message: '请选择类型', trigger: 'blur' }],
|
|
|
+ groupId: [
|
|
|
+ { required: true, message: '请选择执行部门', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ executeId: [
|
|
|
+ { required: true, message: '请选择执行人员:', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ planSource: [
|
|
|
+ { required: true, message: '请选择计划来源', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ isExpanded: false, // 控制展开/收起状态
|
|
|
+ categoryInfo: {},
|
|
|
+ isInforChangeNumber: true,
|
|
|
+ isInfoChangeType: true,
|
|
|
+ isInfoChangeModel: true,
|
|
|
+ isOnce: true,
|
|
|
+ isListData: [{}]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // this.getDictListIqoCode('iqo_code');
|
|
|
+ this.getDictListIqoCode('measurement_type');
|
|
|
+ console.log(this.form);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ toggleExpand(val) {
|
|
|
+ this.isExpanded = !this.isExpanded;
|
|
|
+ },
|
|
|
+ // 获取检验标准
|
|
|
+ async getDictListIqoCode(code) {
|
|
|
+ let { data: res } = await getByCode(code);
|
|
|
+ this.inspectionStandardsList = res.map((item) => {
|
|
|
+ let values = Object.keys(item);
|
|
|
+ return {
|
|
|
+ value: Number(values[0]),
|
|
|
+ label: item[values[0]]
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //质检计划类型
|
|
|
+ planChange(value) {
|
|
|
+ if (value == 1) {
|
|
|
+ this.sourceList = [{ label: '采购收货单', value: '1' }];
|
|
|
+ } else if (value == 2) {
|
|
|
+ this.sourceList = [
|
|
|
+ { label: '生产计划', value: '2' },
|
|
|
+ { label: '生产订单', value: '3' },
|
|
|
+ { label: '生产工单', value: '4' }
|
|
|
+ ];
|
|
|
}
|
|
|
},
|
|
|
- immediate: false
|
|
|
- },
|
|
|
- 'form.inspectionStandards': {
|
|
|
- handler(newVal) {
|
|
|
- if (newVal) {
|
|
|
- this.$emit('getInspectionStandards', newVal);
|
|
|
+ //选择部门(搜索)
|
|
|
+ searchDeptNodeClick(info, row) {
|
|
|
+ if (info) {
|
|
|
+ const params = { groupId: info };
|
|
|
+ this.getUserList(params);
|
|
|
+ this.form.groupName = row.name;
|
|
|
} else {
|
|
|
- console.log('清空样品清单');
|
|
|
- this.$emit('table2');
|
|
|
+ this.form.executeGroupId = null;
|
|
|
}
|
|
|
},
|
|
|
- immediate: false
|
|
|
- },
|
|
|
- 'form.type': {
|
|
|
- handler(newVal) {
|
|
|
- if (!newVal) {
|
|
|
- this.form.planSource = '';
|
|
|
- this.form.planSourceCode = '';
|
|
|
- this.form.productName = '';
|
|
|
- this.form.productCode = '';
|
|
|
- this.form.batchNo = '';
|
|
|
- this.form.specification = '';
|
|
|
- this.form.modelType = '';
|
|
|
- this.form.brandNo = '';
|
|
|
- this.form.productNumber = '';
|
|
|
- this.form.qualifiedNumber = '';
|
|
|
- this.form.unqualifiedNumber = '';
|
|
|
- this.form.qualificationRate = '';
|
|
|
- this.form.totalWeight = '';
|
|
|
- this.form.sampleNumber = '';
|
|
|
- this.sourceList = [];
|
|
|
- this.$emit('resetTable');
|
|
|
+ // 获取审核人列表、巡点检人员
|
|
|
+ async getUserList(params) {
|
|
|
+ try {
|
|
|
+ let data = { pageNum: 1, size: -1 };
|
|
|
+ // 如果传了参数就是获取巡点检人员数据
|
|
|
+ if (params) {
|
|
|
+ data = Object.assign(data, params);
|
|
|
+ }
|
|
|
+ const res = await getUserPage(data);
|
|
|
+ this.executorList = res.list;
|
|
|
+ } catch (error) {}
|
|
|
+ },
|
|
|
+ // 执行人选择
|
|
|
+ changeExecutor(val) {
|
|
|
+ if (val) {
|
|
|
+ this.form.executeId = val;
|
|
|
+ this.form.executeName = this.executorList.filter(
|
|
|
+ (item) => item.id === val
|
|
|
+ )[0].name;
|
|
|
}
|
|
|
},
|
|
|
- immediate: false
|
|
|
- },
|
|
|
- 'form.planSource': {
|
|
|
- handler(newVal) {
|
|
|
- if (!newVal) {
|
|
|
- this.form.planSource = '';
|
|
|
- this.form.planSourceCode = '';
|
|
|
- this.form.productName = '';
|
|
|
- this.form.productCode = '';
|
|
|
- this.form.batchNo = '';
|
|
|
- this.form.specification = '';
|
|
|
- this.form.modelType = '';
|
|
|
- this.form.brandNo = '';
|
|
|
- this.form.productNumber = '';
|
|
|
- this.form.qualifiedNumber = '';
|
|
|
- this.form.unqualifiedNumber = '';
|
|
|
- this.form.qualificationRate = '';
|
|
|
- this.form.totalWeight = '';
|
|
|
- this.form.sampleNumber = '';
|
|
|
- this.$emit('resetTable');
|
|
|
+ //计划来源选择
|
|
|
+ planSourceChange(val) {
|
|
|
+ if (val) {
|
|
|
+ this.addProduct();
|
|
|
}
|
|
|
},
|
|
|
- immediate: false
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- executorList: [],
|
|
|
- sourceList: [],
|
|
|
- inspectionStandardsList: [],
|
|
|
- rules: {
|
|
|
- name: [{ required: true, message: '请输入', trigger: 'blur' }],
|
|
|
- qualityMode: [
|
|
|
- { required: true, message: '请选择检验方式', trigger: 'blur' }
|
|
|
- ],
|
|
|
- inspectionStandards: [
|
|
|
- { required: true, message: '请选择检验标准', trigger: 'blur' }
|
|
|
- ],
|
|
|
- type: [{ required: true, message: '请选择类型', trigger: 'blur' }],
|
|
|
- groupId: [
|
|
|
- { required: true, message: '请选择执行部门', trigger: 'blur' }
|
|
|
- ],
|
|
|
- executeId: [
|
|
|
- { required: true, message: '请选择执行人员:', trigger: 'blur' }
|
|
|
- ],
|
|
|
- planSource: [
|
|
|
- { required: true, message: '请选择计划来源', trigger: 'blur' }
|
|
|
- ]
|
|
|
+ addProduct() {
|
|
|
+ if (this.form.planSource == 1) {
|
|
|
+ this.$refs.warehousingRef.open();
|
|
|
+ } else if (this.form.planSource == 2) {
|
|
|
+ this.$refs.productionPlanRef.open();
|
|
|
+ } else if (this.form.planSource == 3) {
|
|
|
+ this.$refs.workOrderRef.open();
|
|
|
+ } else if (this.form.planSource == 4) {
|
|
|
+ this.$refs.produceOrderRef.open();
|
|
|
+ } else if (this.form.planSource == 5) {
|
|
|
+ //主数据
|
|
|
+ this.$refs.equipmentRefs.open();
|
|
|
+ } else if (this.form.planSource == 6) {
|
|
|
+ //库存台账
|
|
|
+ this.$refs.stokledgerRef.open();
|
|
|
+ }
|
|
|
},
|
|
|
- isExpanded: false, // 控制展开/收起状态
|
|
|
- categoryInfo: {}
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getDictListIqoCode('iqo_code');
|
|
|
- },
|
|
|
- methods: {
|
|
|
- toggleExpand(val) {
|
|
|
- this.isExpanded = !this.isExpanded;
|
|
|
- },
|
|
|
- // 获取检验标准
|
|
|
- async getDictListIqoCode(code) {
|
|
|
- let { data: res } = await getByCode(code);
|
|
|
- this.inspectionStandardsList = res.map((item) => {
|
|
|
- let values = Object.keys(item);
|
|
|
- return {
|
|
|
- value: Number(values[0]),
|
|
|
- label: item[values[0]]
|
|
|
- };
|
|
|
- });
|
|
|
- },
|
|
|
- //质检计划类型
|
|
|
- planChange(value) {
|
|
|
- if (value == 1) {
|
|
|
- this.sourceList = [{ label: '采购收货单', value: '1' }];
|
|
|
- } else if (value == 2) {
|
|
|
- this.sourceList = [
|
|
|
- { label: '生产计划', value: '2' },
|
|
|
- { label: '生产订单', value: '3' },
|
|
|
- { label: '生产工单', value: '4' }
|
|
|
- ];
|
|
|
- }
|
|
|
- },
|
|
|
- //选择部门(搜索)
|
|
|
- searchDeptNodeClick(info, row) {
|
|
|
- if (info) {
|
|
|
- const params = { groupId: info };
|
|
|
- this.getUserList(params);
|
|
|
- this.form.groupName = row.name;
|
|
|
- } else {
|
|
|
- this.form.executeGroupId = null;
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取审核人列表、巡点检人员
|
|
|
- async getUserList(params) {
|
|
|
- try {
|
|
|
- let data = { pageNum: 1, size: -1 };
|
|
|
- // 如果传了参数就是获取巡点检人员数据
|
|
|
- if (params) {
|
|
|
- data = Object.assign(data, params);
|
|
|
+ //根据类型获取计划来源下拉
|
|
|
+ typeChange(val) {
|
|
|
+ if (val == 1) {
|
|
|
+ this.sourceList = [{ label: '采购收货单', value: '1' }];
|
|
|
+ } else if (val == 2) {
|
|
|
+ this.sourceList = [
|
|
|
+ // { label: '生产计划', value: '2' },
|
|
|
+ // { label: '生产订单', value: '3' },
|
|
|
+ { label: '生产工单', value: '4' }
|
|
|
+ ];
|
|
|
+ } else if (val == 3) {
|
|
|
+ this.sourceList = [
|
|
|
+ { label: '主数据', value: '5' },
|
|
|
+ { label: '库存台账', value: '6' }
|
|
|
+ ];
|
|
|
}
|
|
|
- const res = await getUserPage(data);
|
|
|
- this.executorList = res.list;
|
|
|
- } catch (error) {}
|
|
|
- },
|
|
|
- // 执行人选择
|
|
|
- changeExecutor(val) {
|
|
|
- if (val) {
|
|
|
- this.form.executeId = val;
|
|
|
- this.form.executeName = this.executorList.filter(
|
|
|
- (item) => item.id === val
|
|
|
- )[0].name;
|
|
|
- }
|
|
|
- },
|
|
|
- //计划来源选择
|
|
|
- planSourceChange(val) {
|
|
|
- if (val) {
|
|
|
- this.addProduct();
|
|
|
- }
|
|
|
- },
|
|
|
- addProduct() {
|
|
|
- if (this.form.planSource == 1) {
|
|
|
- this.$refs.warehousingRef.open();
|
|
|
- } else if (this.form.planSource == 2) {
|
|
|
- this.$refs.productionPlanRef.open();
|
|
|
- } else if (this.form.planSource == 3) {
|
|
|
- this.$refs.workOrderRef.open();
|
|
|
- } else if (this.form.planSource == 4) {
|
|
|
- this.$refs.produceOrderRef.open();
|
|
|
- } else if (this.form.planSource == 5) {
|
|
|
- //主数据
|
|
|
- this.$refs.equipmentRefs.open();
|
|
|
- } else if (this.form.planSource == 6) {
|
|
|
- //库存台账
|
|
|
- this.$refs.stokledgerRef.open();
|
|
|
- }
|
|
|
- },
|
|
|
- //根据类型获取计划来源下拉
|
|
|
- typeChange(val) {
|
|
|
- if (val == 1) {
|
|
|
- this.sourceList = [{ label: '采购收货单', value: '1' }];
|
|
|
- } else if (val == 2) {
|
|
|
- this.sourceList = [
|
|
|
- { label: '生产计划', value: '2' },
|
|
|
- { label: '生产订单', value: '3' },
|
|
|
- { label: '生产工单', value: '4' }
|
|
|
- ];
|
|
|
- } else if (val == 3) {
|
|
|
- this.sourceList = [
|
|
|
- { label: '主数据', value: '5' },
|
|
|
- { label: '库存台账', value: '6' }
|
|
|
- ];
|
|
|
- }
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- //主数据根据来源得到产品
|
|
|
- handleMainChoose(val) {
|
|
|
- console.log(val, '主数据根据来源得到产品');
|
|
|
- if (!val) return;
|
|
|
- this.form.productName = val.name; //名称
|
|
|
- this.form.productCode = val.code; //编码
|
|
|
- this.form.specification = val.specification; //规格
|
|
|
- this.form.modelType = val.modelType; //型号
|
|
|
- this.form.brandNo = val.brandNum; //牌号
|
|
|
- this.form.totalWeight = val.totalWeight; //总重量
|
|
|
- this.form.inspectionStandards = val.inspectionStandards; //检验标准
|
|
|
- this.form.isConsumable = val.isConsumable; //0 单件 1 批量
|
|
|
- this.form.productId = val.id;
|
|
|
- this.form.netWeight = val.netWeight; //净重
|
|
|
- // console.log(this.form.type)
|
|
|
- this.getProductDetails(this.form.productId);
|
|
|
- this.$emit('changesMainNumberModal', this.form.productNumber);
|
|
|
- if (this.form.type != 3) {
|
|
|
- this.$emit('getQualityTemplate', val.code);
|
|
|
- }
|
|
|
- },
|
|
|
+ //主数据根据来源得到产品
|
|
|
+ handleMainChoose(val) {
|
|
|
+ console.log(val, '主数据根据来源得到产品');
|
|
|
+ if (!val) return;
|
|
|
|
|
|
- //库存台账根据来源得到产品
|
|
|
- handleStokledgerChoose(list, dimension) {
|
|
|
- let val = list[0];
|
|
|
- console.log(val, '库存台账根据来源得到产品');
|
|
|
- if (!val) return;
|
|
|
- if (dimension == 3) {
|
|
|
- this.form.productNumber = val.measureQuantity; //数量
|
|
|
- this.form.packingUnit = val.packingUnit; //包装单位
|
|
|
- } else {
|
|
|
- this.form.productNumber = val.outboundNum; //数量
|
|
|
- this.form.totalWeight = (
|
|
|
- (val.weight / val.measureQuantity) *
|
|
|
- val.outboundNum
|
|
|
- ).toFixed(2); //总重量
|
|
|
- }
|
|
|
- this.form.dimension = dimension;
|
|
|
- this.form.measureUnit = val.measureUnit; //计量单位
|
|
|
+ console.log();
|
|
|
+ this.form.productName = val.name; //名称
|
|
|
+ this.form.productCode = val.code; //编码
|
|
|
+ this.form.specification = val.specification; //规格
|
|
|
+ this.form.modelType = val.modelType; //型号
|
|
|
+ this.form.brandNo = val.brandNum; //牌号
|
|
|
+ this.form.totalWeight = val.totalWeight; //总重量
|
|
|
+ this.form.inspectionStandards = val.inspectionStandards; //检验标准
|
|
|
+ this.form.isConsumable = val.isConsumable; //0 单件 1 批量
|
|
|
+ this.form.productId = val.id;
|
|
|
+ this.form.netWeight = val.netWeight; //净重
|
|
|
+ // console.log(this.form.type)
|
|
|
+ this.getProductDetails(this.form.productId);
|
|
|
+ this.$emit('changesMainNumberModal', this.form.productNumber);
|
|
|
+ if (this.form.type != 3) {
|
|
|
+ this.$emit('getQualityTemplate', val.code);
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- this.form.productName = val.categoryName; //名称
|
|
|
- this.form.productCode = val.categoryCode; //编码
|
|
|
- this.form.specification = val.specification; //规格
|
|
|
- this.form.modelType = val.categoryModel; //型号
|
|
|
- this.form.brandNo = val.brandNum; //牌号
|
|
|
- this.form.inspectionStandards = val.inspectionStandards; //检验标准
|
|
|
- this.form.productId = val.categoryId;
|
|
|
- this.form.batchNo = val.batchNo; //批次号
|
|
|
- this.getProductDetails(this.form.productId);
|
|
|
- this.$emit('changesStokledgerNumberModal', list, dimension);
|
|
|
- if (this.form.type != 3) {
|
|
|
- this.$emit('getQualityTemplate', val.categoryCode);
|
|
|
- }
|
|
|
- },
|
|
|
+ //库存台账根据来源得到产品
|
|
|
+ handleStokledgerChoose(list, dimension) {
|
|
|
+ let val = list[0];
|
|
|
+ console.log(val, '库存台账根据来源得到产品');
|
|
|
+ if (!val) return;
|
|
|
+ if (dimension == 3) {
|
|
|
+ this.form.productNumber = val.measureQuantity; //数量
|
|
|
+ this.form.packingUnit = val.packingUnit; //包装单位
|
|
|
+ } else {
|
|
|
+ this.form.productNumber = val.outboundNum; //数量
|
|
|
+ this.form.totalWeight = (
|
|
|
+ (val.weight / val.measureQuantity) *
|
|
|
+ val.outboundNum
|
|
|
+ ).toFixed(2); //总重量
|
|
|
+ }
|
|
|
+ this.form.dimension = dimension;
|
|
|
+ this.form.measureUnit = val.measureUnit; //计量单位
|
|
|
|
|
|
- // 根据来源得到产品
|
|
|
- handleChoose(val) {
|
|
|
- console.log(val, '根据来源得到产品');
|
|
|
- if (!val) return;
|
|
|
- this.form.planSourceCode = val.receiveNo;
|
|
|
- // *** 之前未对生产检验进行判断 当类型是生产检验的时候 productId 是 undefined
|
|
|
- // 直接赋值 productId 不改变原来逻辑
|
|
|
- // 这里的字段 receiveNo 从生产检验(生产计划,生产订单,生产工单)里面没有 ->对应的是code 字段 但是不能够进入 getList 方法
|
|
|
- // 定义一个专门给 生产检验(生产计划,生产订单,生产工单) 的字段传递下去 productionCode
|
|
|
- let productionCode = '';
|
|
|
- if (this.form.type == 2) {
|
|
|
- val.productId = val.categoryId;
|
|
|
- productionCode = val.code;
|
|
|
- this.form.planSourceCode = productionCode;
|
|
|
- }
|
|
|
- // ***
|
|
|
- this.form.planSourceId = val.id;
|
|
|
- // this.form.planSourceCode = val.receiveNo; // 放上去 方便判断
|
|
|
- this.form.supplierName = val.supplierName;
|
|
|
- this.form.supplierMark = val.supplierMark;
|
|
|
- this.form.productName = val.productName;
|
|
|
- this.form.productCode = val.productCode;
|
|
|
- this.form.batchNo = val.batchNo;
|
|
|
- this.form.specification = val.specification;
|
|
|
- this.form.modelType = val.modelType;
|
|
|
- this.form.brandNo = val.brandNo;
|
|
|
- this.form.productNumber = val.totalCount;
|
|
|
- this.form.qualifiedNumber = val.qualifiedNumber;
|
|
|
- this.form.unqualifiedNumber = val.unqualifiedNumber;
|
|
|
- this.form.qualificationRate = val.qualificationRate;
|
|
|
- this.form.totalWeight = val.totalWeight;
|
|
|
- this.form.sampleNumber = val.sampleNumber;
|
|
|
- this.form.inspectionStandards = val.inspectionStandards;
|
|
|
- this.form.produceTaskName = val.taskName;
|
|
|
- this.form.produceTaskId = val.taskId;
|
|
|
- this.form.productId = val.productId;
|
|
|
- let receiveNo = val.receiveNo;
|
|
|
- let categoryCode = val.productCode;
|
|
|
- let categoryid = val.productId;
|
|
|
- let batchNo = val.batchNo;
|
|
|
- let productCategoryId = val.productCategoryId;
|
|
|
- let productCategoryName = val.productCategoryName;
|
|
|
+ this.form.productName = val.categoryName; //名称
|
|
|
+ this.form.productCode = val.categoryCode; //编码
|
|
|
+ this.form.specification = val.specification; //规格
|
|
|
+ this.form.modelType = val.categoryModel; //型号
|
|
|
+ this.form.brandNo = val.brandNum; //牌号
|
|
|
+ this.form.inspectionStandards = val.inspectionStandards; //检验标准
|
|
|
+ this.form.productId = val.categoryId;
|
|
|
+ this.form.batchNo = val.batchNo; //批次号
|
|
|
+ this.getProductDetails(this.form.productId);
|
|
|
+ this.$emit('changesStokledgerNumberModal', list, dimension);
|
|
|
+ if (this.form.type != 3) {
|
|
|
+ this.$emit('getQualityTemplate', val.categoryCode);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 根据来源得到产品
|
|
|
+ handleChoose(val) {
|
|
|
+ console.log(val, '根据来源得到产品');
|
|
|
+ if (!val) return;
|
|
|
+ this.form.planSourceCode = val.receiveNo;
|
|
|
+ // *** 之前未对生产检验进行判断 当类型是生产检验的时候 productId 是 undefined
|
|
|
+ // 直接赋值 productId 不改变原来逻辑
|
|
|
+ // 这里的字段 receiveNo 从生产检验(生产计划,生产订单,生产工单)里面没有 ->对应的是code 字段 但是不能够进入 getList 方法
|
|
|
+ // 定义一个专门给 生产检验(生产计划,生产订单,生产工单) 的字段传递下去 productionCode
|
|
|
+ let productionCode = '';
|
|
|
+ if (this.form.type == 2) {
|
|
|
+ val.productId = val.categoryId;
|
|
|
+ productionCode = val.code;
|
|
|
+ this.form.planSourceCode = productionCode;
|
|
|
+ }
|
|
|
+ // ***
|
|
|
+ this.form.planSourceId = val.id;
|
|
|
+ // this.form.planSourceCode = val.receiveNo; // 放上去 方便判断
|
|
|
+ this.form.supplierName = val.supplierName;
|
|
|
+ this.form.supplierMark = val.supplierMark;
|
|
|
+ this.form.productName = val.productName;
|
|
|
+ this.form.productCode = val.productCode;
|
|
|
+ this.form.batchNo = val.batchNo;
|
|
|
+ this.form.specification = val.specification;
|
|
|
+ this.form.modelType = val.modelType;
|
|
|
+ this.form.brandNo = val.brandNo;
|
|
|
+ this.form.productNumber = val.totalCount;
|
|
|
+ this.form.qualifiedNumber = val.qualifiedNumber;
|
|
|
+ this.form.unqualifiedNumber = val.unqualifiedNumber;
|
|
|
+ this.form.qualificationRate = val.qualificationRate;
|
|
|
+ this.form.totalWeight = val.totalWeight;
|
|
|
+ this.form.sampleNumber = val.sampleNumber;
|
|
|
+ this.form.inspectionStandards = val.inspectionStandards;
|
|
|
+ this.form.produceTaskName = val.taskName;
|
|
|
+ this.form.produceTaskId = val.taskId;
|
|
|
+ this.form.productId = val.productId;
|
|
|
+ let receiveNo = val.receiveNo;
|
|
|
+ let categoryCode = val.productCode;
|
|
|
+ let categoryid = val.productId;
|
|
|
+ let batchNo = val.batchNo;
|
|
|
+ let productCategoryId = val.productCategoryId;
|
|
|
+ let productCategoryName = val.productCategoryName;
|
|
|
|
|
|
- if (receiveNo && categoryCode && categoryid) {
|
|
|
- this.$emit(
|
|
|
- 'getList',
|
|
|
- receiveNo,
|
|
|
- categoryCode,
|
|
|
- productCategoryId,
|
|
|
- productCategoryName,
|
|
|
- categoryid,
|
|
|
+ console.log(this.form.productId, batchNo, productionCode);
|
|
|
+
|
|
|
+ if (receiveNo && categoryCode && categoryid) {
|
|
|
+ this.$emit(
|
|
|
+ 'getList',
|
|
|
+ receiveNo,
|
|
|
+ categoryCode,
|
|
|
+ productCategoryId,
|
|
|
+ productCategoryName,
|
|
|
+ categoryid,
|
|
|
+ batchNo,
|
|
|
+ val.supplierName,
|
|
|
+ val.supplierMark
|
|
|
+ );
|
|
|
+ }
|
|
|
+ this.getProductDetails(
|
|
|
+ this.form.productId,
|
|
|
batchNo,
|
|
|
- val.supplierName,
|
|
|
- val.supplierMark
|
|
|
+ productionCode,
|
|
|
+ val.id,
|
|
|
+ val.taskId
|
|
|
);
|
|
|
+ },
|
|
|
+ //获取产品详情信息-来自主数据
|
|
|
+ // *** 增加 batchNo productionCode 字段 给 生产检验类型用
|
|
|
+ async getProductDetails(
|
|
|
+ val,
|
|
|
+ batchNo = '',
|
|
|
+ productionCode = '',
|
|
|
+ id = '',
|
|
|
+ taskId = ''
|
|
|
+ ) {
|
|
|
+ const data = await getDetailInfo(val);
|
|
|
+ this.categoryInfo = data.category;
|
|
|
+ const qmsData = data.categoryQms;
|
|
|
+
|
|
|
+ // *** 新增 批次号,来源单据 字段传递
|
|
|
+ console.log(this.categoryInfo.measureType);
|
|
|
+ this.form.inspectionStandards = this.categoryInfo.measureType;
|
|
|
+ this.form.qualityMode = qmsData.checkFormula || 1;
|
|
|
+ data.category.batchNo = batchNo;
|
|
|
+ data.category.id = id;
|
|
|
+ data.category.planSourceCode = productionCode;
|
|
|
+ data.category.taskId = taskId;
|
|
|
+ // ***
|
|
|
+ this.$emit('getCategoryInfo', data);
|
|
|
+ },
|
|
|
+ getsampleMeasureUnit(val) {
|
|
|
+ this.$set(this.form, 'sampleMeasureUnit', val);
|
|
|
+ },
|
|
|
+ changeProductNumber() {
|
|
|
+ this.isInforChangeNumber = false;
|
|
|
+ },
|
|
|
+ changeInspectionType() {
|
|
|
+ this.isInfoChangeType = false;
|
|
|
+ },
|
|
|
+ changeQualityMode() {
|
|
|
+ this.isInfoChangeModel = false;
|
|
|
}
|
|
|
- this.getProductDetails(this.form.productId, batchNo, productionCode);
|
|
|
- },
|
|
|
- //获取产品详情信息-来自主数据
|
|
|
- // *** 增加 batchNo productionCode 字段 给 生产检验类型用
|
|
|
- async getProductDetails(val, batchNo = '', productionCode = '') {
|
|
|
- const data = await getDetailInfo(val);
|
|
|
- this.categoryInfo = data.category;
|
|
|
- // *** 新增 批次号,来源单据 字段传递
|
|
|
- data.category.batchNo = batchNo;
|
|
|
- data.category.planSourceCode = productionCode;
|
|
|
- // ***
|
|
|
- this.$emit('getCategoryInfo', data);
|
|
|
- },
|
|
|
- getsampleMeasureUnit(val) {
|
|
|
- this.$set(this.form, 'sampleMeasureUnit', val);
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-::v-deep .el-form-item .el-form-item--medium .more {
|
|
|
- margin: 0 !important;
|
|
|
-}
|
|
|
+ ::v-deep .el-form-item .el-form-item--medium .more {
|
|
|
+ margin: 0 !important;
|
|
|
+ }
|
|
|
</style>
|