|
|
@@ -10,24 +10,26 @@
|
|
|
<!-- 下拉区域 -->
|
|
|
<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,7 +44,16 @@
|
|
|
</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="gradeId" :required="true" :label="$t('gradeKind')">
|
|
|
+ <SelectPop v-model="formData.gradeName" ref="gradeName" :multiple="false"
|
|
|
+ :options="gradeList"
|
|
|
+ @on-select="chooseGrade"
|
|
|
+ labelKey="gradeName"
|
|
|
+ valueKey="gradeId">
|
|
|
+ </SelectPop>
|
|
|
</DkFormItem>
|
|
|
</DkForm>
|
|
|
</DkPanel>
|
|
|
@@ -53,7 +64,7 @@
|
|
|
:columns="detailColumns"
|
|
|
:height="tableHeight"
|
|
|
:operate-flag="false"
|
|
|
- :new-row-flag="false"
|
|
|
+ :new-row-flag="true"
|
|
|
:freeze="false"
|
|
|
@current-change="currentChange"
|
|
|
@changeValue="changeValue"></EditTable>
|
|
|
@@ -67,146 +78,254 @@
|
|
|
|
|
|
<script>
|
|
|
import { formMixin } from '@/mixins/form'
|
|
|
-export default {
|
|
|
- name: "halfCheck-add",
|
|
|
- mixins: [formMixin],
|
|
|
- data() {
|
|
|
- let self = this
|
|
|
- return {
|
|
|
- tableData: [],
|
|
|
- loading: false,
|
|
|
- tableHeight: 620,
|
|
|
- // 画面表单数据
|
|
|
- formData: {
|
|
|
- stationId:null,
|
|
|
- stationName:'',
|
|
|
- makeUserName : '',
|
|
|
- pdtBarcode: '',
|
|
|
- ftyId: this.$store.state.user.ftyId,
|
|
|
- productCode:'',
|
|
|
- productName:'',
|
|
|
- logoName:'',
|
|
|
- colourName:'',
|
|
|
- },
|
|
|
- editItemColumns:['itemId','moldingId','productUniqueCode'],
|
|
|
- detailList: [],// 成型记录明细信息
|
|
|
- defectList:[],//缺陷列表
|
|
|
- defectNodeList:[],//责任工序
|
|
|
- dutyUserCodeList:[],//责任工号
|
|
|
- dutyJobList:[],//责任工种
|
|
|
- dutyUserList:[],//责任人
|
|
|
- defectFinetList:[],//缺陷扣罚
|
|
|
- defectFinetNumList:[],//扣除数
|
|
|
- // 明细列表
|
|
|
- detailColumns: [
|
|
|
- // 缺陷名称
|
|
|
- {
|
|
|
- field: 'defectName',
|
|
|
- type: 'select',
|
|
|
- options: () => self.defectList,
|
|
|
- labelKey: 'defectName',
|
|
|
- valueKey: 'defectId',
|
|
|
- width: 'auto'
|
|
|
- },
|
|
|
- // 缺陷位置
|
|
|
- { field: 'moldlineName', type: 'disabled', width: 'auto' },
|
|
|
- // 特殊缺陷
|
|
|
- { field: 'manageUserName', type: 'disabled', width: 'auto' },
|
|
|
- // 责任工序
|
|
|
- { field: 'appResponsibleProcess', type: 'disabled', width: 'auto' },
|
|
|
- // 责任工号
|
|
|
- {
|
|
|
- field: 'moldingUser',
|
|
|
- title:self.$t('appResponsibleJobNumber'),
|
|
|
- type: 'select',
|
|
|
- options: () => self.userAddList,
|
|
|
- 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' },
|
|
|
- ],
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /**
|
|
|
- * @desc : 产品查询
|
|
|
- * @date : 2023/2/28 14:49
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- productSelect() {
|
|
|
- this.$refs['formInline'].validate().then(valid => {
|
|
|
- if (valid) {
|
|
|
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 行改变时间
|
|
|
- * @date : 2023/2/28 11:22
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- currentChange(e) {
|
|
|
- console.log('e', e)
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 值改变
|
|
|
- * @date : 2023/2/28 11:23
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- changeValue(field, row, rowIndex, val) {
|
|
|
- console.log('field, row, rowIndex, val', field, row, rowIndex, val)
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 通过id查询
|
|
|
- * @date : 2023/2/28 11:25
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- detail(id) {
|
|
|
- return this.excuteNoParam(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.selectByMoldingId, [parseInt(id)])
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 页面赋值
|
|
|
- * @date : 2023/2/28 11:26
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- setValuesByEdit(data) {
|
|
|
- if (data && data.length > 0) {
|
|
|
- this.detailList = data
|
|
|
+ export default {
|
|
|
+ name: 'halfCheck-add',
|
|
|
+ mixins: [formMixin],
|
|
|
+ data() {
|
|
|
+ let self = this
|
|
|
+ return {
|
|
|
+ tableData: [],
|
|
|
+ loading: false,
|
|
|
+ tableHeight: 620,
|
|
|
+ // 画面表单数据
|
|
|
+ formData: {
|
|
|
+ stationId: null,
|
|
|
+ stationName: '',
|
|
|
+ prodUserId: null,
|
|
|
+ prodUserCode: '',
|
|
|
+ barCode: '',
|
|
|
+ ftyId: this.$store.state.user.ftyId,
|
|
|
+ productCode: '',
|
|
|
+ productName: '',
|
|
|
+ logoName: '',
|
|
|
+ colourName: '',
|
|
|
+ gradeId: null,
|
|
|
+ gradeName: null,
|
|
|
+ gradeKind: null,
|
|
|
+ },
|
|
|
+ flowNodeId: self.$route.meta.menuUuid,
|
|
|
+ workStationList: [],//工位数据
|
|
|
+ editItemColumns: ['itemId', 'moldingId', 'productUniqueCode'],
|
|
|
+ gradeList: [],//产品等级
|
|
|
+ detailList: [],// 成型记录明细信息
|
|
|
+ defectNodeList: [],//责任工序
|
|
|
+ dutyUserCodeList: [],//责任工号
|
|
|
+ dutyJobList: [],//责任工种
|
|
|
+ dutyUserList: [],//责任人
|
|
|
+ defectFinetList: [],//缺陷扣罚
|
|
|
+ defectFinetNumList: [],//扣除数
|
|
|
+ // 明细列表
|
|
|
+ detailColumns: [
|
|
|
+ // 缺陷编码
|
|
|
+ { field: 'defectCode', type: 'text', width: 'auto' , },
|
|
|
+ //缺陷名称
|
|
|
+ { field: 'defectName', type: 'disabled', width: 'auto' , },
|
|
|
+ // 缺陷位置
|
|
|
+ { field: 'moldlineName', type: 'disabled', width: 'auto' },
|
|
|
+ // 特殊缺陷
|
|
|
+ { field: 'manageUserName', type: 'disabled', width: 'auto' },
|
|
|
+ // 责任工序
|
|
|
+ { field: 'appResponsibleProcess', type: 'disabled', width: 'auto' },
|
|
|
+ // 责任工号
|
|
|
+ {
|
|
|
+ field: 'moldingUser',
|
|
|
+ title: self.$t('appResponsibleJobNumber'),
|
|
|
+ type: 'select',
|
|
|
+ options: () => self.userAddList,
|
|
|
+ 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' },
|
|
|
+ ],
|
|
|
}
|
|
|
},
|
|
|
+ methods: {
|
|
|
+ /**
|
|
|
+ * @desc : 产品查询
|
|
|
+ * @date : 2023/2/28 14:49
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ productSelect() {
|
|
|
+ this.$refs['formInline'].validate().then(valid => {
|
|
|
+ if (valid) {
|
|
|
+ //产品条码查询
|
|
|
+ this.onBarCode()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 选择工位
|
|
|
+ * @date : 2023/2/28 9:24
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ 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.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.gradeId = row
|
|
|
+ let list =this.gradeList.filter(it=>it.gradeId== row)
|
|
|
+ if(list.length>0){
|
|
|
+ this.formData.gradeKind=list[0].gradeKind
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 行改变时间
|
|
|
+ * @date : 2023/2/28 11:22
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ currentChange(e) {
|
|
|
+ console.log('e', e)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 值改变
|
|
|
+ * @date : 2023/2/28 11:23
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ changeValue(field, row, rowIndex) {
|
|
|
+ if(!this.detailList[rowIndex]){
|
|
|
+ this.detailList.splice(rowIndex,0,{})
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ ftyId: this.formData.ftyId,
|
|
|
+ defectCode: row[field],
|
|
|
+ }
|
|
|
+ this.excute(this.$service.productDefectService, this.$service.productDefectService.getByCode, params).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.$set(this.detailList[rowIndex],'defectCode',row[field])
|
|
|
+ this.$set(this.detailList[rowIndex],'defectName',res.data.defectName)
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- /**
|
|
|
- * @desc : 设置传参
|
|
|
- * @date : 2023/2/28 11:29
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- setParams() {
|
|
|
- let table = this.$refs.moldingRecord.getTableChangeData()
|
|
|
- table = table.minus(this.tableDataSocial,this.editItemColumns); // 过滤掉已经编辑的数据
|
|
|
- this.params = table;
|
|
|
- },
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 通过id查询
|
|
|
+ * @date : 2023/2/28 11:25
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ detail(id) {
|
|
|
+ return this.excuteNoParam(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.selectByMoldingId, [parseInt(id)])
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 页面赋值
|
|
|
+ * @date : 2023/2/28 11:26
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ setValuesByEdit(data) {
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ this.detailList = data
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- /**
|
|
|
- * @desc : 保存数据
|
|
|
- * @date : 2023/2/28 11:28
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- saveData() {
|
|
|
- this.excute(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.update, this.params)
|
|
|
+ /**
|
|
|
+ * @desc : 设置传参
|
|
|
+ * @date : 2023/2/28 11:29
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ setParams() {
|
|
|
+ let table = this.$refs.moldingRecord.getTableChangeData()
|
|
|
+ table = table.minus(this.tableDataSocial, this.editItemColumns) // 过滤掉已经编辑的数据
|
|
|
+ this.params = table
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 保存数据
|
|
|
+ * @date : 2023/2/28 11:28
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ save() {
|
|
|
+ this.excute(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.update, this.params)
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
-}
|
|
|
+ created() {
|
|
|
+ //查询产品等级
|
|
|
+ this.getGrade();
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|