Просмотр исходного кода

Merge branch 'master' of http://git.dongkesoft.com:9001/DK-MES-3.0/mes-web

周兴 3 лет назад
Родитель
Сommit
8ff075dc25

+ 82 - 74
src/components-app/base/dk-app-table-more/dk-app-table-more.vue

@@ -9,76 +9,74 @@
         style="background: #fff;margin: 10px 10px 10px 10px;border-radius: 7px;  "
         :style="{ boxShadow: (boxShadowFlag ? '2px 2px 5px #e5e5e6' : '') }">
         <!--        有测拉删除的组件 -->
-        <van-swipe-cell :disabled="disabledSwipe">
-          <div style="display: flex;width: 100%; padding: 10px 10px 10px 10px;">
-            <!-- 复选框-->
-            <div style="width: 10%;background: white;justify-items: center;align-items: center;display: flex"
-              v-if="checkboxFlag">
-              <div style="">
-                <van-checkbox v-model="tableDataItem.checked" checked-color="#2E406B"
-                  @click="onClickCheckbox(tableDataItem, tableDataIndex)"></van-checkbox>
 
-              </div>
+        <div style="display: flex;width: 100%; padding: 10px 10px 10px 10px;">
+          <!-- 复选框-->
+          <div style="width: 10%;background: white;justify-items: center;align-items: center;display: flex"
+            v-if="checkboxFlag">
+            <div style="">
+              <van-checkbox v-model="tableDataItem.checked" checked-color="#2E406B"
+                @click="onClickCheckbox(tableDataItem, tableDataIndex)"></van-checkbox>
+
             </div>
-            <!-- 字段参数值-->
-            <div :style="{ width: (checkboxFlag ? '90%' : '100%') }">
-              <div class="app-row " style="display: flow" v-for="(rowsItem, rowsIndex) in rows" :key="rowsIndex">
-                <div style="width: 100%;display: flex"
-                  v-if="!rowsItem.emptyValueFlag || !(tableDataItem[rowsItem.name] == null || tableDataItem[rowsItem.name] == '')">
-                  <div v-if="!rowsItem.collapseFlag && !rowsItem.sidePullFlag && !rowsItem.sidePullDateFlag"
-                    style="width: 100%">
-                    <!-- 输入框-->
-                    <dk-app-field  :focus="true" :label="rowsItem.title" :typeInput="rowsItem.typeInput"
-                      :ref="rowsItem.name + '' + tableDataIndex" :maxlength="rowsItem.maxlength"
-                      :error="rowsItem.required"
-                      @blur="changeValue(tableDataItem, tableDataIndex, tableDataItem[rowsItem.name])"
-                      @changeBarCode="changeItemBarCode(rowsItem.sidePullKey, tableDataItem, tableDataIndex)"
-                      :placeholderFlag="rowsItem.placeholderFlag ? (tableDataItem[rowsItem.fieldKey] ? true : false
-                        ) : false" :removeSpacesFlag="rowsItem.removeSpacesFlag"
-                      :readonly="!rowsItem.fieldFlag || (tableDataItem[rowsItem.fieldKey] && rowsItem.readonlyInputFlag)"
-                      v-model="tableDataItem[rowsItem.name]"></dk-app-field>
-                  </div>
-                  <div v-if="!rowsItem.collapseFlag && rowsItem.fieldCheckBoxFlag" style="padding-top: 10px">
-                    <!-- 复选框-->
-                    <van-checkbox v-model="tableDataItem[rowsItem.name]" checked-color="#2E406B" shape="square"
-                      @click="onClickCheckbox(tableDataItem, tableDataIndex)"></van-checkbox>
-                  </div>
-                  <!-- 侧拉菜单-->
+          </div>
+          <!-- 字段参数值-->
+          <div :style="{ width: (checkboxFlag ? '90%' : '100%') }">
+            <div class="app-row " style="display: flow" v-for="(rowsItem, rowsIndex) in rows" :key="rowsIndex">
+              <div style="width: 100%;display: flex"
+                v-if="!rowsItem.emptyValueFlag || !(tableDataItem[rowsItem.name] == null || tableDataItem[rowsItem.name] == '')">
+                <div v-if="!rowsItem.collapseFlag && !rowsItem.sidePullFlag && !rowsItem.sidePullDateFlag"
+                  style="width: 100%">
+                  <!-- 输入框-->
+                  <dk-app-field :focus="true" :label="rowsItem.title" :typeInput="rowsItem.typeInput"
+                    :ref="rowsItem.name + '' + tableDataIndex" :maxlength="rowsItem.maxlength" :error="rowsItem.required"
+                    @blur="changeValue(tableDataItem, tableDataIndex, tableDataItem[rowsItem.name])"
+                    @changeBarCode="changeItemBarCode(rowsItem.sidePullKey, tableDataItem, tableDataIndex)"
+                    :placeholderFlag="rowsItem.placeholderFlag ? (tableDataItem[rowsItem.fieldKey] ? true : false
+                      ) : false" :removeSpacesFlag="rowsItem.removeSpacesFlag"
+                    :readonly="!rowsItem.fieldFlag || (tableDataItem[rowsItem.fieldKey] && rowsItem.readonlyInputFlag)"
+                    v-model="tableDataItem[rowsItem.name]"></dk-app-field>
+                </div>
+                <div v-if="!rowsItem.collapseFlag && rowsItem.fieldCheckBoxFlag" style="padding-top: 10px">
+                  <!-- 复选框-->
+                  <van-checkbox v-model="tableDataItem[rowsItem.name]" checked-color="#2E406B" shape="square"
+                    @click="onClickCheckbox(tableDataItem, tableDataIndex)"></van-checkbox>
+                </div>
+                <!-- 侧拉菜单-->
 
-                  <div v-if="!rowsItem.collapseFlag && rowsItem.sidePullFlag" style="width: 100%">
+                <div v-if="!rowsItem.collapseFlag && rowsItem.sidePullFlag" style="width: 100%">
 
-                    <dk-app-field v-model="tableDataItem[rowsItem.name]" :label="rowsItem.title" :readonly="true"
-                      @click="openDropdown(rowsItem.sidePullKey, tableDataItem, tableDataIndex)" placeholderType="choose"
-                      :arrow-direction="!tableDataItem['flgBindUnique'] ? 'down' : ''"
-                      :is-link="!tableDataItem[rowsItem.name] && !tableDataItem['flgBindUnique']"
-                      :placeholderFlag="!tableDataItem['flgBindUnique']"
-                      :rightIcon="(tableDataItem[rowsItem.name] && !tableDataItem['flgBindUnique']) ? 'clear' : ''"
-                      @clickRightIcon="clickRightIcon(tableDataItem, tableDataIndex, rowsItem.sidePullKey)"></dk-app-field>
+                  <dk-app-field v-model="tableDataItem[rowsItem.name]" :label="rowsItem.title" :readonly="true"
+                    @click="openDropdown(rowsItem.sidePullKey, tableDataItem, tableDataIndex)" placeholderType="choose"
+                    :arrow-direction="!tableDataItem['flgBindUnique'] ? 'down' : ''"
+                    :is-link="!tableDataItem[rowsItem.name] && !tableDataItem['flgBindUnique']"
+                    :placeholderFlag="!tableDataItem['flgBindUnique']"
+                    :rightIcon="(tableDataItem[rowsItem.name] && !tableDataItem['flgBindUnique']) ? 'clear' : ''"
+                    @clickRightIcon="clickRightIcon(tableDataItem, tableDataIndex, rowsItem.sidePullKey)"></dk-app-field>
 
-                  </div>
-                  <!-- 日期选择-->
-                  <div v-if="!rowsItem.collapseFlag && rowsItem.sidePullDateFlag" style="width: 100%">
-                    <dk-app-field :value="tableDataItem[rowsItem.name]" :label="rowsItem.title" :readonly="true"
-                      @click="showFormingDateClick(rowsItem.sidePullDateKey, tableDataItem, tableDataIndex)"
-                      placeholderType="choose" is-link arrow-direction="down" />
-                  </div>
+                </div>
+                <!-- 日期选择-->
+                <div v-if="!rowsItem.collapseFlag && rowsItem.sidePullDateFlag" style="width: 100%">
+                  <dk-app-field :value="tableDataItem[rowsItem.name]" :label="rowsItem.title" :readonly="true"
+                    @click="showFormingDateClick(rowsItem.sidePullDateKey, tableDataItem, tableDataIndex)"
+                    placeholderType="choose" is-link arrow-direction="down" />
                 </div>
               </div>
             </div>
           </div>
-          <!-- 查看更多-->
-          <div v-if="collapseFlag">
-            <div style="display:flex;">
-              <div v-if="checkboxFlag" style="width: 12%;">
-              </div>
-              <div :style="checkboxFlag ? 'width: 88%;' : 'width: 100%;'">
-                <van-collapse v-model="tableDataItem.collapse" accordion>
-                  <van-collapse-item title="查看明细" name="1">
-                    <div class="app-row " style="display: flow;" v-for="(bomItems, bomIndex) in tableDataItem.bomItems"
-                      :key="bomIndex">
-
-                      <div  v-for="(rowsBomItem, rowsBomIndex) in rowsBom"
-                        :key="rowsBomIndex">
+        </div>
+        <!-- 查看更多-->
+        <div v-if="collapseFlag">
+          <div style="display:flex;">
+            <div v-if="checkboxFlag" style="width: 12%;">
+            </div>
+            <div :style="checkboxFlag ? 'width: 88%;' : 'width: 100%;'">
+              <van-collapse v-model="tableDataItem.collapse" accordion>
+                <van-collapse-item title="查看明细" name="1">
+                  <div class="app-row " style="display: flow;" v-for="(bomItems, bomIndex) in tableDataItem.bomItems"
+                    :key="bomIndex">
+                    <van-swipe-cell :disabled="bomItems.flgBindUnique">
+                      <div v-for="(rowsBomItem, rowsBomIndex) in rowsBom" :key="rowsBomIndex">
                         <div style="width: 100%;display: flex">
                           <!-- 标题字段-->
                           <div style="width: 100%">
@@ -89,21 +87,21 @@
 
                         </div>
                       </div>
+                      <template #right>
+                        <van-button square type="primary" text="替换" @click="replace(bomItems, bomIndex,tableDataIndex)"
+                          class="delete-button" />
+                      </template>
+                    </van-swipe-cell>
 
+                    <div style="padding-bottom: 15px;"></div>
 
-                      <div style="padding-bottom: 15px;"></div>
-
-                    </div>
-                  </van-collapse-item>
-                </van-collapse>
-              </div>
+                  </div>
+                </van-collapse-item>
+              </van-collapse>
             </div>
           </div>
-          <template #right>
-            <van-button square type="danger" text="删除" @click="onDelClick(tableDataItem, tableDataIndex)"
-              class="delete-button" />
-          </template>
-        </van-swipe-cell>
+        </div>
+
       </div>
     </div>
 
@@ -160,6 +158,7 @@ export default {
       type: String,
       default: '70%'
     },
+
     imgFlag: {
       type: Boolean,
       default: true
@@ -288,7 +287,13 @@ export default {
         index: index
       })
     },
-
+    replace(item, index,parentIndex){
+      this.$emit("replace", {
+        item: item,
+        index: index,
+        parentIndex: parentIndex
+      })
+    },
     /**
       * @desc   : 输入框 值改变
       * @author : 于继渤
@@ -447,7 +452,10 @@ export default {
 .delete-button {
   height: 100%;
 }
-
+.replace-button {
+  height: 100%;
+  color:greenyellow;
+}
 .ellipsis {
   overflow-y: auto;
   /*text-overflow: ellipsis;*/

+ 39 - 7
src/components/base/edit-tree-table/edit-tree-table.vue

@@ -519,6 +519,8 @@
             <BaseIndexButton :finalFlag="true" ref="clear" name="clear" @click="clear"></BaseIndexButton>
           </template>
         </BaseIndexButtonGroup>
+        <SearchCond id="search-cond-div" width="850px" v-if="searchContent && searchContent.length > 0" ref="searchCond"
+                    v-model="searchCond" :setFlag="false" :searchContent="searchContent" :col-count="4"></SearchCond>
 
         <DkTable :primaryKey="controlId" ref="table-exchange"
                  :id="'table-'+$options.name" name="table"
@@ -738,6 +740,9 @@
           pageSize: this.$config.pageSize,
           currentPage: 1
         },
+        // 查询条件
+        searchCond: {},
+        searchContent: [],
       }
     },
     watch: {
@@ -781,6 +786,16 @@
     },
     methods: {
       /**
+       * @desc   : 用传入的参数给值赋值
+       * @author : 周兴
+       * @date   : 2023/2/21 10:27
+       */
+      setSearchInfo(searchInfo) {
+        if (searchInfo) {
+          this.objectMerge(this.searchCond._value, searchInfo);
+        }
+      },
+      /**
        * @desc   : 清空事件
        * @author : 周兴
        * @date   : 2022/3/4 8:19
@@ -3645,13 +3660,15 @@
           }
           param[this.exchangeField] = row[this.exchangeField]
           if (this.bindBarCodeFlag && row['moldlineId']) {
-            console.log("row",row)
             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.searchCond) {
+            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) {
               let arr = []
@@ -3750,6 +3767,8 @@
             })
           }
         }
+        // 清空查询条件
+        this.$refs['searchCond'].clearCondition();
       },
       /**
        *   @desc   : 替换明细--当前绑定条码用
@@ -3940,10 +3959,25 @@
             this.methodsName = 'selectProductByBindBarcode'
             this.methodsNameExchange = 'selectProductByBindBarcode'
             this.service = this.$service.moldingRecordItemService
+            this.searchContent = [
+              //成型批次
+              {itemCode: 'moldingBatch'},
+              //成型日期
+              {itemCode: 'moldingDate',
+                valueFormat: {code: 'moldingDate', default: [new Date().toDateStr(), new Date().toDateStr()]},
+                valueKind: 'DATE_RANGE',},
+              //分组名称
+              {itemCode: 'groupName'},
+              //成型线编码
+              {itemCode: 'uniqueCode',
+               itemName:'moldlineCode'
+              },
+            ]
             //替换的列
             this.columnsUpdate.push(
-              { field: 'moldlineItemNo',title: this.$t('groupNo') }, // 分组序号
-              { field: 'moldlineItemCode',title: this.$t('groupName') },//分组名称
+              { field: 'moldlineItemNo',title: this.$t('bondingNo') }, // 粘接序号
+              { field: 'moldlineItemCode',title: this.$t('repPdtModelName') },//可变更产品名称
+              { field: 'repPdtModelName'},//可变更产品名称
               { field: 'uniqueCode',title: this.$t('moldlineCode')},//成型线编码
               { field: 'moldlineName' },//成型线名称
               { field: 'manageUserName' },//成型班长
@@ -3967,9 +4001,9 @@
               // 成型日期
               { field: 'moldingDate', type: 'disabled', width: 'auto' },
               // 分组序号
-              { field: 'moldlineItemNo', title: this.$t('groupNo'), treeNode: true, type: 'disabled', width: 'auto' },
+              { field: 'groupNo', title: this.$t('groupNo'), treeNode: true, type: 'disabled', width: 'auto' },
               // 分组名称
-              { field: 'moldlineItemCode', title: this.$t('groupName'), type: 'disabled', width: 'auto' },
+              { field: 'groupName', title: this.$t('groupName'), type: 'disabled', width: 'auto' },
               // 成型线编码
               { field: 'uniqueCode', title: this.$t('moldlineCode'), type: 'disabled', width: 'auto' },
               // 成型线名称
@@ -3978,8 +4012,6 @@
               { field: 'modelCode', title: this.$t('productCode'), type: 'disabled', width: 'auto' },
               // 产品名称
               { field: 'modelName', title: this.$t('productName'), type: 'disabled', width: 'auto' },
-              // 模具编号
-              { field: 'mouldCode', title: this.$t('moldingModelCode'), type: 'disabled', width: 'auto' },
               // 模具状态
               { field: 'moldlineItemKindName', title: this.$t('mouldKindName'), type: 'disabled', width: 'auto' },
             )

+ 7 - 3
src/locale/lang/zh-CN.js

@@ -756,6 +756,9 @@ export const columns = {
   //产品等级
   flgDefault: '默认等级',
 
+  //绑定条码
+  bondingNo:'粘接序号',
+
   //生产
   prodUserCode: '生产工号',
   opCreateUser: '创建者',
@@ -1617,9 +1620,10 @@ export const appOthers = {
   appProductionKilnWrong:'当前窑炉车号不存在',
   appNotDetailIsLoss:'当前无修改记录,无法保存',
   appRepealMenuUuid:'e6a31228-5893-487b-bcc2-2fae990d8e37',
-  appNoBonding:'无',
-  appIntragroupBonding:'组内粘接',
-  appGroupBonding:'分组粘接'
+  appNoBonding:'分体粘接-无',
+  appIntragroupBonding:'分体粘接-组',
+  appGroupBonding:'分体粘接-位',
+  appProductSelectReplaceTitle:'请选择需要替换的产品'
 }
 
 

+ 48 - 7
src/view-app/app/grouting-management/grouting-bind-barcode/index.vue

@@ -19,7 +19,7 @@
     <div class="main-app-table" ref="scrollTable">
       <!--  列表-->
       <dk-app-table-more :rows="rowsTemp" :rowsBom="rowsBom" :collapseFlag="collapseFlag" :tableRowData="tableRowData"
-        :checkboxFlag="false" @changeValue="changeValue">
+        :checkboxFlag="false" @changeValue="changeValue" @replace="replace">
       </dk-app-table-more>
 
     </div>
@@ -158,10 +158,11 @@ export default {
           if (res.data && res.data.length > 0) {
             let params =
             {
+              ftyId: this.$store.state.user.ftyId,
               moldlineId: res.data[0].uniqueId,
               moldingBatch: this.formData.moldingBatch ? Number(this.formData.moldingBatch) : null, //成型批次
               moldingDate: this.formData.formingDate, //成型日期
-              pdtGlueKindName: res.data[0].pdtGlueKindName //粘接类型
+              pdtGlueKind: res.data[0].pdtGlueKind //粘接类型
             }
             this.getDetailParams = params
             //查询明细数据
@@ -186,7 +187,7 @@ export default {
           if (res.data && res.data.length > 0) {
             this.tableRowData = res.data
             //无分组
-            if (params.pdtGlueKindName.indexOf(this.$t('appNoBonding')) !== -1) {
+            if (params.pdtGlueKind.indexOf(this.$t('appNoBonding')) !== -1) {
               this.rowsTemp = this.rows
               this.collapseFlag = false
               this.pdtGlueKind = 0
@@ -202,7 +203,7 @@ export default {
                 }
               }
             }
-            if (params.pdtGlueKindName.indexOf(this.$t('appIntragroupBonding')) !== -1) {
+            if (params.pdtGlueKind.indexOf(this.$t('appIntragroupBonding')) !== -1) {
               this.rowsTemp = this.rowsGroup
               this.collapseFlag = true
               this.pdtGlueKind = 1
@@ -254,7 +255,7 @@ export default {
                 index++
               }
             }
-            if (params.pdtGlueKindName.indexOf(this.$t('appGroupBonding')) !== -1) {
+            if (params.pdtGlueKind.indexOf(this.$t('appGroupBonding')) !== -1) {
               let index = 0
               this.rowsTemp = this.rowsGrouping
               this.collapseFlag = true
@@ -333,13 +334,47 @@ export default {
     changeValue(e) {
       if (e.value) {
         this.$set(this.tableRowData[e.index], 'productUniqueFlag', true)
+
+        if (this.pdtGlueKind !== 0) {
+          for (let item = 0; item < this.tableRowData[e.index].bomItems.length; item++) {
+            //从后台数据查出来绑定条码已经存在的不需要赋值
+            if (!this.tableRowData[e.index].bomItems[item].readOnlyUniqueCode) {
+              this.$set(this.tableRowData[e.index].bomItems[item], 'productUniqueCode', this.tableRowData[e.index].productUniqueCode)
+              this.$set(this.tableRowData[e.index].bomItems[item], 'productUniqueCodeFlag', true)
+              this.$set(this.tableRowData[e.index].bomItems[item], 'productUniqueFlag', true)
+            }
+          }
+        }
       } else {
         this.$set(this.tableRowData[e.index], 'productUniqueFlag', false)
+        if (this.pdtGlueKind !== 0) {
+          for (let item = 0; item < this.tableRowData[e.index].bomItems.length; item++) {
+            //从后台数据查出来绑定条码已经存在的不需要赋值
+            if (!this.tableRowData[e.index].bomItems[item].readOnlyUniqueCode) {
+              this.$set(this.tableRowData[e.index].bomItems[item], 'productUniqueCode', '')
+              this.$set(this.tableRowData[e.index].bomItems[item], 'productUniqueCodeFlag', false)
+              this.$set(this.tableRowData[e.index].bomItems[item], 'productUniqueFlag', false)
+            }
+          }
+        }
       }
     },
 
 
     /**
+     * @desc   : 替换
+     * @author : 于继渤
+     * @date   : 2023/4/25 12:23
+     */
+    replace(e) {
+      this.$router.push({name: 'app-product-select-replace', params: {
+        item:e.item,
+        parentIndex:e.parentIndex,
+        tableList:this.tableRowData[e.parentIndex]
+      }})
+    },
+
+    /**
    * @desc   : 设置起始编码
    * @author : 于继渤
    * @date   : 2023/3/6 10:08
@@ -711,9 +746,15 @@ export default {
    */
   created(e) {
 
-  }
-
+  },
 
+  activated() {
+    if(localStorage.getItem("app-product-select-replace-data") !== null) {
+      let chooseData =  JSON.parse(localStorage.getItem("app-product-select-replace-data")) ||[]
+      this.tableRowData[chooseData.parentIndex].bomItems = chooseData.children
+      localStorage.removeItem("app-product-select-replace-data")
+    }
+  },
 }
 </script>
 

+ 268 - 0
src/view-app/app/grouting-management/grouting-bind-barcode/product-select-replace.vue

@@ -0,0 +1,268 @@
+<template>
+    <!-- 选择成型线 -->
+    <div class="main-app">
+        <!-- 顶部导航栏 -->
+        <dk-app-nav-bar :title="$t('appProductSelectReplaceTitle')" @click-left="onClickLeft"></dk-app-nav-bar>
+        <!-- 成型线编码 -->
+        <!-- <dk-app-field v-model="formData.moldLineCode" :label="$t('appMoldingCode')" ref="moldLineCode"
+            placeholderType="scan" @changeBarCode="onSearch" /> -->
+        <!--        成型日期-->
+        <!-- <dk-app-field v-model="formData.formingDate" :label="$t('appFormingDate')" :readonly="true" :defaultDateFlag="true"
+            @click="showFormingDateClick" placeholderType="choose" is-link arrow-direction="down" /> -->
+        <!-- 批次 -->
+        <!-- <dk-app-field v-model="formData.moldingBatch" :label="$t('appGroutingBatch')" ref="moldingBatch"
+            @changeBarCode="onSearch" /> -->
+
+        <!--    成型工号-->
+        <!-- <dk-app-field v-model="formData.moldingUser" :label="$t('appMoldingStationNo')" @changeBarCode="onSearch"
+            ref="moldingUser" /> -->
+
+
+        <div class="main-app-table" ref="scrollTable">
+            <!--  列表-->
+            <dk-app-table :rows="rows" :tableRowData="tableRowData" :checkboxFlag="true" :collapseFlag="false"
+                @onClickCheckbox="onClickCheckbox">
+            </dk-app-table>
+
+        </div>
+        <!--    保存-->
+        <div class="app_save_bottom-class" style="padding: 15px 10px 10px 10px">
+            <dk-app-button @click="save">{{
+                $t('appDefine')
+            }}
+            </dk-app-button>
+
+        </div>
+        <!--    单选天日期组件-->
+        <!-- <dk-app-dropdown-single-date-day :show="showFormingDateFlag" @onConfirmChooseDate="onConfirmProduceDate"
+            @onCloseChooseDate="onCloseChooseDate"></dk-app-dropdown-single-date-day>
+        <dk-app-loading :loading="loading"></dk-app-loading> -->
+    </div>
+</template>
+  
+  
+<script>
+import { appFormMixin } from "@/mixins/appform";
+
+export default {
+    name: "app-product-select-replace",
+    mixins: [appFormMixin],
+    data() {
+        return {
+            loading: false,
+            showFormingDateFlag: false,
+            tableRowData: [],
+            chooseData: {},
+            formData: {
+                moldLineCode: '',//成型线编码
+                productUniqueCode: '',//产品编码
+                formingDate: '',
+                moldingBatch: 1,
+                pdtBarcode: '',
+                moldingUser: '',
+            },
+            rows: [
+                { name: 'moldingBatch', title: this.$t('moldingBatch') },
+                { name: 'moldingDate', title: this.$t('moldingDate') },
+                { name: 'moldlineItemNo', title: this.$t('groupNo') },
+                { name: 'moldlineItemCode', title: this.$t('groupName') },
+                { name: 'uniqueCode', title: this.$t('moldlineCode') },
+                { name: 'moldlineName', title: this.$t('moldlineName') },
+                { name: 'modelCode', title: this.$t('productCode') },
+                { name: 'modelName', title: this.$t('productName') },
+                { name: 'mouldCode', title: this.$t('moldingModelCode') },
+                { name: 'moldlineItemKindName', title: this.$t('mouldKind') },
+            ]
+
+        }
+    },
+    methods: {
+        /**
+         *   @desc   : 设置查询参数
+         *   @date   : 2023/02/01
+         *   @author : 于继渤
+         */
+        setSearchParams() {
+            let params = {}
+            params.currentPage = 1
+            params.pageSize = 999
+            // params.pdaFlag = 0
+            params.ftyId = this.$store.state.user.ftyId
+            params.pdtGlueKind = this.formData.pdtGlueKind
+            params.pdtModelId = this.formData.repPdtModelId
+            return params
+        },
+        /**
+         *   @desc   : 获取数据
+         *   @date   :  2023/02/01
+         *   @author : 于继渤
+         */
+        getData() {
+            // 参数设置
+            let params = this.setSearchParams()
+            this.excute(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.selectProductByBindBarcode, params)
+                .then(res => {
+                    if (res.code === this.$config.SUCCESS_CODE) {
+                        if (res.data.list && res.data.list.length > 0) {
+                            res.data.list.forEach(it => {
+                                it.checked = false
+                            })
+                            this.tableRowData = res.data.list
+                        } else {
+                            this.$appDialog.alert({ message: this.$t('W_006') }).then(() => {
+                                this.tableRowData = []
+                            });
+
+                        }
+
+                    }
+                })
+        },
+
+
+        /**
+         * @desc   : 搜索事件
+         * @author : 于继渤
+         * @date   : 2023/2/7 17:23
+         */
+        onSearch(e) {
+            this.tableRowData = []
+
+            //获取数据
+            this.getData()
+        },
+        /**
+         * @desc   : 点击复选框
+         * @author : 于继渤
+         * @date   : 2023/2/7 17:23
+         */
+        onClickCheckbox(e) {
+            this.tableRowData.forEach(item => {
+                item.checked = false
+            })
+            this.tableRowData[e.index].checked = true
+
+        },
+
+        /**
+         * @desc   : 确定
+         * @author : 于继渤
+         * @date   : 2023/3/9 14:01
+         */
+        save() {
+            let obj = {}
+            this.tableRowData.forEach(res => {
+                if (res.checked) {
+                    obj = res
+                }
+            })
+            if (!obj) {
+                this.appToastFail(this.$t('W_017'))
+                return
+            }
+
+           
+            //判断页面中是否已有选择数据
+            //没有重复数据
+            if (this.tableList.bomItems.filter(it => it.pdtModelId == obj.pdtModelId &&
+                it.moldlineId == obj.moldlineId && it.moldlineItemNo == obj.moldlineItemNo).length == 0) {
+                //替换明细
+                this.checkDetailByBindBarCode(obj)
+                // this.showModal = false
+            } else {
+                this.appToastFail(this.$t('W_141'))
+                return
+            }
+
+            //存缓存
+            localStorage.setItem("app-product-select-replace-data", JSON.stringify({
+                children:this.children,
+                parentIndex:this.parentIndex
+            }))
+            this.$router.go(-1)
+        },
+
+
+
+        checkDetailByBindBarCode(row) {
+
+            let children = this.tableList.bomItems
+
+     
+            for (let i in children) {
+                //找到明细中需要替换的数据
+                if (children[i].id == this.formData.id) {
+                    row.parentId = children[i].parentId
+                    row.hasChild = children[i].hasChild
+                    row.id = children[i].id
+                    row.readOnlyUniqueCode = children[i].readOnlyUniqueCode
+                    children[i] = row
+                    children.moldingItemId = children[i].itemId
+                    break
+                }
+            }
+            this.children = children
+
+        },
+
+        /**
+         * @desc   : 日期打开事件
+         * @author : 于继渤
+         * @date   : 2023/2/14 9:35
+         */
+        showFormingDateClick() {
+            this.showFormingDateFlag = true;
+        },
+
+        /**
+         * @desc   : 成型日期确定事件
+         * @author : 于继渤
+         * @date   : 2023/2/13 13:39
+         */
+        onConfirmProduceDate(e) {
+            this.formData.formingDate = e.date;
+            this.showFormingDateFlag = false;
+        },
+
+        /**
+         * @desc   :  成型日期关闭事件
+         * @author : 于继渤
+         * @date   : 2023/2/13 14:28
+         */
+        onCloseChooseDate() {
+            this.showFormingDateFlag = false;
+        },
+    },
+
+    mounted() {
+        // 因为是封装的组件所以是两层
+        // this.$refs.moldLineCode.$refs.input.focus()
+        // 设置滚动的位置和高度
+        this.setAppTableHeight()
+    },
+    /**
+     * @desc   : 页面初始化
+     * @author : 于继渤
+     * @date   : 2023/2/7 17:23
+     */
+    created(e) {
+        if (this.$route.params) {
+            this.formData = this.$route.params.item
+            this.parentIndex = this.$route.params.parentIndex
+            this.tableList = this.$route.params.tableList
+            this.onSearch()
+        }
+
+    }
+
+
+}
+</script>
+  
+<style scoped>
+.van-cell--large {
+    padding-top: 5px !important;
+    padding-bottom: 0px !important;
+}
+</style>
+  

+ 1 - 2
src/view/mst/molding/form.vue

@@ -367,13 +367,12 @@ export default {
           },)
         }
       } else {
-        console.log("moldlineGroupColumn",this.moldlineGroupColumn)
         this.moldlineGroupColumn = this.moldlineGroupColumn.filter(f => f.field != 'repPdtModelName')
       }
       this.$nextTick(()=>{
         this.$refs.moldlineGroupTable.initColumn()
+        this.$refs.moldlineGroupTable.refreshTableColumns(this.moldlineGroupColumn)
       })
-      this.$refs.moldlineGroupTable.refreshTableColumns()
     },
     /**
      * @desc   : 改变多批次标识

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

@@ -76,13 +76,15 @@
         },
         moldingRecordList: [],// 成型记录明细信息
         // 成型记录明细列表
-        productUniqueCodeCount: 0,//绑定条码个数
+        productUniqueCodeCount: 0,//绑定条码个数(如果长度和查询数据长度一致则不能进行绑定条码)
         //成型记录明细列表
         moldingRecordTreeColumns: [
           // 可变更产品名称
-          { field: 'repPdtModelName',
+          {
+            field: 'repPdtModelName',
             dataType: self.$config.tableSelectType.product, controlId: 'pdtModelId',
-            treeNode: true, type: 'disabled', width: 'auto' },
+            treeNode: true, type: 'disabled', width: 'auto'
+          },
           // 成型线编码
           { field: 'uniqueCode', title: self.$t('moldlineCode'), type: 'disabled', width: 'auto' },
           // 成型线名称
@@ -95,8 +97,6 @@
           { 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' },
           // 绑码标识
@@ -238,7 +238,7 @@
             }
           }
         }
-        this.$refs.moldingRecord.tableData = this.moldingRecordList;
+        this.$refs.moldingRecord.tableData = this.moldingRecordList
         // 处理子级数据
         this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
         // 重新刷新
@@ -268,6 +268,7 @@
         }
         // 处理子级数据
         this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
+        // 重新刷新
         this.$refs.moldingRecord.reloadData(this.moldingRecordList)
       },
       /**
@@ -290,7 +291,7 @@
             this.$set(row.bomItems[item], 'productUniqueCode', row[field])
           }
           //修改备注也要修改productUniqueFlag标识 用于后续保存数据过滤
-          if(field =='productRemarks'){
+          if (field == 'productRemarks') {
             this.$set(row.bomItems[item], 'productUniqueFlag', true)
           }
         }
@@ -299,21 +300,23 @@
             this.moldingRecordList[i] = row
           }
         }
+        this.$refs.moldingRecord.tableData = this.moldingRecordList
         // 处理子级数据
         this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
-        // this.$refs.moldingRecord.$refs.xTable.reloadData(this.moldingRecordList)
+        // 重新刷新
+        this.$refs.moldingRecord.reloadTreeTable(this.moldingRecordList)
       },
       /**
        *   @desc   : 替换子集
        *   @date   : 2023/4/24 15:09
        *   @author : 寇珊珊
        */
-      checkDetail(oldRow,newRow){
-        for(let it of this.moldingRecordList){
-          let index =0
-          for(let item of it.bomItems){
-            if(item.id ==oldRow.id){
-              newRow.moldingItemId= newRow.itemId
+      checkDetail(oldRow, newRow) {
+        for (let it of this.moldingRecordList) {
+          let index = 0
+          for (let item of it.bomItems) {
+            if (item.id == oldRow.id) {
+              newRow.moldingItemId = newRow.itemId
               item = Object.assign(item, newRow)
               index++
               break
@@ -328,12 +331,14 @@
        *   @author : 寇珊珊
        */
       detail(id) {
+        //绑定条码计数 每次查询之前要清零(因为保存后要重新调用)
+        this.productUniqueCodeCount = 0
         let param = {
           'moldlineId': parseInt(id),
           'pdtGlueKind': this.$route.query.pdtGlueKind,
           'moldingBatch': this.$route.query.moldingBatch,
           'moldingDate': this.$route.query.moldingDate,
-          'ftyId' : this.$store.state.user.ftyId
+          'ftyId': this.$store.state.user.ftyId
         }
         return this.excute(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.selectByMoldineId, param).then(res => {
           if (res.code === this.$config.SUCCESS_CODE) {
@@ -342,7 +347,7 @@
             this.moldingRecordList = list
             let index = 0
             for (let i of  this.moldingRecordList) {
-              i.pdtModelId= this.$config.bindBarCodePdtModelId.parentId
+              i.pdtModelId = this.$config.bindBarCodePdtModelId.parentId
               //明细已有绑定条码个数
               let productUniqueCodeLength = 0
               //明细已有成型标识个数
@@ -363,20 +368,20 @@
                 //如果明细里绑定条码存在没值的情况;总单绑定条码可以输入 反之不可以;明细有值没值都要禁用
                 if (item.productUniqueCode) {
                   //已经绑码了给替换标识false
-                  item.exchangeFlag=false
+                  item.exchangeFlag = false
                   productUniqueCodeLength++
                   item.readOnlyUniqueCode = true
                 }
                 //明细不是成型
                 if (!item.flgMolding) {
                   //不是成型给替换标识false
-                  item.exchangeFlag=false
+                  item.exchangeFlag = false
                   flgMoldingLength++
                 }
                 itemIndex++
               }
               //明细中每条绑定条码都有值  =  每条总单下的明细数量 或者 是成型标识数量大于0
-              if (productUniqueCodeLength == i.bomItems.length || flgMoldingLength>0) {
+              if (productUniqueCodeLength == i.bomItems.length || flgMoldingLength > 0) {
                 i.readOnlyUniqueCode = true
                 //明细第一条绑定条码赋值给父级
                 this.$set(this.moldingRecordList[index], 'productUniqueCode', zeroCode)

+ 47 - 43
src/view/pdm/molding-record/bind-barcode-grouping.vue

@@ -76,15 +76,17 @@
         },
         moldingRecordList: [],// 成型记录明细信息
         // 成型记录明细列表
-        productUniqueCodeCount: 0,//绑定条码个数
+        productUniqueCodeCount: 0,//绑定条码个数(如果长度和查询数据长度一致则不能进行绑定条码)
         //成型记录明细列表
         moldingRecordTreeColumns: [
           // 分组序号
-          { field: 'moldlineItemNo', title: self.$t('groupNo'),
+          {
+            field: 'moldlineItemNo', title: self.$t('bondingNo'),
             dataType: self.$config.tableSelectType.product, controlId: 'pdtModelId',
-            treeNode: true, type: 'disabled', width: 'auto' },
+            treeNode: true, type: 'disabled', width: 'auto'
+          },
           // 分组名称
-          { field: 'moldlineItemCode', title: self.$t('groupName'), type: 'disabled', width: 'auto' },
+          { field: 'moldlineItemCode', title: self.$t('repPdtModelName'), type: 'disabled', width: 'auto' },
           // 成型线编码
           { field: 'uniqueCode', title: self.$t('moldlineCode'), type: 'disabled', width: 'auto' },
           // 成型线名称
@@ -97,8 +99,6 @@
           { 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' },
           // 绑码标识
@@ -241,7 +241,7 @@
             }
           }
         }
-        this.$refs.moldingRecord.tableData = this.moldingRecordList;
+        this.$refs.moldingRecord.tableData = this.moldingRecordList
         // 处理子级数据
         this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
         // 重新刷新
@@ -285,38 +285,40 @@
         this.$set(this.moldingRecordList[rowIndex], field, row[field])
         this.$set(this.moldingRecordList[rowIndex], 'productUniqueFlag', true)
         row.productUniqueFlag = true
-          //改变每条总单下明细的绑定条码
-          for (let item = 0; item < row.bomItems.length; item++) {
-            //从后台数据查出来绑定条码已经存在的不需要赋值;
-            if (!row.bomItems[item].readOnlyUniqueCode) {
-              this.$set(row.bomItems[item], 'productUniqueFlag', true)
-              this.$set(row.bomItems[item], 'productUniqueCode', row[field])
-            }
-            //修改备注也要修改productUniqueFlag标识 用于后续保存数据过滤
-            if(field =='productRemarks'){
-              this.$set(row.bomItems[item], 'productUniqueFlag', true)
-            }
+        //改变每条总单下明细的绑定条码
+        for (let item = 0; item < row.bomItems.length; item++) {
+          //从后台数据查出来绑定条码已经存在的不需要赋值;
+          if (!row.bomItems[item].readOnlyUniqueCode) {
+            this.$set(row.bomItems[item], 'productUniqueFlag', true)
+            this.$set(row.bomItems[item], 'productUniqueCode', row[field])
           }
-          for (let i = 0; i < this.moldingRecordList.length; i++) {
-            if (this.moldingRecordList[i].id == row.id) {
-              this.moldingRecordList[i] = row
-            }
+          //修改备注也要修改productUniqueFlag标识 用于后续保存数据过滤
+          if (field == 'productRemarks') {
+            this.$set(row.bomItems[item], 'productUniqueFlag', true)
           }
-          // 处理子级数据
-          this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
-          // this.$refs.moldingRecord.reloadData(this.moldingRecordList)
+        }
+        for (let i = 0; i < this.moldingRecordList.length; i++) {
+          if (this.moldingRecordList[i].id == row.id) {
+            this.moldingRecordList[i] = row
+          }
+        }
+        this.$refs.moldingRecord.tableData = this.moldingRecordList
+        // 处理子级数据
+        this.$refs.moldingRecord.loadChildrenInit(this.moldingRecordList, ['productUniqueCode'])
+        // 重新刷新
+        this.$refs.moldingRecord.reloadTreeTable(this.moldingRecordList)
       },
       /**
        *   @desc   : 替换子集
        *   @date   : 2023/4/24 15:09
        *   @author : 寇珊珊
        */
-      checkDetail(oldRow,newRow){
-        for(let it of this.moldingRecordList){
-          let index =0
-          for(let item of it.bomItems){
-            if(item.id ==oldRow.id){
-              newRow.moldingItemId= newRow.itemId
+      checkDetail(oldRow, newRow) {
+        for (let it of this.moldingRecordList) {
+          let index = 0
+          for (let item of it.bomItems) {
+            if (item.id == oldRow.id) {
+              newRow.moldingItemId = newRow.itemId
               item = Object.assign(item, newRow)
               index++
               break
@@ -331,12 +333,14 @@
        *   @author : 寇珊珊
        */
       detail(id) {
+        //绑定条码计数 每次查询之前要清零(因为保存后要重新调用)
+        this.productUniqueCodeCount = 0
         let param = {
           'moldlineId': parseInt(id),
           'pdtGlueKind': this.$route.query.pdtGlueKind,
           'moldingBatch': this.$route.query.moldingBatch,
           'moldingDate': this.$route.query.moldingDate,
-          'ftyId' : this.$store.state.user.ftyId
+          'ftyId': this.$store.state.user.ftyId
         }
         return this.excute(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.selectByMoldineId, param).then(res => {
           if (res.code === this.$config.SUCCESS_CODE) {
@@ -345,7 +349,7 @@
             this.moldingRecordList = list
             let index = 0
             for (let i of  this.moldingRecordList) {
-              i.pdtModelId= this.$config.bindBarCodePdtModelId.parentId
+              i.pdtModelId = this.$config.bindBarCodePdtModelId.parentId
               //明细已有绑定条码个数
               let productUniqueCodeLength = 0
               //明细已有成型标识个数
@@ -365,19 +369,19 @@
                 this.$set(item, 'readOnly', ['productUniqueCode'])
                 //如果明细里绑定条码存在没值的情况;总单绑定条码可以输入 反之不可以;明细有值没值都要禁用
                 if (item.productUniqueCode) {
-                  item.exchangeFlag=false
+                  item.exchangeFlag = false
                   productUniqueCodeLength++
                   item.readOnlyUniqueCode = true
                 }
                 //明细不是成型
                 if (!item.flgMolding) {
-                  item.exchangeFlag=false
+                  item.exchangeFlag = false
                   flgMoldingLength++
                 }
                 itemIndex++
               }
               //明细中每条绑定条码都有值  =  每条总单下的明细数量 或者 是成型标识数量大于0
-              if (productUniqueCodeLength == i.bomItems.length || flgMoldingLength>0) {
+              if (productUniqueCodeLength == i.bomItems.length || flgMoldingLength > 0) {
                 i.readOnlyUniqueCode = true
                 //明细第一条绑定条码赋值给父级
                 this.$set(this.moldingRecordList[index], 'productUniqueCode', zeroCode)
@@ -408,15 +412,15 @@
         if (this.moldingRecordList.length > 0) {
           //提取明细信息
           for (let it of this.moldingRecordList.filter(it => it.productUniqueFlag)) {
-            let bomItems= it.bomItems.filter(item => item.productUniqueFlag)
+            let bomItems = it.bomItems.filter(item => item.productUniqueFlag)
             list.push({
-              moldingItemIds: bomItems.map(map =>map.moldingItemId),
-              ftyId :bomItems[0].ftyId,
-              moldingItemId :bomItems[0].moldingItemId,
-              uniqueId :bomItems[0].productId,
+              moldingItemIds: bomItems.map(map => map.moldingItemId),
+              ftyId: bomItems[0].ftyId,
+              moldingItemId: bomItems[0].moldingItemId,
+              uniqueId: bomItems[0].productId,
               uniqueCode: bomItems[0].productId ? null : it.productUniqueCode,
-              remarks :it.productRemarks,
-              flgPdtGlue :true,
+              remarks: it.productRemarks,
+              flgPdtGlue: true,
             })
           }
         }

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

@@ -108,7 +108,7 @@
           // 备注
           { field: 'productRemarks', type: 'text', width: 'auto' },
         ],
-        productUniqueCodeCount: 0,//绑定条码个数
+        productUniqueCodeCount: 0,//绑定条码个数(如果长度和查询数据长度一致则不能进行绑定条码)
         //商品条码-数字正则
         checkProduceBarCode: function (value) {
           const reg = /^.*\d+.*$/
@@ -246,6 +246,8 @@
        *   @author : 寇珊珊
        */
       detail(id) {
+        //绑定条码计数 每次查询之前要清零(因为保存后要重新调用)
+        this.productUniqueCodeCount=0
         let param = {
           'moldlineId':parseInt(id),
           'pdtGlueKind': this.$route.query.pdtGlueKind,