Bladeren bron

绑定条码

koushanshan 3 jaren geleden
bovenliggende
commit
5339f96837

+ 3 - 0
src/api/pages/common/common.js

@@ -149,6 +149,9 @@ export default {
     getLabelPrintItem: 'get_label_print_item',
     //获取员工用于报工记录查询
     getStaffWithWork: 'get_staff_with_work',
+    //查询可替换绑定条码的产品
+    // selectProductByBindBarcode: 'select_product_by_bind_barcode',
+    selectByMoldineId:'select_by_moldline_id',
   },
   appCommonService: {
     prefix: 'mdm-server/app/mst/common/',

+ 74 - 9
src/components/base/edit-tree-table/edit-tree-table.vue

@@ -144,13 +144,25 @@
                   @click="handleFreeze(colItem.field)"/>
           </template>
           <template #default="{ row,rowIndex,column }">
-          <span class="edit-div-class" @dblclick.stop="copyValue(row,colItem,rowIndex)">{{
-              formatColumn({
-                column: column,
-                cellValue: row[colItem.field],
-                row: row
-              })
-            }}</span>
+<!--          <span class="edit-div-class" @dblclick.stop="copyValue(row,colItem,rowIndex)">{{-->
+<!--
+     formatColumn({-->
+<!--                column: column,-->
+<!--                cellValue: row[colItem.field],-->
+<!--                row: row-->
+<!--              })-->
+<!--            }}</span>-->
+            <div @dblclick.stop="copyValue(row,colItem,rowIndex)"
+                 :class="colItem.treeNode?( row['parentId']?'child-class':'parent-class'):'edit-div-class'">
+              <icon color="#19BE6B"
+                    v-if="colItem.treeNode && checkExchangeIconVisible(row,colItem,rowIndex)"
+                    :class="row['parentId']?'change-icon-class':'change-icon-child-class'"
+                    @click="handleExchangeClick(row,colItem)"
+                    type="iconfont iconfont icon-exchange"></icon>
+              {{
+              row[colItem.field]
+              }}
+            </div>
           </template>
         </vxe-column>
 
@@ -3547,6 +3559,9 @@
           })
           //显示可替换的界面
           this.showModal = true
+          // 绑定条码 不管有值没值都是可以查询数据的
+          //查询可替换商品
+          this.getDataTable(row)
         } else {
           // 查询可替换商品
           this.getDataTable(row)
@@ -3559,8 +3574,9 @@
        * @date   : 2022/5/27 16:04
        */
       getDataTable(row) {
+        console.log(row)
         let param = {}
-        param.cpId = this.$store.state.user.cpId
+        param.ftyId = this.$store.state.user.ftyId
         // 根据传入的数据进行检索
         param[this.exchangeField] = row[this.exchangeField]
         this.service[this.methodsNameExchange](param).then(res => {
@@ -3581,7 +3597,10 @@
        * @author : 周兴
        * @date   : 2022/5/28 7:54
        */
-      checkExchangeIconVisible(row) {
+      checkExchangeIconVisible(row,colItem,rowIndex) {
+        console.log("row",row,colItem,rowIndex)
+        console.log("this.exchangeField",this.exchangeField)
+        console.log('ff',!this.readonly,row[this.exchangeField],this.exchangeField)
         if (!this.readonly && row && row[this.exchangeField] && row[this.exchangeField].length > 0) {
           return true
         }
@@ -3795,6 +3814,52 @@
               // {field: 'skuSpecs', type: 'disabled', minWidth: '40', title: this.$t('skuSpecs')},
             )
           }
+          //绑定条码- 产品
+          else if(col.treeNode && col.dataType === this.$config.tableSelectType.product){
+            //设置后台接口服务
+            this.methodsName = 'selectByMoldineId'
+            this.methodsNameExchange = 'selectByMoldineId'
+            this.service = this.$service.commonService
+            //替换的列
+            this.columnsUpdate.push(
+              { field: 'moldlineItemNo',title: self.$t('groupNo') }, // 分组序号
+              { field: 'moldlineItemCode',title: self.$t('groupName') },//分组名称
+              { field: 'uniqueCode',title: self.$t('moldlineCode')},//成型线编码
+              { field: 'moldlineName' },//成型线名称
+              { field: 'manageUserName' },//成型班长
+              { field: 'moldingUserName' },//成型工号
+              { field: 'modelCode',title: self.$t('productCode') },//产品编码
+              { field: 'modelName',title: self.$t('productName') },//产品名称
+              { field: 'mouldCode',title: self.$t('moldingModelCode') },//模具编号
+              { field: 'moldlineItemKindName',title: self.$t('mouldKindName') },//模具状态
+              { field: 'moldingBatch' },//成型批次
+              { field: 'flgMolding' },//成型标识
+              { field: 'unmoldedReasonName' },//未成型原因
+              { field: 'logoName' },//产品商标
+              { field: 'colourName' },//釉色
+              { field: 'flgScrap' },//损坯标识
+              { field: 'scrapReasonName' },//损坯原因
+            )
+            //弹窗的列
+            this.columnsDetail.push(
+              // 分组序号
+              { field: 'moldlineItemNo', title: self.$t('groupNo'), treeNode: true, type: 'disabled', width: 'auto' },
+              // 分组名称
+              { field: 'moldlineItemCode', title: self.$t('groupName'), type: 'disabled', width: 'auto' },
+              // 成型线编码
+              { field: 'uniqueCode', title: self.$t('moldlineCode'), type: 'disabled', width: 'auto' },
+              // 成型线名称
+              { field: 'moldlineName', type: 'disabled', width: 'auto' },
+              // 产品编码
+              { field: 'modelCode', title: self.$t('productCode'), type: 'disabled', width: 'auto' },
+              // 产品名称
+              { field: 'modelName', title: self.$t('productName'), type: 'disabled', width: 'auto' },
+              // 模具编号
+              { field: 'mouldCode', title: self.$t('moldingModelCode'), type: 'disabled', width: 'auto' },
+              // 模具状态
+              { field: 'moldlineItemKindName', title: self.$t('mouldKindName'), type: 'disabled', width: 'auto' },
+            )
+          }
         })
       },
       /**

+ 2 - 2
src/view/core/factory/index.vue

@@ -61,8 +61,8 @@
           <InputPop v-model="formData.ftyName" ref="ftyName"/>
         </DkFormItem>
         <!--  工厂名称  -->
-        <DkFormItem prop="ftyDocNo" :required="true" :data-type="$config.dataType.number">
-          <InputNumberPop v-model="formData.ftyDocNo" ref="ftyDocNo" :max="10000"/>
+        <DkFormItem prop="ftyDocNo" :required="true" :data-type="$config.dataType.str">
+          <InputPop v-model="formData.ftyDocNo" ref="ftyDocNo" maxlength="4"/>
         </DkFormItem>
         <!--   显示顺序  -->
         <DkFormItem prop="displayNo" :data-type="$config.dataType.number" :required="true">

+ 5 - 2
src/view/pdm/molding-record/bind-barcode-grouping.vue

@@ -38,6 +38,7 @@
                          :add-flag="false"
                          :height="tableHeight"
                          :new-row-flag="false"
+                         exchangeField="modelCode"
                          :columns="moldingRecordTreeColumns"
                          @changeValue="changeValue"
           ></EditTreeTable>
@@ -74,9 +75,11 @@
         //成型记录明细列表
         moldingRecordTreeColumns: [
           // 分组序号
-          { field: 'groupNo', title: self.$t('groupNo'), treeNode: true, type: 'disabled', width: 'auto' },
+          { field: 'moldlineItemNo', title: self.$t('groupNo'),
+            dataType: self.$config.tableSelectType.product,
+            treeNode: true, type: 'disabled', width: 'auto' },
           // 分组名称
-          { field: 'groupName', type: 'disabled', width: 'auto' },
+          { field: 'moldlineItemCode', title: self.$t('groupName'), type: 'disabled', width: 'auto' },
           // 成型线编码
           { field: 'uniqueCode', title: self.$t('moldlineCode'), type: 'disabled', width: 'auto' },
           // 成型线名称