|
|
@@ -1,33 +1,36 @@
|
|
|
+<!-- @desc:半检 @auth:寇珊珊 @time:2023年3月7日09:22:05 -->
|
|
|
<template>
|
|
|
<div class="main-div">
|
|
|
- <DkPageButton :total="editKeys?editKeys.length:0"
|
|
|
+ <DkPaxeButton :total="editKeys?editKeys.length:0"
|
|
|
:current="editIndex"
|
|
|
v-if="editKeys && editKeys.length > 1"
|
|
|
- @pageChange="editPageChange"></DkPageButton>
|
|
|
-
|
|
|
+ @pageChange="editPageChange"></DkPaxeButton>
|
|
|
<DkCollapse>
|
|
|
<DkPanel prop="essentialInformation">
|
|
|
+
|
|
|
<!-- 下拉区域 -->
|
|
|
<DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
|
|
|
<!--选择工位-->
|
|
|
- <DkFormItem :required="true" prop="stationId" :data-type="$config.dataType.number" :label="$t('stationId')">
|
|
|
+ <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
|
|
|
+ :data-type="$config.dataType.number" :label="$t('stationId')">
|
|
|
<SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
|
|
|
:type="this.$config.MagnifierType.station"
|
|
|
:multiple="false"
|
|
|
+ :search-info="{flowNodeId:flowNodeId}"
|
|
|
@ok="chooseStation"></SelectMagnifier>
|
|
|
</DkFormItem>
|
|
|
<!--生产工号-->
|
|
|
- <DkFormItem :required="true" prop="makeUserName">
|
|
|
- <InputPop ref="makeUserName" v-model="formData.makeUserName" />
|
|
|
+ <DkFormItem :required="true" prop="prodUserCode">
|
|
|
+ <InputPop ref="prodUserCode" v-model="formData.prodUserCode" @on-blur="onProdUserCode"/>
|
|
|
</DkFormItem>
|
|
|
<!--产品条码-->
|
|
|
- <DkFormItem :required="true" prop="pdtBarcode">
|
|
|
- <InputPop ref="pdtBarcode" v-model="formData.pdtBarcode" @on-blur="onBlurBarCode"/>
|
|
|
- </DkFormItem>
|
|
|
- <!--产品查询-->
|
|
|
- <DkFormItem >
|
|
|
- <DkButton type="primary" @click="productSelect">{{ $v('search') }}</DkButton>
|
|
|
+ <DkFormItem :required="true" prop="barCode">
|
|
|
+ <InputPop :readonly="!formData.prodUserId" ref="barCode" v-model="formData.barCode" @on-blur="onBarCode"/>
|
|
|
</DkFormItem>
|
|
|
+ <!-- <!–产品查询–>-->
|
|
|
+ <!-- <DkFormItem >-->
|
|
|
+ <!-- <DkButton type="primary" @click="productSelect">{{ $v('search') }}</DkButton>-->
|
|
|
+ <!-- </DkFormItem>-->
|
|
|
<!--商标-->
|
|
|
<DkFormItem :required="true" prop="logoName">
|
|
|
<InputPop ref="logoName" v-model="formData.logoName" :readonly="true"/>
|
|
|
@@ -42,33 +45,53 @@
|
|
|
</DkFormItem>
|
|
|
<!--名称-->
|
|
|
<DkFormItem :required="true" prop="productName">
|
|
|
- <InputPop ref="productName" v-model="formData.productName" :readonly="true" />
|
|
|
+ <InputPop ref="productName" v-model="formData.productName" :readonly="true"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--产品等级-->
|
|
|
+ <DkFormItem prop="gradeName" :required="true" :label="$t('gradeKind')" data-type="number">
|
|
|
+ <SelectPop v-model="formData.gradeName" ref="gradeName" :multiple="false"
|
|
|
+ :options="gradeList"
|
|
|
+ @on-select="chooseGrade"
|
|
|
+ labelKey="gradeName"
|
|
|
+ valueKey="gradeId">
|
|
|
+ </SelectPop>
|
|
|
</DkFormItem>
|
|
|
</DkForm>
|
|
|
</DkPanel>
|
|
|
- <DkPanel prop="details">
|
|
|
- <div slot="content" :style="'height: ' + tableHeight + 'px'">
|
|
|
+ <DkPanel prop="details" v-show="formData.barCode && formData.opnGradeKind&& formData.opnGradeKind != '产品等级-优'">
|
|
|
+ <DkSplit slot="content" v-model="split" :height="tableHeight">
|
|
|
<!--缺陷信息-->
|
|
|
- <EditTable slot="left" ref="moldingRecord" :data="detailList"
|
|
|
+ <EditTable slot="left" ref="recordTable" :data="detailList"
|
|
|
:columns="detailColumns"
|
|
|
:height="tableHeight"
|
|
|
- :operate-flag="false"
|
|
|
- :new-row-flag="false"
|
|
|
:freeze="false"
|
|
|
@current-change="currentChange"
|
|
|
- @changeValue="changeValue"></EditTable>
|
|
|
- </div>
|
|
|
+ @chooseData="chooseData"
|
|
|
+ controlId="defectCode"
|
|
|
+ @changeValue="changeValue"
|
|
|
+ ></EditTable>
|
|
|
+ <!--责任员工-->
|
|
|
+ <EditTable slot="right" ref="staffTable" :data="staffList" :show-setting-flag="false"
|
|
|
+ :enabledRepeat="false" enabled-repeat-id="staffId"
|
|
|
+ :height="tableHeight"
|
|
|
+ :columns="staffColumn"
|
|
|
+ @delRow="delGroupStaff"
|
|
|
+ @chooseData="saveDetailChange" @onBatchChoose="saveDetailChange"
|
|
|
+ ></EditTable>
|
|
|
+ </DkSplit>
|
|
|
</DkPanel>
|
|
|
</DkCollapse>
|
|
|
<!-- 下部分按钮区域-->
|
|
|
<DkSaveButton ref="saveButton" :loading="loading" @save="save" @close="close"></DkSaveButton>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { formMixin } from '@/mixins/form'
|
|
|
+
|
|
|
export default {
|
|
|
- name: "finishCheck-add",
|
|
|
+ name: 'finishCheck-add',
|
|
|
mixins: [formMixin],
|
|
|
data() {
|
|
|
let self = this
|
|
|
@@ -78,64 +101,103 @@
|
|
|
tableHeight: 620,
|
|
|
// 画面表单数据
|
|
|
formData: {
|
|
|
- stationId:null,
|
|
|
- stationName:'',
|
|
|
- makeUserName : '',
|
|
|
- pdtBarcode: '',
|
|
|
+ stationId: null,
|
|
|
+ stationName: '',
|
|
|
+ prodUserId: null,
|
|
|
+ prodUserCode: '',
|
|
|
+ barCode: '',
|
|
|
ftyId: this.$store.state.user.ftyId,
|
|
|
- productCode:'',
|
|
|
- productName:'',
|
|
|
- logoName:'',
|
|
|
- colourName:'',
|
|
|
+ productId: null,
|
|
|
+ productCode: '',
|
|
|
+ productName: '',
|
|
|
+ logoName: '',
|
|
|
+ colourName: '',
|
|
|
+ opnGradeId: null,
|
|
|
+ gradeName: null,
|
|
|
+ opnGradeKind: null,
|
|
|
},
|
|
|
- editItemColumns:['itemId','moldingId','productUniqueCode'],
|
|
|
+ flowNodeId: self.$route.meta.menuUuid,
|
|
|
+ workStationList: [],//工位数据
|
|
|
+ editItemColumns: ['itemId', 'moldingId', 'productUniqueCode'],
|
|
|
+ gradeList: [],//产品等级
|
|
|
detailList: [],// 成型记录明细信息
|
|
|
- defectList:[],//缺陷列表
|
|
|
- defectNodeList:[],//责任工序
|
|
|
- dutyUserCodeList:[],//责任工号
|
|
|
- dutyJobList:[],//责任工种
|
|
|
- dutyUserList:[],//责任人
|
|
|
- defectFinetList:[],//缺陷扣罚
|
|
|
- defectFinetNumList:[],//扣除数
|
|
|
+ defectFines: [],//缺陷扣罚
|
|
|
+ defectNodeList: [],//责任工序
|
|
|
+ userList: [],//责任工号
|
|
|
+ jobList: [],//责任工种
|
|
|
+ staffList: [],//责任员工
|
|
|
+ dutyUserList: [],//责任人
|
|
|
+ jobId: null,//责任工种
|
|
|
+ split: 0.7,//明细左右宽度比
|
|
|
// 明细列表
|
|
|
detailColumns: [
|
|
|
- // 缺陷名称
|
|
|
+ // 缺陷编码
|
|
|
+ { field: 'defectCode', type: 'text', width: 'auto', controlId: 'defectCode', },
|
|
|
+ //缺陷名称
|
|
|
+ { field: 'defectName', type: 'disabled', width: 'auto', },
|
|
|
+ //缺陷扣罚
|
|
|
{
|
|
|
- field: 'defectName',
|
|
|
+ field: 'dftFineId',
|
|
|
type: 'select',
|
|
|
- options: () => self.defectList,
|
|
|
- labelKey: 'defectName',
|
|
|
- valueKey: 'defectId',
|
|
|
- width: 'auto'
|
|
|
+ options: () => self.defectFines,
|
|
|
+ labelKey: 'fineName',
|
|
|
+ valueKey: 'fineId',
|
|
|
+ width: 'auto',
|
|
|
},
|
|
|
+ // 扣除数
|
|
|
+ { field: 'deductNum', type: 'disabled', width: 'auto' },
|
|
|
// 缺陷位置
|
|
|
- { field: 'moldlineName', type: 'disabled', width: 'auto' },
|
|
|
- // 特殊缺陷
|
|
|
- { field: 'manageUserName', type: 'disabled', width: 'auto' },
|
|
|
+ { field: 'pdtPlaceId', type: 'disabled', width: 'auto' },
|
|
|
+
|
|
|
// 责任工序
|
|
|
- { field: 'appResponsibleProcess', type: 'disabled', width: 'auto' },
|
|
|
+ {
|
|
|
+ field: 'blameNodeId',
|
|
|
+ type: 'select',
|
|
|
+ options: () => self.defectNodeList,
|
|
|
+ labelKey: 'nodeName',
|
|
|
+ valueKey: 'nodeId',
|
|
|
+ width: 'auto'
|
|
|
+ },
|
|
|
// 责任工号
|
|
|
{
|
|
|
- field: 'moldingUser',
|
|
|
- title:self.$t('appResponsibleJobNumber'),
|
|
|
+ field: 'blameUserId',
|
|
|
type: 'select',
|
|
|
- options: () => self.userAddList,
|
|
|
+ options: () => self.userList,
|
|
|
labelKey: 'userName',
|
|
|
valueKey: 'userId',
|
|
|
width: 'auto'
|
|
|
},
|
|
|
- { field: 'modelCode', title: self.$t('appProductCodeB'), type: 'disabled', width: 'auto' },
|
|
|
// 责任工种
|
|
|
- { field: 'modelName', title: self.$t('appProductName'), type: 'disabled', width: 'auto' },
|
|
|
- // 责任人
|
|
|
- { field: 'moldlineItemCode', title: self.$t('moldingModelCode'), type: 'disabled', width: 'auto' },
|
|
|
- // 缺陷扣罚
|
|
|
- { field: 'moldlineItemKindName', title: self.$t('mouldKindName'), type: 'disabled', width: 'auto' },
|
|
|
- // 扣除数
|
|
|
- { field: 'productUniqueCode', title: self.$t('pdtUniqueCode'), type: 'text', width: 'auto' },
|
|
|
- // 特殊
|
|
|
- { field: 'moldingBatch', type: 'disabled', width: 'auto' },
|
|
|
+ {
|
|
|
+ field: 'blameWsJobId',
|
|
|
+ type: 'select',
|
|
|
+ options: () => self.jobList,
|
|
|
+ labelKey: 'jobName',
|
|
|
+ valueKey: 'jobId',
|
|
|
+ width: 'auto'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ //责任员工
|
|
|
+ staffColumn: [
|
|
|
+ // 责任员工
|
|
|
+ {
|
|
|
+ field: 'staffName',
|
|
|
+ controlId: 'staffId',
|
|
|
+ title: self.$t('blameStaffId'),
|
|
|
+ width: 255,
|
|
|
+ sortBoolean: false,
|
|
|
+ type: 'tableSelect',
|
|
|
+ param: () => {
|
|
|
+ return {
|
|
|
+ jobId: self.jobId ? parseInt(self.jobId) : null,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dataType: self.$config.tableSelectType.staff,
|
|
|
+ fieldUpdate: self.$updateColumns.halfCheckStaff,
|
|
|
+ searchDetailFlag: false
|
|
|
+ },
|
|
|
],
|
|
|
+ rowIndex: 0,
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -147,43 +209,238 @@
|
|
|
productSelect() {
|
|
|
this.$refs['formInline'].validate().then(valid => {
|
|
|
if (valid) {
|
|
|
-
|
|
|
+ //产品条码查询
|
|
|
+ this.onBarCode()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 行改变时间
|
|
|
- * @date : 2023/2/28 11:22
|
|
|
+ * @desc : 选择工位
|
|
|
+ * @date : 2023/2/28 9:24
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
- currentChange(e) {
|
|
|
- console.log('e', e)
|
|
|
+ chooseStation(row) {
|
|
|
+ if (row && row[0]) {
|
|
|
+ this.formData.stationId = row[0].stationId
|
|
|
+ this.formData.stationName = row[0].stationName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 生产工号失焦事件
|
|
|
+ * @date : 2023/2/28 9:28
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ onProdUserCode() {
|
|
|
+ let params = {
|
|
|
+ ftyId: this.formData.ftyId,
|
|
|
+ prodUserCode: this.formData.prodUserCode,
|
|
|
+ stationId: this.formData.stationId,
|
|
|
+ flowNodeId: this.flowNodeId,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.collectService, this.$service.collectService.checkProdUserCode, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.formData.prodUserId = parseInt(res.data)
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 产品条码失焦事件
|
|
|
+ * @date : 2023/2/28 9:28
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ onBarCode() {
|
|
|
+ let params = {
|
|
|
+ ftyId: this.formData.ftyId,
|
|
|
+ barCode: this.formData.barCode,
|
|
|
+ prodUserCode: this.formData.prodUserCode,
|
|
|
+ flowNodeId: this.flowNodeId,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.collectService, this.$service.collectService.checkBarCode, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.formData.productId = res.data.uniqueId
|
|
|
+ this.formData.productCode = res.data.modelCode
|
|
|
+ this.formData.productName = res.data.modelName
|
|
|
+ this.formData.logoName = res.data.logoName
|
|
|
+ this.formData.colourName = res.data.colourName
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询产品等级
|
|
|
+ * @date : 2023/3/3 10:09
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ getGrade() {
|
|
|
+ let params = {
|
|
|
+ ftyId: this.formData.ftyId,
|
|
|
+ nodeId: this.flowNodeId,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.commonService, this.$service.commonService.getProductGrade, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.gradeList = res.data
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 选择产品等级
|
|
|
+ * @date : 2023/3/3 9:17
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ chooseGrade(row) {
|
|
|
+ if (row) {
|
|
|
+ this.formData.opnGradeId = row
|
|
|
+ let list = this.gradeList.filter(it => it.gradeId == row)
|
|
|
+ if (list.length > 0) {
|
|
|
+ this.formData.opnGradeKind = list[0].gradeKind
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 选择改变
|
|
|
+ * @date : 2023/3/3 16:30
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ chooseData(row, rowIndex, colItem) {
|
|
|
+ this.rowIndex = rowIndex
|
|
|
+ //缺陷扣罚
|
|
|
+ if (colItem.field == 'dftFineId') {
|
|
|
+ let list = this.defectFines.filter(it => it.fineId == row.dftFineId)
|
|
|
+ if (list.length > 0) {
|
|
|
+ row.deductNum = list[0].deductNum
|
|
|
+ this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
|
|
|
+ deductNum: list[0].deductNum,
|
|
|
+ dftFineId: list[0].fineId,
|
|
|
+ dftFineId_Name: list[0].fineName
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ flowNodeId: this.flowNodeId,
|
|
|
+ ftyId: this.formData.ftyId,
|
|
|
+ pdtDefectId: this.detailList[rowIndex].pdtDefectId,
|
|
|
+ barCode: this.formData.barCode,
|
|
|
+ barCodeId: this.formData.productId,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.collectService, this.$service.collectService.getBlameNode, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.defectNodeList = res.data
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //责任工序
|
|
|
+ else if (colItem.field == 'blameNodeId') {
|
|
|
+ let list = this.defectNodeList.filter(it => it.nodeId == row.blameNodeId)
|
|
|
+ if (list.length > 0) {
|
|
|
+ this.userList = list[0].userList
|
|
|
+ this.jobList = list[0].jobList
|
|
|
+ //责任工序
|
|
|
+ this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
|
|
|
+ blameNodeId: list[0].nodeId,
|
|
|
+ blameNodeId_Name: list[0].nodeName,
|
|
|
+ //责任工号
|
|
|
+ blameUserId: null,
|
|
|
+ blameUserId_Name: null,
|
|
|
+ //责任工种
|
|
|
+ blameWsJobId: null,
|
|
|
+ blameWsJobId_Name: null,
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //责任工号
|
|
|
+ else if (colItem.field == 'blameUserId') {
|
|
|
+ let list = this.userList.filter(it => it.userId == row.blameUserId)
|
|
|
+ if (list.length > 0) {
|
|
|
+ //责任工号
|
|
|
+ this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
|
|
|
+ blameUserId: list[0].userId,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //责任工种
|
|
|
+ else if (colItem.field == 'blameWsJobId') {
|
|
|
+ let list = this.jobList.filter(it => it.jobId == row.blameWsJobId)
|
|
|
+ if (list.length > 0) {
|
|
|
+ this.jobId = row.blameWsJobId
|
|
|
+ this.detailList[rowIndex] = Object.assign(this.detailList[rowIndex], {
|
|
|
+ //责任工种
|
|
|
+ blameWsJobId: list[0].jobId,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$refs.recordTable.$refs.xTable.reloadData(this.$refs.recordTable.tableData)
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 值改变
|
|
|
* @date : 2023/2/28 11:23
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
- changeValue(field, row, rowIndex, val) {
|
|
|
- console.log('field, row, rowIndex, val', field, row, rowIndex, val)
|
|
|
+ changeValue(field, row, rowIndex) {
|
|
|
+ this.rowIndex = rowIndex
|
|
|
+ if (!this.detailList[rowIndex]) {
|
|
|
+ this.detailList.splice(rowIndex, 0, {})
|
|
|
+ }
|
|
|
+ //缺陷编码
|
|
|
+ if (field === 'defectCode') {
|
|
|
+ let params = {
|
|
|
+ flowNodeId: this.flowNodeId,
|
|
|
+ ftyId: this.formData.ftyId,
|
|
|
+ defectCode: row[field],
|
|
|
+ }
|
|
|
+ this.excute(this.$service.collectService, this.$service.collectService.checkNodeDefectCode, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.$set(this.detailList[rowIndex], 'defectCode', row[field])
|
|
|
+ //扣罚id
|
|
|
+ this.$set(this.detailList[rowIndex], 'pdtDefectId', res.data.defectId)
|
|
|
+ this.$set(this.detailList[rowIndex], 'defectName', res.data.defectName)
|
|
|
+ this.defectFines = res.data.defectFines
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 删除责任员工
|
|
|
+ * @date : 2023/3/7 14:23
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ delGroupStaff(row, rowIndex) {
|
|
|
+ this.staffList.splice(rowIndex, 1)
|
|
|
+ this.detailList[this.$refs.detailList.currentRowIndex].staffList = this.staffList
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 通过id查询
|
|
|
- * @date : 2023/2/28 11:25
|
|
|
+ * @desc : 保存责任员工的改动
|
|
|
+ * @date : 2023/3/7 14:25
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
- detail(id) {
|
|
|
- return this.excuteNoParam(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.selectByMoldingId, [parseInt(id)])
|
|
|
+ saveDetailChange(field, row, rowIndex) {
|
|
|
+ this.currentChange({
|
|
|
+ rowIndex: this.$refs.recordTable.currentRowIndex,
|
|
|
+ oldRowIndex: this.$refs.recordTable.currentRowIndex
|
|
|
+ })
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 页面赋值
|
|
|
- * @date : 2023/2/28 11:26
|
|
|
+ * @desc : 行改变时间
|
|
|
+ * @date : 2023/2/28 11:22
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
- setValuesByEdit(data) {
|
|
|
- if (data && data.length > 0) {
|
|
|
- this.detailList = data
|
|
|
+ currentChange(e) {
|
|
|
+ if (!this.detailList[e.rowIndex]) {
|
|
|
+ this.detailList[e.rowIndex] = {}
|
|
|
+ }
|
|
|
+ if (Object.keys(e).length == 2 && this.detailList[e.oldRowIndex]) {
|
|
|
+ this.detailList[e.oldRowIndex].prodDefectStaffList = this.$refs.staffTable.tableData
|
|
|
+
|
|
|
}
|
|
|
+ this.staffList = this.detailList[e.rowIndex].prodDefectStaffList || []
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -192,9 +449,32 @@
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
setParams() {
|
|
|
- let table = this.$refs.moldingRecord.getTableChangeData()
|
|
|
- table = table.minus(this.tableDataSocial,this.editItemColumns); // 过滤掉已经编辑的数据
|
|
|
- this.params = table;
|
|
|
+ for (let it = 0; it < this.detailList.length; it++) {
|
|
|
+ // this.detailList[it].pdtPlaceId = 1
|
|
|
+ for (let i of this.detailList[it].prodDefectStaffList) {
|
|
|
+ i.blameWsJobId = this.detailList[it].blameWsJobId
|
|
|
+ // "pdtViewImageId": 7,
|
|
|
+ // "dftCoordinate": {},
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.params = this.formData
|
|
|
+ this.params.flowNodeId = this.flowNodeId
|
|
|
+ this.params.productionDefectList = this.detailList
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 校验重复数据
|
|
|
+ * @date : 2023/3/8 8:45
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ checkData() {
|
|
|
+ let noList = []
|
|
|
+ //校验图片列表中图片名称重复
|
|
|
+ noList = noList.concat(this.detailList.copy().filter(f => f.pdtDefectId).map(m => m.pdtDefectId))
|
|
|
+ if (noList.length != noList.unique().length) {
|
|
|
+ this.$Message.error(this.$t('W_111'))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -202,10 +482,52 @@
|
|
|
* @date : 2023/2/28 11:28
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
- saveData() {
|
|
|
- this.excute(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.update, this.params)
|
|
|
+ save() {
|
|
|
+ //判断是否存在明细 并且 产品等级为瑕、劣
|
|
|
+ if (this.detailList.length == 0 && (this.formData.opnGradeKind == '产品等级-瑕' || this.formData.opnGradeKind == '产品等级-劣')) {
|
|
|
+ this.$message.error(this.$t('W_112'))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ //校验名称是否重复
|
|
|
+ if (!this.checkData()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //参数赋值
|
|
|
+ this.setParams()
|
|
|
+ this.loading = true
|
|
|
+ this.excute(this.$service.collectService, '/', this.params).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.clear()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 清空
|
|
|
+ * @date : 2023/3/8 10:48
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ clear() {
|
|
|
+ this.detailList = []
|
|
|
+ this.formData.stationId = null
|
|
|
+ this.formData.stationName = ''
|
|
|
+ this.formData.prodUserId = null
|
|
|
+ this.formData.prodUserCode = ''
|
|
|
+ this.formData.barCode = ''
|
|
|
+ this.formData.productId = null
|
|
|
+ this.formData.productCode = ''
|
|
|
+ this.formData.productName = ''
|
|
|
+ this.formData.logoName = ''
|
|
|
+ this.formData.colourName = ''
|
|
|
+ this.formData.opnGradeId = null
|
|
|
+ this.formData.gradeName = null
|
|
|
+ this.formData.opnGradeKind = null
|
|
|
},
|
|
|
},
|
|
|
+ created() {
|
|
|
+ //查询产品等级
|
|
|
+ this.getGrade()
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|