Преглед изворни кода

Merge remote-tracking branch 'origin/master'

wangyingjie пре 2 година
родитељ
комит
99884aa930

+ 4 - 1
src/api/pages/pdm/molding-record.js

@@ -22,7 +22,10 @@ export default {
     //根据成型线id查询
     selectByMoldineId:'select_by_moldline_id',
     //查询可替换绑定条码的产品
-    selectProductByBindBarcode: 'select_product_by_bind_barcode'
+    selectProductByBindBarcode: 'select_product_by_bind_barcode',
+    //查询可添加绑定条码的产品
+    selectProductCanBindBarcode: 'select_product_can_bind_barcode'
+
   }
 }
 

+ 124 - 21
src/components/base/edit-tree-table/edit-tree-table.vue

@@ -689,6 +689,10 @@
         type: Boolean,
         default: false,
       },
+      // 查询条件(传入)
+      searchInfo: {
+        type: Object
+      },
     },
     data() {
       const vm = window.vm
@@ -741,13 +745,19 @@
           currentPage: 1
         },
         // 查询条件
-        searchCond: {},
+        searchCond: {
+          _value: {}
+        },
         searchContent: [],
         // 外部传入的查询条件
         otherCondition: {
           type: Object,
           default: null
         },
+        //绑定条码添加标识
+        bindBarCodeAddFlag:false,
+        //绑定条码替换标识
+        bindBarCodeReplaceFlag:false,
       }
     },
     watch: {
@@ -3630,6 +3640,7 @@
           // 绑定条码 不管有值没值都是可以查询数据的
           //查询可替换商品
           this.getDataTable(row)
+          this.bindBarCodeReplaceFlag=true
         }
         // 说明已经有值,直接替换,不用查询数据库 只包括父级
         else  if (this.exchangeField && row[this.exchangeField] && (!row['parentId'] || !row['bomSkuId'])) {
@@ -3664,19 +3675,34 @@
             row = this.focusedRow
           }
           param[this.exchangeField] = row[this.exchangeField]
-          if (this.bindBarCodeFlag && row['moldlineId']) {
-            param.pdtGlueKind = row['pdtGlueKind']
-            //todo 查出所有数据 zdl 2023年4月25日09:01:27
-            // param.moldlineId = row['moldlineId']
-            //todo 暂时注掉 2023年4月25日08:46:09  zdl
-            // param.moldlineItemNoList =  this.children.map(it=>it.moldlineItemNo).unique()
-          }
+          if (this.bindBarCodeFlag ) {
+            //添加子集
+            if(row.hasChild==1){
+              //成型线Id
+              param.moldlineId = row.bomItems[0]['moldlineId']
+              //产品id集合
+              param.modelIdList = row.bomItems.map(it=>it.mouldId).unique()
+              this.bindBarCodeAddFlag=true
+            }
+            //替换子集
+            else{
+              param.pdtGlueKind = row['pdtGlueKind']
+              //todo 查出所有数据 zdl 2023年4月25日09:01:27
+              // param.moldlineId = row['moldlineId']
+              //todo 暂时注掉 2023年4月25日08:46:09  zdl
+              // param.moldlineItemNoList =  this.children.map(it=>it.moldlineItemNo).unique()
+              //赋值查询类型
+              this.columns[0].dataType= this.$config.tableSelectType.product
+            }
+            //设置弹窗字段
+            this.setLoadChildInit()
+           }
           // 拼接外部传入的其他参数otherCondition
           if (this.otherCondition) {
             param = Object.assign(param, this.otherCondition)
           }
           if (this.searchCond) {
-            param = Object.assign(param, this.searchCond._value)
+              param = Object.assign(param, this.searchCond._value)
           }
           this.excute(this.service, this.service[this.methodsNameExchange], param).then(res => {
             if (res.code === this.$config.SUCCESS_CODE) {
@@ -3688,7 +3714,7 @@
                 arr = [...res.data]
               }
               this.exchangeData = arr
-              //过滤掉当前数据  不是绑定条码需要
+              //过滤掉当前数据  不是绑定条码需要(这里保留的是原来的逻辑)
               if(!this.bindBarCodeFlag){
                 this.exchangeData = this.exchangeData.filter(it => it[this.controlId] !== row[this.controlId])
               }
@@ -3713,8 +3739,7 @@
           return true
         }
         return false
-      }
-      ,
+      },
       /**
        * @desc   : 选择数据之后
        * @author : 周兴
@@ -3728,14 +3753,22 @@
         }
         let row = this.$refs['table-exchange'].batchRows[0]
         //如果是绑定条码
-        if(this.bindBarCodeFlag){
+        if (this.bindBarCodeFlag) {
           //判断页面中是否已有选择数据
           //没有重复数据
-          if (this.children.filter(it => it.pdtModelId == row.pdtModelId && it.moldlineId ==row.moldingBatch
-            && it.moldingDate ==row.moldingDate &&
+          if (this.children.filter(it => it.pdtModelId == row.pdtModelId && it.moldingBatch == row.moldingBatch
+            && it.moldingDate == row.moldingDate &&
             it.moldlineId == row.moldlineId && it.moldlineItemNo == row.moldlineItemNo).length == 0) {
-            //替换明细
-            this.checkDetailByBindBarCode(row)
+            //添加绑定条码
+            if (this.bindBarCodeAddFlag) {
+              this.addDetailByBindBarCode(row)
+              this.bindBarCodeAddFlag = false
+            }
+            //替换绑定条码
+            else {
+              this.checkDetailByBindBarCode(row)
+              this.bindBarCodeReplaceFlag = false
+            }
             this.showModal = false
           }
           //有重复数据
@@ -3743,7 +3776,7 @@
             this.$Message.error(this.$t('W_141'))
             return
           }
-        }else{
+        } else {
           // 判断替品是否有标价
           if (!row.priceStandard && row.priceStandard != 0) {
             this.$Message.error(this.$t('W_069', { 'param': this.$t('priceStandard') }))
@@ -3798,7 +3831,14 @@
           }
         }
         this.$emit('check-detail-by-bind-bar-code',this.focusedRow,row)
-
+      },
+      /**
+       *   @desc   : 添加明细--当前绑定条码用
+       *   @date   : 2023/4/27 14:37
+       *   @author : 寇珊珊
+       */
+      addDetailByBindBarCode(row){
+        this.$emit('add-detail-by-bind-bar-code',row)
       },
       /**
        * @desc   : 计算父级数据
@@ -3962,7 +4002,7 @@
               // {field: 'skuSpecs', type: 'disabled', minWidth: '40', title: this.$t('skuSpecs')},
             )
           }
-          //绑定条码- 产品
+          //绑定条码- 替换产品
           else if(col.treeNode && col.dataType === this.$config.tableSelectType.product){
             //设置后台接口服务
             this.methodsName = 'selectProductByBindBarcode'
@@ -3973,7 +4013,7 @@
               {itemCode: 'moldingBatch'},
               //成型日期
               {itemCode: 'moldingDate',
-                valueFormat: {code: 'moldingDate', default: [new Date().toDateStr(), new Date().toDateStr()]},
+                valueFormat: {code: 'moldingDate'},
                 valueKind: 'DATE_RANGE',},
               //分组名称
               {itemCode: 'groupName'},
@@ -4025,6 +4065,69 @@
               { field: 'moldlineItemKindName', title: this.$t('mouldKindName'), type: 'disabled', width: 'auto' },
             )
           }
+          //绑定条码- 添加产品
+          else if(col.treeNode && col.dataType === this.$config.tableSelectType.addProduct){
+            //设置后台接口服务
+            this.methodsName = 'selectProductCanBindBarcode'
+            this.methodsNameExchange = 'selectProductCanBindBarcode'
+            this.service = this.$service.moldingRecordItemService
+            this.searchContent = [
+              //成型批次
+              {itemCode: 'moldingBatch'},
+              //成型日期
+              {itemCode: 'moldingDate',
+                valueFormat: {code: 'moldingDate'},
+                valueKind: 'DATE_RANGE',},
+              //分组名称
+              {itemCode: 'groupName'},
+              //成型线编码
+              {itemCode: 'uniqueCode',
+                itemName:'moldlineCode'
+              },
+            ]
+            //替换的列
+            this.columnsUpdate.push(
+              { field: 'moldlineItemNo',title: this.$t('bondingNo') }, // 粘接序号
+              { field: 'moldlineItemCode',title: this.$t('repPdtModelName') },//可变更产品名称
+              { field: 'repPdtModelName'},//可变更产品名称
+              { field: 'uniqueCode',title: this.$t('moldlineCode')},//成型线编码
+              { field: 'moldlineName' },//成型线名称
+              { field: 'manageUserName' },//成型班长
+              { field: 'moldingUserName' },//成型工号
+              { field: 'modelCode',title: this.$t('productCode') },//产品编码
+              { field: 'modelName',title: this.$t('productName') },//产品名称
+              { field: 'mouldCode',title: this.$t('moldingModelCode') },//模具编号
+              { field: 'moldlineItemKindName',title: this.$t('mouldKindName') },//模具状态
+              { field: 'moldingBatch' },//成型批次
+              { field: 'flgMolding' },//成型标识
+              { field: 'unmoldedReasonName' },//未成型原因
+              { field: 'logoName' },//产品商标
+              { field: 'colourName' },//釉色
+              { field: 'flgScrap' },//损坯标识
+              { field: 'scrapReasonName' },//损坯原因
+            )
+            //弹窗的列
+            this.columnsDetail.push(
+              // 成型批次
+              { field: 'moldingBatch', type: 'disabled', width: 'auto' },
+              // 成型日期
+              { field: 'moldingDate', type: 'disabled', width: 'auto' },
+              // 分组序号
+              { field: 'groupNo', title: this.$t('groupNo'), treeNode: true, type: 'disabled', width: 'auto' },
+              // 分组名称
+              { field: 'groupName', title: this.$t('groupName'), type: 'disabled', width: 'auto' },
+              // 成型线编码
+              { field: 'uniqueCode', title: this.$t('moldlineCode'), type: 'disabled', width: 'auto' },
+              // 成型线名称
+              { field: 'moldlineName', type: 'disabled', width: 'auto' },
+              // 产品编码
+              { field: 'modelCode', title: this.$t('productCode'), type: 'disabled', width: 'auto' },
+              // 产品名称
+              { field: 'modelName', title: this.$t('productName'), type: 'disabled', width: 'auto' },
+              // 模具状态
+              { field: 'moldlineItemKindName', title: this.$t('mouldKindName'), type: 'disabled', width: 'auto' },
+            )
+          }
         })
       },
       /**

+ 2 - 2
src/components/business/print/template.vue

@@ -1542,7 +1542,7 @@ export default {
           let scanCodeInfo = {
             active: false,
             width: 80,
-            height: 64,
+            height: 80,
             path: '',
             name: '$scanCode',
             top: e.offsetY - 32 <= 0 ? 0 : e.offsetY - 32,
@@ -1554,7 +1554,7 @@ export default {
           let barCodeInfo = {
             active: false,
             width: 80,
-            height: 64,
+            height: 20,
             path: '',
             name: '$barCode',
             top: e.offsetY - 32 <= 0 ? 0 : e.offsetY - 32,

+ 1 - 1
src/config/index.js

@@ -191,7 +191,6 @@ export default {
     { value: 'date', name: '日期' },
     { value: 'dateTime', name: '时间' },
     { value: 'switch', name: '开关' },
-    { value: 'link', name: '链接' },
   ],
 
   noAccessPage: ['echarts'],
@@ -971,6 +970,7 @@ export default {
     defect: 'defect',
     processNode: 'processNode',
     blameUser: 'blameUser',
+    addProduct: 'addProduct',
   },
   /**
    * @desc   : 选择类型

+ 4 - 0
src/locale/lang/zh-CN.js

@@ -1082,6 +1082,9 @@ export const messages = {
   W_140: '当前数据暂无成型线粘贴方式,无法进行绑定条码',
   W_139: '请选择新型号',
   W_141: '页面中已存在该条数据,请重新选择',
+  W_142: '请选择父级进行添加',
+  W_143: '当前可添加数据已达上限,请重新选择',
+  W_144: '当前保存数据中有未添加的明细,请添加后重新操作',
   E_001: '系统出现异常,请联系管理员。',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
   Q_002: '确定要进行{param}操作吗?',
@@ -1273,6 +1276,7 @@ export const others = {
   flgTreeStrict:'严格模式',
   settingSelectType:'设置下拉参数',
   chooseFty:'选择工厂',
+  flgLink:'链接',
 }
 
 /**

+ 0 - 1
src/mixins/form.js

@@ -207,7 +207,6 @@ export const formMixin = {
      *   @desc   : 滚动后模拟点击事件,模拟关闭poptip
      */
     scroll(e) {
-      console.log('eee2', e)
       e?.target.click()
       // 解决下拉菜单pop不消失的问题
       if (this.$refs['saveButton']) {

+ 192 - 76
src/view/mst/custom-report/form.vue

@@ -165,14 +165,25 @@
     <DkModal
       :loading="loading"
       v-model="settingNumberModal"
-      ref="modal_sql"
+      ref="modal_number"
       @on-visible-change="handleVisibleNumberModal"
       @modalOk="settingNumberOk"
-      :title="$t('settingNumberType')"
+      :title="$t('settingType')"
     >
       <DkForm ref="formInline" v-model="formDataNumber" :col-count="2">
+        <!--列宽-->
+        <DkFormItem prop="width">
+          <InputNumberPop v-model="formDataNumber.width" :digits="0" :min="0" :max="300"/>
+        </DkFormItem>
+        <!--对齐方式-->
+        <DkFormItem prop="align">
+          <SelectPop v-model="formDataNumber.align" :multiple="false" :options="alignList" ref="align"
+                     labelKey="name"
+                     valueKey="value">
+          </SelectPop>
+        </DkFormItem>
         <!--小数位数-->
-        <DkFormItem prop="digits" :required="true" :data-type="$config.dataType.number" :span="24">
+        <DkFormItem prop="digits">
           <InputNumberPop v-model="formDataNumber.digits" :digits="0" :min="0" :max="6"/>
         </DkFormItem>
         <!--是否千分位-->
@@ -183,6 +194,18 @@
         <DkFormItem prop="flgSum">
           <DkSwitch v-model="formDataNumber.flgSum"/>
         </DkFormItem>
+        <!--是否显示-->
+        <DkFormItem prop="flgVisible">
+          <DkSwitch v-model="formDataNumber.flgVisible"/>
+        </DkFormItem>
+        <!--是否是链接-->
+        <DkFormItem prop="flgLink">
+          <DkSwitch v-model="formDataNumber.flgLink"/>
+        </DkFormItem>
+        <!--跳转的页签-->
+        <DkFormItem prop="changeTabName" :required="formDataNumber.flgLink" v-if="formDataNumber.flgLink">
+          <InputPop v-model="formDataNumber.changeTabName"/>
+        </DkFormItem>
       </DkForm>
     </DkModal>
 
@@ -235,6 +258,7 @@ export default {
       errorModal: false,
       settingNumberModal: false,
       settingSelectModal: false,
+      settingLinkModal: false,
       errorMsg: null,  // 错误提示信息
       formData: {
         flgPage: false,// 是否分页
@@ -253,6 +277,11 @@ export default {
         digits: 0,   // 小数位数
         flgThousandth: false,  // 千分位
         flgSum: false,  // 合计
+        align: self.$config.align.left, // 对齐方式,默认居左
+        width: 120,// 列宽
+        flgLink: false, // 是否是链接
+        changeTabName: null, // 跳转页签
+        flgVisible: true, // 是否显示
       },
       formDataSelect: {
         flgTree: false,  // 是否是树形
@@ -366,7 +395,7 @@ export default {
         // 名称
         {field: 'name', type: 'text', width: '150px', upperFlag: false},
         // 是否显示
-        {field: 'flgVisible', type: 'switch', width: '80px', default: true},
+        // {field: 'flgVisible', type: 'switch', width: '80px', default: true},
         // 数据类型
         {
           field: 'dataType',
@@ -377,20 +406,20 @@ export default {
           value: self.$config.dataType.str,
           width: '90px'
         },
-        // 列宽
-        {field: 'width', type: 'number', width: '90px', value: '150'},
-        // 对齐方式
-        {
-          field: 'align',
-          type: 'select',
-          options: () => self.alignList,
-          labelKey: 'name',
-          valueKey: 'value',
-          value: self.$config.align.left,
-          width: '90px'
-        },
-        // 小数位数
-        {field: 'settingType', type: 'button', width: '100px'},
+        // // 列宽
+        // {field: 'width', type: 'number', width: '90px', value: '150'},
+        // // 对齐方式
+        // {
+        //   field: 'align',
+        //   type: 'select',
+        //   options: () => self.alignList,
+        //   labelKey: 'name',
+        //   valueKey: 'value',
+        //   value: self.$config.align.left,
+        //   width: '90px'
+        // },
+        // 设置格式
+        {field: 'settingType', type: 'button', width: '120px'},
         // // 小数位数
         // {field: 'digits', type: 'number', width: '100px', max: 6},
         // // 是否千分位显示
@@ -411,12 +440,29 @@ export default {
      * @date   : 2023/4/26 14:20
      */
     handleVisibleNumberModal(e) {
-      if(!e){
+      if (!e) {
         this.formDataNumber = {
           index: 0,    // 记录是有那行点击过来的
           digits: 0,   // 小数位数
           flgThousandth: false,  // 千分位
           flgSum: false,  // 合计
+          flgVisible: true,// 显示
+          flgLink: false,// 链接
+          changeTabName: null,// 跳转页签
+          width: 120,
+          align: this.$config.align.left,
+        }
+      }
+    },
+    /**
+     * @desc   : 链接设置界面关闭后清理form表单
+     * @author : 周兴
+     * @date   : 2023/4/28 9:48
+     */
+    handleVisibleLinkModal(e) {
+      if (!e) {
+        this.formDataLink = {
+          changeTabName: null
         }
       }
     },
@@ -426,7 +472,7 @@ export default {
      * @date   : 2023/4/26 14:20
      */
     handleVisibleSelectModal(e) {
-      if(!e){
+      if (!e) {
         this.formDataSelect = {
           flgTree: false,  // 是否是树形
           flgTreeStrict: false,  // 是否是严格模式
@@ -579,17 +625,18 @@ export default {
      * @date   : 2023/3/27 16:34
      */
     setTableSettingRowReadOnly(row) {
-      if (row['dataType'] !== this.$config.dataType.number) {
-        this.$set(row, 'readOnly', ['digits', 'flgThousandth'])
-        // 清空数据
-        this.$set(row, 'digits', null)
-        this.$set(row, 'flgThousandth', false)
-      } else {
-        // 小数位数默认为0,千分位默认开启
-        this.$set(row, 'digits', 0)
-        this.$set(row, 'flgThousandth', true)
-        this.$set(row, 'readOnly', null)
-      }
+      // if (row['dataType'] !== this.$config.dataType.number) {
+      //   this.$set(row, 'readOnly', ['digits', 'flgThousandth'])
+      //   // 清空数据
+      //   this.$set(row, 'digits', null)
+      //   this.$set(row, 'flgThousandth', false)
+      // } else {
+      //   // 小数位数默认为0,千分位默认开启
+      //   this.$set(row, 'digits', 0)
+      //   this.$set(row, 'flgThousandth', true)
+      //   this.$set(row, 'readOnly', null)
+      // }
+      this.$set(row, 'settingType', this.$v('searchSet'))
     },
     /**
      * @desc   : 点击按钮
@@ -690,24 +737,56 @@ export default {
       let index = this.formDataNumber.index;
       if (table && table[index]) {
         let row = table[index]
-        let keys = Object.keys(this.formDataNumber)
+        // let keys = Object.keys(this.formDataNumber)
+        // let info = []
+        // keys.forEach(it => {
+        //   if (it != 'index') {
+        //     let item = this.$t(it) + ':' + this.formDataNumber[it];
+        //     info.push(item)
+        //   }
+        // })
+        // // 用于显示
+        // this.$set(row, 'settingNumberType', info.join(','))
+        // 用于记录实体,便于来回编辑使用
+        this.$set(row, 'settingType_info', {...this.formDataNumber})
+        // 用于后台保存
+        this.$set(row, 'digits', this.formDataNumber.digits)
+        this.$set(row, 'flgThousandth', this.formDataNumber.flgThousandth)
+        this.$set(row, 'flgSum', this.formDataNumber.flgSum)
+        this.$set(row, 'width', this.formDataNumber.width)
+        this.$set(row, 'align', this.formDataNumber.align)
+        this.$set(row, 'flgVisible', this.formDataNumber.flgVisible)
+        this.$set(row, 'flgLink', this.formDataNumber.flgLink)
+        this.$set(row, 'changeTabName', this.formDataNumber.changeTabName)
+      }
+      this.settingNumberModal = false;
+    },
+    /**
+     * @desc   : 设置链接格式
+     * @author : 周兴
+     * @date   : 2023/4/28 10:13
+     */
+    settingLinkOk() {
+      let table = this.$refs['tableSetting'].tableData;
+      let index = this.formDataLink.index;
+      if (table && table[index]) {
+        let row = table[index]
+        let keys = Object.keys(this.formDataLink)
         let info = []
         keys.forEach(it => {
           if (it != 'index') {
-            let item = this.$t(it) + ':' + this.formDataNumber[it];
+            let item = this.$t(it) + ':' + this.formDataLink[it];
             info.push(item)
           }
         })
         // 用于显示
-        this.$set(row, 'settingNumberType', info.join(','))
+        this.$set(row, 'settingLinkType', info.join(','))
         // 用于记录实体,便于来回编辑使用
-        this.$set(row, 'settingNumberType_info', {...this.formDataNumber})
+        this.$set(row, 'settingLinkType_info', {...this.formDataLink})
         // 用于后台保存
-        this.$set(row, 'digits', this.formDataNumber.digits)
-        this.$set(row, 'flgThousandth', this.formDataNumber.flgThousandth)
-        this.$set(row, 'flgSum', this.formDataNumber.flgSum)
+        this.$set(row, 'changeTabName', this.formDataLink.changeTabName)
       }
-      this.settingNumberModal = false;
+      this.settingLinkModal = false;
     },
     /**
      * @desc   : 设置数值格式
@@ -715,15 +794,21 @@ export default {
      * @date   : 2023/3/31 9:01
      */
     handleSettingNumber(row, rowIndex) {
-      // 查看是否是数值类型
-      if (row.dataType && row.dataType === this.$config.dataType.number) {
-        // 如果已经存在 说明已经保存了
-        if (row['settingNumberType_info']) {
-          this.formDataNumber = {...row['settingNumberType_info']}
-        }
-        this.formDataNumber.index = rowIndex;
-        this.settingNumberModal = true;
+      // 查看是否是数值类型 (不控制了)
+      // if (row.dataType && row.dataType === this.$config.dataType.number) {
+      //   // 如果已经存在 说明已经保存了
+      //   if (row['settingNumberType_info']) {
+      //     this.formDataNumber = {...row['settingNumberType_info']}
+      //   }
+      //   this.formDataNumber.index = rowIndex;
+      //   this.settingNumberModal = true;
+      // }
+      // 如果已经存在 说明已经保存了
+      if (row['settingType_info']) {
+        this.formDataNumber = {...row['settingType_info']}
       }
+      this.formDataNumber.index = rowIndex;
+      this.settingNumberModal = true;
     },
     /**
      * @desc   : 增加父级列
@@ -833,9 +918,10 @@ export default {
           item = item.replaceAll('\'', '').replaceAll('"', '')
           // 默认为文本格式,居左
           fieldList.push({
-            flgVisible: true,
+            // flgVisible: true,
             code: item, dataType: this.$config.dataType.str,
-            align: this.$config.align.left, width: 150, readOnly: ['digits', 'flgThousandth']
+            align: this.$config.align.left, width: 150, readOnly: ['digits', 'flgThousandth'],
+            settingType: this.$v('searchSet')
           })
         })
       }
@@ -1008,21 +1094,37 @@ export default {
         }
         if (it.tableSettingList) {
           it.tableSettingList.forEach(item => {
-            if (item.dataType === this.$config.dataType.number) {
-              // 显示数值类型格式(小数位数+千分位+合计
-              let text = this.$t('digits') + ':' + item.digits + ',' +
-                this.$t('flgThousandth') + ':' + item.flgThousandth + ',' +
-                this.$t('flgSum') + ':' + item.flgSum;
-              let formDataNumber = {
-                digits: item.digits,
-                flgThousandth: item.flgThousandth,
-                flgSum: item.flgSum
-              }
-              // 用于显示
-              this.$set(item, 'settingNumberType', text)
-              // 用于数据处理
-              this.$set(item, 'settingNumberType_info', formDataNumber)
+            // if (item.dataType === this.$config.dataType.number) {
+            // 显示数值类型格式(小数位数+千分位+合计
+            // let text = this.$t('digits') + ':' + item.digits + ',' +
+            //   this.$t('flgThousandth') + ':' + item.flgThousandth + ',' +
+            //   this.$t('width') + ':' + item.width + ',' +
+            //   this.$t('align') + ':' + item.align + ',' +
+            //   this.$t('flgLink') + ':' + item.flgLink + ',' +
+            //   this.$t('changeTabName') + ':' + item.changeTabName ;
+            let formDataNumber = {
+              digits: item.digits,
+              flgThousandth: item.flgThousandth,
+              flgSum: item.flgSum,
+              flgLink: item.flgLink,
+              width: item.width,
+              align: item.align,
+              changeTabName: item.changeTabName,
+              flgVisible: item.flgVisible
             }
+            // 用于显示
+            this.$set(item, 'settingType', this.$v('searchSet'))
+            // 用于数据处理
+            this.$set(item, 'settingType_info', formDataNumber)
+            // } else if (item.dataType === 'link') {  // 链接
+            //   let text = this.$t('changeTabName') + ':' + item.changeTabName;
+            //   // 用于显示
+            //   this.$set(item, 'settingLinkType', text)
+            //   // 用于数据处理
+            //   this.$set(item, 'settingNumberType_info', {
+            //     changeTabName: item.changeTabName
+            //   })
+            // }
           })
         }
       })
@@ -1075,8 +1177,8 @@ export default {
               let sqlScript = it.sqlScript.toLowerCase();
               if (sqlScript.indexOf('update') >= 0 || sqlScript.indexOf('insert') >= 0 ||
                 sqlScript.indexOf('delete') >= 0 || sqlScript.indexOf('create') >= 0 ||
-                sqlScript.indexOf('alter') >= 0 || sqlScript.indexOf('GRANT') >= 0 ||
-                sqlScript.indexOf('REVOKE') >= 0) {
+                sqlScript.indexOf('alter') >= 0 || sqlScript.indexOf('grant') >= 0 ||
+                sqlScript.indexOf('revoke') >= 0) {
                 this.$Message.error(this.$t('sqlErr'))
                 return false;
               }
@@ -1180,19 +1282,33 @@ export default {
           sqlScript = sqlScript.replaceAll('#{' + t.code?.trim() + '}', null)
         }
       })
-      let filters = this.sqlTabsOptions.filter(it => it.changeTabName == sqlItem.name)
-      if (filters && filters.length > 0) {
-        let changeScript = filters[0].changeScript.trim();
-        // 说明是多个
-        if (changeScript && changeScript.indexOf(',') >= 0) {
-          let changeScripts = changeScript.split(',');
-          changeScripts.forEach(it => {
-            sqlScript = sqlScript.replaceAll('#{' + it + '}', null)
+      // 不用控制严格,只要有跳转条件,其他页签的都处理下的(兼容link模式)
+      this.sqlTabsOptions.forEach((t, index) => {
+        if (t.changeScript) {
+          let changeScripts = t.changeScript.trim().split(',');
+          this.sqlTabsOptions.forEach((item, itemNo) => {
+            if(index != itemNo){
+              sqlScript = item.sqlScript
+              changeScripts.forEach(it => {
+                sqlScript = sqlScript.replaceAll('#{' + it + '}', null)
+              })
+            }
           })
-        } else {
-          sqlScript = sqlScript.replaceAll('#{' + changeScript + '}', null)
         }
-      }
+      })
+      // let filters = this.sqlTabsOptions.filter(it => it.changeTabName == sqlItem.name)
+      // if (filters && filters.length > 0) {
+      //   let changeScript = filters[0].changeScript.trim();
+      //   // 说明是多个
+      //   if (changeScript && changeScript.indexOf(',') >= 0) {
+      //     let changeScripts = changeScript.split(',');
+      //     changeScripts.forEach(it => {
+      //       sqlScript = sqlScript.replaceAll('#{' + it + '}', null)
+      //     })
+      //   } else {
+      //     sqlScript = sqlScript.replaceAll('#{' + changeScript + '}', null)
+      //   }
+      // }
       return sqlScript;
     },
     /**

+ 27 - 4
src/view/mst/custom-report/report.vue

@@ -53,6 +53,7 @@
           :digits="item.digits"
           :sum="item.sum"
           :dataType="item.dataType"
+          @on-link="handleLink"
         >
         </DkTableColumn>
         <!--        :width="index === tabsOptions[tabIndex].tableColumns.length - 1?'auto': item.width"-->
@@ -79,6 +80,7 @@ export default {
       tabsOptions: [], // tab数据源
       changeFlag: false,// 是否是跳转
       searchParams: {},// 查询条件
+      linkChangeTabs:[],// 点击链接跳转到相应的页签
     }
   },
   methods: {
@@ -103,11 +105,16 @@ export default {
      * @author : 周兴
      * @date   : 2023/4/19 18:01
      */
-    async chooseData(row, rowIndex) {
+    async chooseData(row, rowIndex,changeTabName) {
+      console.log('eee',row,rowIndex,changeTabName)
+      if(!changeTabName){
+        changeTabName = this.tabsOptions[this.tabIndex].changeTabName
+      }
       if (this.tabsOptions[this.tabIndex] && this.tabsOptions[this.tabIndex].changeScript
-        && this.tabsOptions[this.tabIndex].changeTabName && !row.subTotal) {
+        // && this.tabsOptions[this.tabIndex].changeTabName && !row.subTotal) {
+        && changeTabName && !row.subTotal) {
         let changeScript = this.tabsOptions[this.tabIndex].changeScript
-        let changeTabName = this.tabsOptions[this.tabIndex].changeTabName
+        // let changeTabName = this.tabsOptions[this.tabIndex].changeTabName
         let tabIndex = await this.tabsOptions.findIndex(it => it.name == changeTabName);
         // 先记录之前列表的分页信息
         this.tabsOptions[this.tabIndex].pageInfo = {...this.pageInfo}
@@ -251,6 +258,14 @@ export default {
       return params;
     },
     /**
+     * @desc   : 处理链接
+     * @author : 周兴
+     * @date   : 2023/4/28 16:00
+     */
+    handleLink(e){
+      this.chooseData(e);
+    },
+    /**
      * @desc   : 设置小计行
      * @author : 周兴
      * @date   : 2023/4/23 9:06
@@ -510,11 +525,19 @@ export default {
             item.field = it.code
             item.title = it.name
             item.sum = it.flgSum
-            if (it.dataType === 'switch' || it.dataType === 'link') {
+            if (it.dataType === 'switch') {
               item.type = it.dataType;
             } else {
               item.type = 'text';
             }
+            // 是否是链接
+            if(it.flgLink){
+              item.type = 'link'
+              this.linkChangeTabs.push({
+                field:it.code,
+                tabName:it.changeTabName
+              })
+            }
             item.dataType = it.dataType ? it.dataType : this.$config.dataType.str
             if (it.flgSum) {
               this.form['showFooter_' + index] = it.flgSum

+ 1 - 1
src/view/pdm/molding-record/bind-barcode-group.vue

@@ -421,7 +421,7 @@
               uniqueCode: bomItems[0].productId ? null : it.productUniqueCode,
               remarks: it.productRemarks,
               flgPdtGlue: true,
-              modelId:bomItems[0].bomItems[0].repPdtModelId,
+              modelId:bomItems[0].repPdtModelId,
             })
           }
         }

+ 78 - 4
src/view/pdm/molding-record/bind-barcode-grouping.vue

@@ -7,7 +7,6 @@
                   :current="editIndex"
                   v-if="editKeys && editKeys.length > 1"
                   @pageChange="editPageChange"></DkPageButton>
-
     <DkCollapse ref="collapse" @on-change="changeCollapse">
       <DkPanel prop="essentialInformation">
         <!--  下拉区域  -->
@@ -34,6 +33,10 @@
 
       <DkPanel prop="moldingRecordRelation">
         <div slot="content" :style="'height: ' + tableHeight + 'px'">
+          <!--添加行按钮-->
+          <DkButton slot="content" type="success" @click="openAddDetailModal" size="small" :disabled="addRowFlag"
+                    style="float: left;position: absolute; top: 95px;left: 140px;">{{ $v('saveDetail') }}
+          </DkButton>
           <!--型记录信息-->
           <EditTreeTable ref="moldingRecord" :data="moldingRecordList" showFooter
                          major-field="id"
@@ -45,7 +48,9 @@
                          exchangeField="pdtModelId"
                          controlId="pdtModelId"
                          :bindBarCodeFlag="true"
+                         @current-change="getDetailAdd"
                          @check-detail-by-bind-bar-code="checkDetail"
+                         @add-detail-by-bind-bar-code="addDetail"
           ></EditTreeTable>
         </div>
       </DkPanel>
@@ -143,7 +148,8 @@
             }
           }
         },
-
+        addRowFlag: true,//保存至明细可用标识
+        row: {},//记录当前选择行数据
       }
     },
     methods: {
@@ -328,6 +334,63 @@
         this.$refs.moldingRecord.reloadData(this.moldingRecordList)
       },
       /**
+       *   @desc   : 获取添加子集
+       *   @date   : 2023/4/27 10:11
+       *   @author : 寇珊珊
+       */
+      getDetailAdd(e) {
+        //只存父级
+        if (e && e.row && e.row.hasChild == 1) {
+          this.row = e.row
+          this.addRowFlag = false
+        } else {
+          this.addRowFlag = true
+        }
+      },
+      /**
+       *   @desc   : 添加子集
+       *   @date   : 2023/4/27 10:03
+       *   @author : 寇珊珊
+       */
+      openAddDetailModal() {
+        //父级成型线下产品个数不存在,或者父级下成型线下产品个数和父级明细个数不相等
+        if (this.row) {
+          if (!this.row.modelCount || (this.row.modelCount && this.row.modelCount != this.row.bomItems.length)) {
+            //赋值查询类型
+            this.moldingRecordTreeColumns[0].dataType = this.$config.tableSelectType.addProduct
+            //设置组件弹窗字段
+            this.$refs.moldingRecord.setLoadChildInit()
+            this.$refs.moldingRecord.focusedRow = this.row
+            //加载数据
+            this.$refs.moldingRecord.getDataTable(this.row)
+          } else {
+            this.$Message.error(this.$t('W_143'))
+          }
+        } else {
+          this.$Message.error(this.$t('W_142'))
+        }
+      },
+      /**
+       *   @desc   : 将选择后的数据添加至明细
+       *   @date   : 2023/4/27 14:41
+       *   @author : 寇珊珊
+       */
+      addDetail(row) {
+        this.addRowFlag = false
+        for (let it of this.moldingRecordList) {
+          if (this.row.id == it.id) {
+            row.parentId = it.id
+            row.moldingItemId = row.itemId
+            this.$set(row, 'readOnly', ['productUniqueCode'])
+            it.bomItems.push(row)
+          }
+          it.modelCount = row.modelCount
+        }
+        // 处理子级数据
+        this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
+        this.$refs.moldingRecord.reloadData(this.moldingRecordList)
+      },
+      /**
        *   @desc   : 通过id查询
        *   @date   : 2023/2/28 11:25
        *   @author : 寇珊珊
@@ -421,7 +484,7 @@
               uniqueCode: bomItems[0].productId ? null : it.productUniqueCode,
               remarks: it.productRemarks,
               flgPdtGlue: true,
-              modelId:bomItems[0].bomItems[0].repPdtModelId,
+              modelId: bomItems[0].repPdtModelId,
             })
           }
         }
@@ -462,11 +525,22 @@
           this.$Message.error(this.$t('W_110'))
           return false
         }
+        //todo  判断每组数据是否达到可保存数量
+        //如果本次都不需要绑定条码
+        if(this.productUniqueCodeCount != this.moldingRecordList.length){
+          //过滤掉总单中本次不需要进行绑定条码的数据
+          for(let i of  this.moldingRecordList.filter(it=>!it.readOnlyUniqueCode)){
+            if(!i.modelCount ||i.modelCount && i.modelCount!= i.bomItems.length){
+              this.$Message.error(this.$t('W_144'))
+              return false
+            }
+          }
+        }
         return true
       },
     },
     created() {
-      this.resizeTableFlag = true;  // 计算表格高度
+      this.resizeTableFlag = true  // 计算表格高度
     },
     activated() {
       this.detail(this.$route.params.id)