| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- <!-- @desc:工序撤销 @auth:寇珊珊 @time:2023年3月21日15:21:08 -->
- <template>
- <div class="main-div" ref="mainDiv">
- <!--加载中-->
- <loading :loading="loading" v-if="!modalVisible"></loading>
- <DkPaxeButton :total="editKeys?editKeys.length:0"
- :current="editIndex"
- v-if="editKeys && editKeys.length > 1"
- @pageChange="editPageChange"></DkPaxeButton>
- <DkCollapse ref="collapse" @on-change="changeCollapse">
- <DkPanel prop="essentialInformation">
- <!--添加行按钮-->
- <DkButton slot="content" type="success" @click="addRow" size="small" :disabled="addRowFlag"
- style="float: left;position: absolute; top: 9px;left: 120px;">{{ $v('saveDetail') }}
- </DkButton>
- <div style="clear:both"></div>
- <!-- 下拉区域 -->
- <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
- <!--产品条码-->
- <DkFormItem prop="barCode">
- <InputPop ref="barCode" v-model="formData.barCode" @on-enter="onBarCode"
- @on-blur="onBarCode"/>
- </DkFormItem>
- <!--产品型号-->
- <DkFormItem prop="modelCode" :label="$t('moldingModelCode')" >
- <InputPop ref="modelCode" v-model="formData.modelCode" :readonly="true"/>
- </DkFormItem>
- <!--注浆日期-->
- <DkFormItem prop="moldingDate">
- <InputPop ref="moldingDate" v-model="formData.moldingDate" :readonly="true"/>
- </DkFormItem>
- <!--完成工序-->
- <DkFormItem prop="pdtFlowNodeName" :label="$t('reasonPdtFlowNodeName')">
- <InputPop ref="pdtFlowNodeName" v-model="formData.pdtFlowNodeName" :readonly="true"/>
- </DkFormItem>
- <!--完成时间-->
- <DkFormItem prop="finishTime">
- <InputPop ref="finishTime" v-model="formData.finishTime" :readonly="true"/>
- </DkFormItem>
- <!--所在载具-->
- <DkFormItem prop="carrierCode" :label="$t('reasonCarrierCode')">
- <InputPop ref="carrierCode" v-model="formData.carrierCode" :readonly="true"/>
- </DkFormItem>
- <!--商标-->
- <DkFormItem prop="logoName">
- <InputPop ref="logoName" v-model="formData.logoName" :readonly="true"/>
- </DkFormItem>
- <!--釉色-->
- <DkFormItem prop="colourName">
- <InputPop ref="colourName" v-model="formData.colourName" :readonly="true"/>
- </DkFormItem>
- <!--编码-->
- <DkFormItem prop="productCode">
- <InputPop ref="productCode" v-model="formData.productCode" :readonly="true"/>
- </DkFormItem>
- <!--名称-->
- <DkFormItem prop="productName">
- <InputPop ref="productName" v-model="formData.productName" :readonly="true"/>
- </DkFormItem>
- </DkForm>
- </DkPanel>
- <!--撤销信息-->
- <DkPanel prop="reverseMessage">
- <!-- 下拉区域 -->
- <DkForm slot="content" ref="formInline" v-model="LossReportingFormData" style="width: 95%">
- <!--撤销原因-->
- <DkFormItem :required="true" prop="undoReason">
- <InputPop ref="undoReason" v-model="LossReportingFormData.undoReason"/>
- </DkFormItem>
- </DkForm>
- </DkPanel>
- <!--明细-->
- <DkPanel prop="details">
- <div slot="content" :style="'height: ' + (tableHeight - 10) + 'px'">
- <!--撤销信息-->
- <EditTable slot="left" ref="submitTable" :data="detailList"
- :columns="detailColumns"
- :height="tableHeight-10"
- :freeze="false"
- :add-flag="false"
- @delRow="delSubmitTable"
- ></EditTable>
- </div>
- </DkPanel>
- </DkCollapse>
- <!-- 下部分按钮区域-->
- <DkSaveButton ref="saveButton" :loading="loading" @save="save" @close="close"></DkSaveButton>
- </div>
- </template>
- <script>
- import { formMixin } from '@/mixins/form'
- export default {
- name: 'process-node-reverse-add',
- mixins: [formMixin],
- data() {
- let self = this
- return {
- tableData: [],
- loading: false,
- tableHeight: 620,
- barCodeList: [],//产品条码集合
- // 画面表单数据
- formData: {
- barCode: '',
- ftyId: this.$store.state.user.ftyId,
- productId: null,
- productCode: null,
- productName: null,
- logoName: null,//商标
- colourName: null,//釉色
- moldingDate: null,//成型日期
- modelCode: null,//产品型号
- finishTime: null,//完成时间
- pdtFlowNodeName: null,//完成工序
- carrierCode: null,//所在载具
- },
- LossReportingFormData:{
- undoReason: null,//撤销原因
- },
- // 明细列表
- detailColumns: [
- // 产品条码
- { field: 'barCode', type: 'disabled', width: 'auto' },
- //产品型号
- { field: 'modelCode', type: 'disabled', title: self.$t('moldingModelCode'), width: 'auto' },
- // 成型日期
- { field: 'moldingDate', type: 'disabled', width: 'auto' },
- //完成时间
- { field: 'finishTime', type: 'disabled', width: 'auto' },
- //完成工序
- { field: 'pdtFlowNodeName', title: self.$t('reasonPdtFlowNodeName'), type: 'disabled', width: 'auto' },
- //所在载具
- { field: 'carrierCode', title: self.$t('reasonCarrierCode'), type: 'disabled', width: 'auto' },
- //商标
- { field: 'logoName', type: 'disabled', width: 'auto' },
- //釉色
- { field: 'colourName', type: 'disabled', width: 'auto' },
- //产品编码
- { field: 'productCode', type: 'disabled', width: 'auto' },
- //产品名称
- { field: 'productName', type: 'disabled', width: 'auto' },
- ],
- detailList: [],
- addRowFlag:true,//保存至明细可用标识
- }
- },
- methods: {
- /**
- * @desc : 产品条码失焦事件
- * @date : 2023/2/28 9:28
- * @author : 寇珊珊
- */
- onBarCode() {
- if (this.formData.barCode) {
- this.addRowFlag =false
- let param ={
- barCode:this.formData.barCode
- }
- this.excute(this.$service.collectService, this.$service.collectService.checkBarCodeNodeUndo,param).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
- this.formData.moldingDate = res.data.moldingDate
- this.formData.modelCode = res.data.moldlineItemCode
- this.formData.finishTime = res.data.finishTime
- this.formData.pdtFlowNodeName = res.data.pdtFlowNodeName
- this.formData.carrierCode = res.data.carrierCode
- } else {
- this.formData.barCode= null
- this.$Message.warning(res.message)
- }
- })
- }
- },
- /**
- * @desc : 删除提交行数据
- * @date : 2023/3/10 11:26
- * @author : 寇珊珊
- */
- delSubmitTable(row, rowIndex) {
- this.detailList.splice(rowIndex, 1)
- },
- /**
- * @desc : 添加行
- * @date : 2023/3/10 8:54
- * @author : 寇珊珊
- */
- addRow() {
- if(this.formData.barCode){
- this.addRowFlag=true
- //校验名称是否重复
- if (!this.validDataRow()) {
- return
- }
- this.barCodeList.push(this.formData.barCode)
- let list = []
- list.splice(0, 0, {})
- list[0].barCode = this.formData.barCode
- list[0].productId = this.formData.productId
- list[0].productCode = this.formData.productCode
- list[0].productName = this.formData.productName
- list[0].logoName = this.formData.logoName
- list[0].colourName = this.formData.colourName
- list[0].moldingDate = this.formData.moldingDate
- list[0].modelCode = this.formData.modelCode
- list[0].finishTime = this.formData.finishTime
- list[0].pdtFlowNodeName = this.formData.pdtFlowNodeName
- list[0].carrierCode = this.formData.carrierCode
- this.detailList.push(list[0])
- //清空表单
- this.clear(true)
- }
- },
- /**
- * @desc : 校验重复数据
- * @date : 2023/3/8 8:45
- * @author : 寇珊珊
- */
- validDataRow() {
- if (this.detailList.length > 0) {
- if (this.detailList.filter(it => it.barCode == this.formData.barCode).length > 0) {
- this.$Message.warning(this.$t('W_120'))
- return false
- }
- }
- return true
- },
- /**
- * @desc : 设置传参
- * @date : 2023/2/28 11:29
- * @author : 寇珊珊
- */
- setParams() {
- //明细长度为0产品条码有点击保存按钮直接将产品条码数据存入明细
- if (this.detailList.length == 0 && this.formData.barCode) {
- this.addRow()
- }
- if (!this.validData()) {
- return
- }
- this.params = {
- barCodeList: this.barCodeList,
- undoReason: this.LossReportingFormData.undoReason,
- }
- },
- /**
- * @desc : 保存校验
- * @date : 2023/4/6 10:33
- * @author : 寇珊珊
- */
- validData(){
- if(this.detailList.length > 0 &&this.formData.barCode){
- this.$Message.warning(this.$t('W_132'))
- return false
- }
- if (this.barCodeList.length <= 0) {
- this.$Message.warning(this.$t('W_115'))
- return false
- }
- return true
- },
- /**
- * @desc : 保存数据
- * @date : 2023/3/16 13:28
- * @author : 寇珊珊
- */
- saveData() {
- return this.excute(this.$service.collectService, this.$service.collectService.nodeUndo, this.params)
- },
- /**
- * @desc : 清空
- * @date : 2023/3/8 10:48
- * @author : 寇珊珊
- */
- clear(value) {
- if (!value) {
- this.detailList = []
- this.barCodeList = []
- this.LossReportingFormData.undoReason = null
- }
- this.formData.barCode = null
- this.formData.productId = null
- this.formData.productCode = null
- this.formData.productName = null
- this.formData.logoName = null
- this.formData.colourName = null
- this.formData.moldingDate = null
- this.formData.modelCode = null
- this.formData.finishTime = null
- this.formData.pdtFlowNodeName = null
- this.formData.carrierCode = null
- },
- },
- created() {
- this.typeData = this.$config.formMode.add;
- this.resizeTableFlag = true;
- },
- }
- </script>
- <style scoped>
- </style>
|