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

Merge remote-tracking branch 'origin/master'

wangyingjie 2 лет назад
Родитель
Сommit
0b378a825f

+ 25 - 14
src/components-app/base/dk-app-table-more/dk-app-table-more.vue

@@ -32,7 +32,7 @@
                     @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)"
+                    :readonly="(!rowsItem.fieldFlag || (tableDataItem[rowsItem.fieldKey] && rowsItem.readonlyInputFlag)) || readonlyAll"
                     v-model="tableDataItem[rowsItem.name]"></dk-app-field>
                 </div>
                 <div v-if="!rowsItem.collapseFlag && rowsItem.fieldCheckBoxFlag" style="padding-top: 10px">
@@ -75,7 +75,7 @@
                     :key="bomIndex">
                     <!-- 成型标识为true  允许绑码标识 true 才能替换 -->
                     <!-- 左滑替换组件 -->
-                    <van-swipe-cell  :disabled="bomItems.flgBindUnique || !bomItems.flgMolding">
+                    <van-swipe-cell :disabled="bomItems.flgBindUnique || !bomItems.flgMolding">
                       <div v-for="(rowsBomItem, rowsBomIndex) in rowsBom" :key="rowsBomIndex">
                         <div style="width: 100%;display: flex">
                           <!-- 标题字段-->
@@ -88,7 +88,7 @@
                         </div>
                       </div>
                       <template #right>
-                        <van-button square type="primary" text="替换" @click="replace(bomItems, bomIndex,tableDataIndex)"
+                        <van-button square type="primary" text="替换" @click="replace(bomItems, bomIndex, tableDataIndex)"
                           class="delete-button" />
                       </template>
                     </van-swipe-cell>
@@ -127,6 +127,7 @@ import { appOthers } from "@/locale/lang/zh-CN";
     * collapseFlag : 更多信息标识  true/false 显示/隐藏
     * readonlyInputFlag :动态输入标识  true 关闭   根据fieldKey字段中的值控制只读
     *  emptyValueFlag :空值隐藏属性 true/false  显示/隐藏
+    *   singleFlag:单选标识  默认多选 
     * @author : 于继渤
     * @date   : 2023/3/13 14:29
     */
@@ -146,6 +147,10 @@ export default {
       type: Boolean,
       default: false
     },
+    readonlyAll: {   //全部只读
+      type: Boolean,
+      default: false
+    },
     boxShadowFlag: {
       type: Boolean,
       default: true
@@ -186,14 +191,7 @@ export default {
     },
     tableData: {
       type: Array,
-      default: () => [
-        { storeName: '门店123456789', amount: '1888', target: '2000', rate: '80%' },
-        {
-          storeName: '门店123456789',
-          amount: '1888',
-          target: '2000',
-          rate: '80%'
-        }]
+      default: () => []
     },
     collapseFlag: { //开启更多
       type: Boolean,
@@ -216,7 +214,10 @@ export default {
         username: '李先生'
       },]
     },
-
+    singleFlag: {  //单选标识  默认多选
+      type: Boolean,
+      default: false
+    }
 
   },
   data() {
@@ -287,7 +288,7 @@ export default {
         index: index
       })
     },
-    replace(item, index,parentIndex){
+    replace(item, index, parentIndex) {
       this.$emit("replace", {
         item: item,
         index: index,
@@ -309,6 +310,14 @@ export default {
     },
     //复选框点击事件
     onClickCheckbox(item, index) {
+      if (this.singleFlag) {
+        for (let i = 0; i < this.tableRowData.length; i++) {
+          if (index != i) {
+            this.$set(this.tableRowData[i], 'checked', false)
+          }
+        }
+      }
+
       this.$emit("onClickCheckbox", {
         item: item,
         index: index
@@ -452,10 +461,12 @@ export default {
 .delete-button {
   height: 100%;
 }
+
 .replace-button {
   height: 100%;
-  color:greenyellow;
+  color: greenyellow;
 }
+
 .ellipsis {
   overflow-y: auto;
   /*text-overflow: ellipsis;*/

+ 174 - 168
src/components-app/base/dk-app-table/dk-app-table.vue

@@ -4,7 +4,7 @@
     <!--表的结构是  列的数据   -->
     <div v-if="columns && columns.length > 0">
       <div class="top-data" v-if="imgFlag">
-        <div v-for="(tdItem,tdIndex) in topData" :key="tdIndex" :style="{width: 100/topData.length+'%'}">
+        <div v-for="(tdItem, tdIndex) in topData" :key="tdIndex" :style="{ width: 100 / topData.length + '%' }">
           <div>
             <div v-if="tdItem.type === 'amount'" style="display: flex;align-items: baseline;justify-content: center;">
               <span style="font-size: 12px;">¥</span>
@@ -20,191 +20,181 @@
       <div class="header">
         <div style="width:17px;"></div>
         <div style="width: calc(100% - 17px);display: flex;">
-          <div :style="{width:colItem.width,textAlign:(colItem.align?colItem.align:'center')}"
-               v-for="(colItem,colIndex) in columns" :key="colIndex">{{ colItem.title }}
+          <div :style="{ width: colItem.width, textAlign: (colItem.align ? colItem.align : 'center') }"
+            v-for="(colItem, colIndex) in columns" :key="colIndex">{{ colItem.title }}
           </div>
         </div>
       </div>
 
-      <div v-if="tableData && tableData.length>0" class="data">
-        <div v-for="(tableDataItem,tableDataIndex) in tableData" :key="tableDataIndex"
-             style="display: flex;background: #fff;padding: 0 9px;">
+      <div v-if="tableData && tableData.length > 0" class="data">
+        <div v-for="(tableDataItem, tableDataIndex) in tableData" :key="tableDataIndex"
+          style="display: flex;background: #fff;padding: 0 9px;">
           <div v-if="imgFlag" style="width:17px;position: relative;display: flex;align-items: center;"
-               :style="{borderBottom:(tableDataIndex!==tableData.length-1?1:0)+'px solid #E9F0FE;'}">
-            <img style="position: absolute;width: 20.16px;height: 15.26px;top:8px;left:-9.5px;" v-if="tableDataIndex<=2"
-                 :src="getImg(tableDataIndex)"/>
+            :style="{ borderBottom: (tableDataIndex !== tableData.length - 1 ? 1 : 0) + 'px solid #E9F0FE;' }">
+            <img style="position: absolute;width: 20.16px;height: 15.26px;top:8px;left:-9.5px;" v-if="tableDataIndex <= 2"
+              :src="getImg(tableDataIndex)" />
             <div style="font-family: 'DIN Alternate';font-style: normal;font-weight: 700;font-size: 9px;color: #1B365D;"
-                 v-else>{{ tableDataIndex <= 8 ? ('0' + (tableDataIndex + 1)) : (tableDataIndex + 1) }}
+              v-else>{{ tableDataIndex <= 8 ? ('0' + (tableDataIndex + 1)) : (tableDataIndex + 1) }} </div>
             </div>
-          </div>
-          <div style="width: calc(100%);display: flex;">
-            <div class="cell"
-                 :style="{width:col2Item.width,borderBottom:(tableDataIndex!==tableData.length-1?1:0)+'px solid #E9F0FE',textAlign:(col2Item.align?col2Item.align:'center')}"
-                 v-for="(col2Item,col2Index) in columns" :key="col2Index">
-          <span v-if="col2Item.type === 'amount'" style="display: inline-block;text-align: left;word-break: break-all;">
-            <span style="font-size: 10px;"
-                  v-if="(tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0)">¥</span>
-            {{
-              tableDataItem[col2Item.name] ? toThousandCents(tableDataItem[col2Item.name]) : (!col2Item.ifNull ? '0.00' : col2Item.ifNull)
-            }}
-          </span>
-              <span v-else style="display: inline-block;text-align: left;word-break: break-all;">
-            {{
-                  col2Item.before && (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ? col2Item.before : ''
-                }}
-            {{
-                  (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ? tableDataItem[col2Item.name] : (col2Item.ifNull ? col2Item.ifNull : '')
-                }}
-            {{
-                  col2Item.after && (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ? col2Item.after : ''
-                }}
-          </span>
+            <div style="width: calc(100%);display: flex;">
+              <div class="cell"
+                :style="{ width: col2Item.width, borderBottom: (tableDataIndex !== tableData.length - 1 ? 1 : 0) + 'px solid #E9F0FE', textAlign: (col2Item.align ? col2Item.align : 'center') }"
+                v-for="(col2Item, col2Index) in columns" :key="col2Index">
+                <span v-if="col2Item.type === 'amount'"
+                  style="display: inline-block;text-align: left;word-break: break-all;">
+                  <span style="font-size: 10px;"
+                    v-if="(tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0)">¥</span>
+                  {{
+                    tableDataItem[col2Item.name] ? toThousandCents(tableDataItem[col2Item.name]) : (!col2Item.ifNull ?
+                      '0.00' : col2Item.ifNull)
+                  }}
+                </span>
+                <span v-else style="display: inline-block;text-align: left;word-break: break-all;">
+                  {{
+                    col2Item.before && (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ?
+                    col2Item.before : ''
+                  }}
+                  {{
+                    (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ? tableDataItem[col2Item.name] :
+                    (col2Item.ifNull ? col2Item.ifNull : '')
+                  }}
+                  {{
+                    col2Item.after && (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ? col2Item.after
+                    : ''
+                  }}
+                </span>
+              </div>
             </div>
           </div>
         </div>
+        <div v-else
+          style="line-height: 100px;color: #95A8CB;width:100%;font-family: 'PingFang SC';font-style: normal;font-weight: 400;font-size: 14px;background:#fff;text-align: center;">
+          <div>{{ $t('appNoData') }}</div>
+        </div>
       </div>
-      <div v-else
-           style="line-height: 100px;color: #95A8CB;width:100%;font-family: 'PingFang SC';font-style: normal;font-weight: 400;font-size: 14px;background:#fff;text-align: center;">
-        <div>{{ $t('appNoData') }}</div>
-      </div>
-    </div>
-    <!--  行的数据  有测拉删除的组件 -->
-    <div v-if="rows && rows.length > 0">
-      <div v-for="(tableDataItem,tableDataIndex) in tableRowData" :key="tableDataIndex"
-           @click="onOpenDetail(tableDataItem,tableDataIndex)"
-           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="">
+      <!--  行的数据  有测拉删除的组件 -->
+      <div v-if="rows && rows.length > 0">
+        <div v-for="(tableDataItem, tableDataIndex) in tableRowData" :key="tableDataIndex"
+          @click="onOpenDetail(tableDataItem, tableDataIndex)"
+          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>
+                    @click="onClickCheckbox(tableDataItem, tableDataIndex)"></van-checkbox>
 
+                </div>
               </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"
-                                  @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 :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"
+                        @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 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>
-          </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="$t('appSeeMore')" name="1">
-                    <div class="app-row " style="display: flow" v-for="(rowsItem,rowsIndex) in rows" :key="rowsIndex">
-                      <div style="width: 100%;display: flex">
-                        <!-- 标题字段-->
-                        <div v-if="rowsItem.collapseFlag  && !rowsItem.sidePullFlag && !rowsItem.sidePullDateFlag" style="width: 100%">
-                          <!-- 输入框-->
-                          <dk-app-field :focus="true" :label="rowsItem.title" :typeInput="rowsItem.typeInput"
-                                        :maxlength="rowsItem.maxlength"
-                                        :removeSpacesFlag="rowsItem.removeSpacesFlag"
-                                        :placeholderFlag="rowsItem.placeholderFlag"
-                                        :readonly="!rowsItem.fieldFlag || !tableDataItem[rowsItem.fieldKey]"
-                                        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%">
-
-                          <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" :arrow-direction=" !tableDataItem['flgBindUnique'] ?'down':''"
-                            :is-link="!tableDataItem[rowsItem.name] && !tableDataItem['flgBindUnique']"
-                            :placeholderFlag="!tableDataItem['flgBindUnique']"
-                          />
+            <!-- 查看更多-->
+            <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="$t('appSeeMore')" name="1">
+                      <div class="app-row " style="display: flow" v-for="(rowsItem, rowsIndex) in rows" :key="rowsIndex">
+                        <div style="width: 100%;display: flex">
+                          <!-- 标题字段-->
+                          <div v-if="rowsItem.collapseFlag && !rowsItem.sidePullFlag && !rowsItem.sidePullDateFlag"
+                            style="width: 100%">
+                            <!-- 输入框-->
+                            <dk-app-field :focus="true" :label="rowsItem.title" :typeInput="rowsItem.typeInput"
+                              :maxlength="rowsItem.maxlength" :removeSpacesFlag="rowsItem.removeSpacesFlag"
+                              :placeholderFlag="rowsItem.placeholderFlag"
+                              :readonly="!rowsItem.fieldFlag || !tableDataItem[rowsItem.fieldKey]"
+                              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%">
+
+                            <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" :arrow-direction="!tableDataItem['flgBindUnique'] ? 'down' : ''"
+                              :is-link="!tableDataItem[rowsItem.name] && !tableDataItem['flgBindUnique']"
+                              :placeholderFlag="!tableDataItem['flgBindUnique']" />
+                          </div>
                         </div>
                       </div>
-                    </div>
-                  </van-collapse-item>
-                </van-collapse>
+                    </van-collapse-item>
+                  </van-collapse>
+                </div>
               </div>
             </div>
-          </div>
-          <template #right>
-            <van-button square type="danger" text="删除" @click="onDelClick(tableDataItem,tableDataIndex)"
-                        class="delete-button"/>
-          </template>
-        </van-swipe-cell>
+            <template #right>
+              <van-button square type="danger" text="删除" @click="onDelClick(tableDataItem, tableDataIndex)"
+                class="delete-button" />
+            </template>
+          </van-swipe-cell>
+        </div>
       </div>
-    </div>
 
-    <van-empty v-if="tableRowData.length <=0" :description="description"/>
-  </div>
+      <van-empty v-if="tableRowData.length <= 0" :description="description" />
+    </div>
 </template>
 
 <script>
@@ -212,7 +202,7 @@
 import index1 from '@/assets/images/index1.png'
 import index2 from '@/assets/images/index2.png'
 import index3 from '@/assets/images/index3.png'
-import {appOthers} from "@/locale/lang/zh-CN";
+import { appOthers } from "@/locale/lang/zh-CN";
 
 /**
     * @desc   : row 中 rowsItem 里的参数标识  (v-for="(rowsItem,rowsIndex) in rows")
@@ -225,6 +215,7 @@ import {appOthers} from "@/locale/lang/zh-CN";
     * collapseFlag : 更多信息标识  true/false 显示/隐藏
     * readonlyInputFlag :动态输入标识  true 关闭   根据fieldKey字段中的值控制只读
     *  emptyValueFlag :空值隐藏属性 true/false  显示/隐藏
+    *   singleFlag:单选标识  默认多选 
     * @author : 于继渤
     * @date   : 2023/3/13 14:29
     */
@@ -284,7 +275,7 @@ export default {
     tableData: {
       type: Array,
       default: () => [
-        {storeName: '门店123456789', amount: '1888', target: '2000', rate: '80%'},
+        { storeName: '门店123456789', amount: '1888', target: '2000', rate: '80%' },
         {
           storeName: '门店123456789',
           amount: '1888',
@@ -302,7 +293,7 @@ export default {
     },
     tableRowData: {
       type: Array,
-      default: () => [{scancode: '221101001LDQ', state: '库存上线', code: 'B01B06-01', username: '王先生'}, {
+      default: () => [{ scancode: '221101001LDQ', state: '库存上线', code: 'B01B06-01', username: '王先生' }, {
         scancode: '22110005001KJK',
         state: '在产',
         code: 'B01B06-02',
@@ -311,6 +302,12 @@ export default {
     },
 
 
+    singleFlag: {  //单选标识  默认多选
+      type: Boolean,
+      default: false
+    }
+
+
   },
   data() {
     return {
@@ -382,6 +379,13 @@ export default {
     },
     //复选框点击事件
     onClickCheckbox(item, index) {
+      if (this.singleFlag) {
+        for (let i = 0; i < this.tableRowData.length; i++) {
+          if (index != i) {
+            this.$set(this.tableRowData[i], 'checked', false)
+          }
+        }
+      }
       this.$emit("onClickCheckbox", {
         item: item,
         index: index
@@ -445,12 +449,12 @@ export default {
   padding: 10px 0px !important;
 }
 
-.top-data > div:nth-child(n) {
+.top-data>div:nth-child(n) {
   text-align: center;
 
 }
 
-.top-data > div:nth-child(n) > div:nth-child(1) {
+.top-data>div:nth-child(n)>div:nth-child(1) {
   margin-bottom: 5px;
   font-family: 'PingFang HK';
   font-style: normal;
@@ -459,7 +463,7 @@ export default {
   color: #1B365D;
 }
 
-.top-data > div:nth-child(n) > div:nth-child(2) {
+.top-data>div:nth-child(n)>div:nth-child(2) {
   font-family: 'PingFang SC';
   font-style: normal;
   font-weight: 400;
@@ -467,7 +471,7 @@ export default {
   color: #95A8CB;
 }
 
-.top-data > div:nth-child(n+2) {
+.top-data>div:nth-child(n+2) {
   border-left: 1px solid #ABC6CC;
 }
 
@@ -479,7 +483,7 @@ export default {
   padding: 0 9.5px;
 }
 
-.header > div:nth-child(n) {
+.header>div:nth-child(n) {
   font-family: 'PingFang SC';
   font-style: normal;
   font-weight: 400;
@@ -499,9 +503,11 @@ export default {
   justify-content: center;
   align-items: center;
 }
-.van-cell{
+
+.van-cell {
   padding: 4px 0px !important;
 }
+
 .app-row {
   font-family: 'PingFang HK';
   /*font-style: normal;*/

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

@@ -1520,6 +1520,7 @@ export const appColumns = {
   appOldProdCodeChange: '原产品型号',
   appNewProdCodeChange: '新产品型号',
   appNewProdCodeName: '新型号名称',
+  appAddDetails:'添加产品至明细'
 }
 /**
  * @desc   : app按钮
@@ -1635,7 +1636,8 @@ export const appOthers = {
   appNoBonding:'分体粘接-无',
   appIntragroupBonding:'分体粘接-组',
   appGroupBonding:'分体粘接-位',
-  appProductSelectReplaceTitle:'请选择需要替换的产品'
+  appProductSelectReplaceTitle:'请选择需要替换的产品',
+  appProductSelectAddReplaceTitle:'请选择需要添加的产品'
 }
 
 

+ 1 - 1
src/mixins/index.js

@@ -510,7 +510,7 @@ export const indexMixin = {
      * @author : 周兴
      * @date   : 2023/1/6 13:04
      */
-    getMaxDisplayNo(displayNoTable,otherParams = null, formDataName = null) {
+    getMaxDisplayNo(displayNoTable,otherParams, formDataName = null) {
       let params = {
         table: displayNoTable.model + "." + displayNoTable.table,
         ftyId: this.$store.state.user.ftyId

+ 96 - 29
src/view-app/app/grouting-management/grouting-bind-barcode/index.vue

@@ -13,26 +13,48 @@
     <dk-app-field :focus="true" :readonly="false" :label="$t('appGroutingBatch')" @changeBarCode="onSearch"
       v-model="formData.moldingBatch"></dk-app-field>
     <!-- 起始编码-->
-    <dk-app-field :focus="true" :readonly="false" :label="$t('appStartCode')" :removeSpacesFlag="true"
-      v-model="formData.produceBarCode" @changeBarCode="setStartCode"></dk-app-field>
+    <dk-app-field :focus="true"  :label="$t('appStartCode')"
+      :removeSpacesFlag="true" v-model="formData.produceBarCode" @changeBarCode="setStartCode"></dk-app-field>
 
     <div class="main-app-table" ref="scrollTable">
       <!--  列表-->
       <dk-app-table-more :rows="rowsTemp" :rowsBom="rowsBom" :collapseFlag="collapseFlag" :tableRowData="tableRowData"
-        :checkboxFlag="false" @changeValue="changeValue" @replace="replace">
+        @changeValue="changeValue" @replace="replace" :singleFlag="true" :checkboxFlag="checkboxFlag"
+       @onClickCheckbox="onClickCheckbox">
       </dk-app-table-more>
-
+      <!-- :readonlyAll="flgBindUnique || !flgMolding"  -->
     </div>
 
     <div style="height: 150px"></div>
     <!--    保存-->
-    <div class="app_save_bottom-class" v-if="tableRowData.length > 0" style="padding: 15px 10px 10px 10px">
-      <dk-app-button @click="save" :disabled="loading">{{
-        $t('appSave') + '(' + tableRowData.length + ')'
-      }}
-      </dk-app-button>
+
+
+    <div class="app_save_bottom-class" style="padding: 15px 10px 10px 10px">
+      <div style="display: flex">
+        <!--        添加明细-->
+        <div style="width: 35%" v-if="tableRowDataChecked.length > 0">
+          <dk-app-button
+            @click="replace({ key: 'add', item: tableRowDataChecked[0], parentIndex: parentIndex, moldlineId: moldlineId })">{{
+              $t('appAddDetails') }}
+          </dk-app-button>
+        </div>
+        <div v-if="tableRowDataChecked.length > 0" style="width:5%"></div>
+
+        <!--        保存-->
+        <div :style="tableRowDataChecked.length > 0 ? 'width: 60%' : 'width: 100%'">
+          <dk-app-button @click="save" :disabled="loading">{{
+            $t('appSave') + '(' + tableRowData.length + ')'
+          }}
+          </dk-app-button>
+        </div>
+      </div>
+
 
     </div>
+
+
+
+
     <!--    单选天日期组件-->
     <dk-app-dropdown-single-date-day :show="showFormingDateFlag" @onConfirmChooseDate="onConfirmProduceDate"
       @onCloseChooseDate="onCloseChooseDate"></dk-app-dropdown-single-date-day>
@@ -49,6 +71,9 @@ export default {
   mixins: [appFormMixin],
   data() {
     return {
+      flgBindUnique: false,
+      flgMolding: true,
+      checkboxFlag: false, //成型日期标识
       showFormingDateFlag: false, //成型日期标识
       collapseFlag: false, //更多标识
       rowsTemp: [],
@@ -107,10 +132,41 @@ export default {
         produceBarCode: '',
         formingDate: ''
       },
-      tableRowData: []
+      tableRowData: [],
+      tableRowDataChecked: [],
+      parentIndex: null,
     }
   },
   methods: {
+    /**
+      * @desc   : 单选
+      * @author : 于继渤
+      * @date   : 2023/2/7 17:23
+      */
+    onClickCheckbox(e) {
+      this.tableRowDataChecked = this.tableRowData.filter(res => {
+        return res.checked
+      })
+      
+      this.parentIndex = e.index
+    },
+
+    /**
+     * @desc   : 替换
+     * @author : 于继渤
+     * @date   : 2023/4/25 12:23
+     */
+    replace(e) {
+      this.$router.push({
+        name: 'app-product-select-replace', params: {
+          item: e.item,
+          key: e.key ? e.key : '',
+          moldlineId: e.moldlineId ? e.moldlineId : null,
+          parentIndex: e.parentIndex,
+          tableList: this.tableRowData[e.parentIndex]
+        }
+      })
+    },
 
     /**
       * @desc   : 搜索事件
@@ -156,6 +212,9 @@ export default {
         this.loading = false
         if (res.code === this.$config.SUCCESS_CODE) {
           if (res.data && res.data.length > 0) {
+            this.moldlineId = res.data[0].uniqueId
+            this.flgBindUnique = res.data[0].flgBindUnique //绑码标识
+            this.flgMolding = res.data[0].flgMolding //成型标识
             let params =
             {
               ftyId: this.$store.state.user.ftyId,
@@ -188,6 +247,8 @@ export default {
             this.tableRowData = res.data
             //无分组
             if (params.pdtGlueKind.indexOf(this.$t('appNoBonding')) !== -1) {
+              this.checkboxFlag = false
+
               this.rowsTemp = this.rows
               this.collapseFlag = false
               this.pdtGlueKind = 0
@@ -204,6 +265,8 @@ export default {
               }
             }
             if (params.pdtGlueKind.indexOf(this.$t('appIntragroupBonding')) !== -1) {
+              this.checkboxFlag = false
+
               this.rowsTemp = this.rowsGroup
               this.collapseFlag = true
               this.pdtGlueKind = 1
@@ -256,6 +319,7 @@ export default {
               }
             }
             if (params.pdtGlueKind.indexOf(this.$t('appGroupBonding')) !== -1) {
+              this.checkboxFlag = true
               let index = 0
               this.rowsTemp = this.rowsGrouping
               this.collapseFlag = true
@@ -361,18 +425,6 @@ export default {
     },
 
 
-    /**
-     * @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   : 设置起始编码
@@ -613,8 +665,8 @@ export default {
         }
       }
     },
-    handleExcuteAlert(){
-        this.loading = false
+    handleExcuteAlert() {
+      this.loading = false
     },
 
     /**
@@ -701,7 +753,7 @@ export default {
      * @author : 于继渤
      * @date   : 2023/3/6 10:35
      */
-     validData() {
+    validData() {
       let codeNoList = []
       codeNoList = codeNoList.concat(this.tableRowData.copy().filter(f => f.productUniqueCode).map(m => m.productUniqueCode))
       if (codeNoList.length != codeNoList.unique().length) {
@@ -747,11 +799,26 @@ export default {
   created(e) {
 
   },
-
+  /**
+   * @desc   : 下一页返回数据处理
+   * @author : 于继渤
+   * @date   : 2023/2/7 17:23
+   */
   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
+    if (localStorage.getItem("app-product-select-replace-data") !== null) {
+      let chooseData = JSON.parse(localStorage.getItem("app-product-select-replace-data")) || []
+      if (chooseData.key === 'add') {
+        //新添明细数据处理
+        if (chooseData.parentIndex || chooseData.parentIndex === 0) {
+          this.tableRowData[chooseData.parentIndex].bomItems.push(chooseData.children)
+        }
+      } else {
+        //替换明细数据处理
+        if (chooseData.parentIndex || chooseData.parentIndex === 0) {
+          this.tableRowData[chooseData.parentIndex].bomItems = chooseData.children
+        }
+      }
+      //清空缓存数据
       localStorage.removeItem("app-product-select-replace-data")
     }
   },

+ 163 - 58
src/view-app/app/grouting-management/grouting-bind-barcode/product-select-replace.vue

@@ -2,31 +2,53 @@
     <!-- 选择成型线 -->
     <div class="main-app">
         <!-- 顶部导航栏 -->
-        <dk-app-nav-bar :title="$t('appProductSelectReplaceTitle')" @click-left="onClickLeft"></dk-app-nav-bar>
+        <dk-app-nav-bar :title="title" @click-left="onClickLeft"></dk-app-nav-bar>
+        <!--      成型线编码-->
+        <dk-app-field v-model="formDataView.uniqueCode" :label="$t('appMoldingCode')" ref="uniqueCode"
+            placeholderType="scan" :readonly="false" @changeBarCode="onSearch" />
+
+        <!--      成型日期-->
+        <dk-app-field v-model="formDataView.formingDate" :label="$t('appFormingDate')" :readonly="true"
+            :defaultDateFlag="false" @click="showFormingDateClick" placeholderType="choose" is-link
+            arrow-direction="down" />
+        <!--      成型批次-->
+        <dk-app-field v-model="formDataView.moldingBatch" :label="$t('appGroutingBatch')" typeInput="number"
+            :readonly="false" @changeBarCode="onSearch" />
+        <!-- 分组序号-->
+        <dk-app-field :focus="true" :readonly="false" :label="$t('appGroupNo')" typeInput="digit" @changeBarCode="onSearch"
+            v-model="formDataView.groupName"></dk-app-field>
+
         <div class="main-app-table" ref="scrollTable">
-            <!--  列表-->
-            <dk-app-table :rows="rows" :tableRowData="tableRowData" :checkboxFlag="true" :collapseFlag="false"
-                @onClickCheckbox="onClickCheckbox">
-            </dk-app-table>
+            <van-list v-model="pageLoading" :immediate-check="false" :finished="pageFinished"
+                :finished-text="$t('appNoMoreData')" @load="getData" offset="10">
+                <!--  列表-->
+                <dk-app-table :rows="rows" :tableRowData="tableRowData" :checkboxFlag="true" :collapseFlag="false"
+                    :singleFlag="true" @onClickCheckbox="onClickCheckbox">
+                </dk-app-table>
+            </van-list>
         </div>
         <!--    保存-->
         <div class="app_save_bottom-class" style="padding: 15px 10px 10px 10px">
-            <dk-app-button @click="save">{{$t('appDefine')}} </dk-app-button>
-
+            <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="pageLoading"></dk-app-loading>
     </div>
 </template>
   
   
 <script>
-import { appFormMixin } from "@/mixins/appform";
+import { appIndexMixin } from "@/mixins/appindex";
 
 export default {
     name: "app-product-select-replace",
-    mixins: [appFormMixin],
+    mixins: [appIndexMixin],
     data() {
         return {
-            loading: false,
+            title: this.$t('appProductSelectReplaceTitle'),
             showFormingDateFlag: false,
             tableRowData: [],
             chooseData: {},
@@ -34,9 +56,21 @@ export default {
                 moldLineCode: '',//成型线编码
                 productUniqueCode: '',//产品编码
                 formingDate: '',
-                moldingBatch: 1,
+                moldingBatch: '',
+                pdtBarcode: '',
+                moldingUser: '',
+                uniqueCode: '',
+                groupName: '',
+            },
+            formDataView: {
+                moldLineCode: '',//成型线编码
+                productUniqueCode: '',//产品编码
+                formingDate: '',
+                moldingBatch: '',
                 pdtBarcode: '',
                 moldingUser: '',
+                uniqueCode: '',
+                groupName: '',
             },
             rows: [
                 { name: 'moldingBatch', title: this.$t('moldingBatch') },
@@ -49,23 +83,68 @@ export default {
                 { name: 'modelName', title: this.$t('productName') },
                 { name: 'mouldCode', title: this.$t('moldingModelCode') },
                 { name: 'moldlineItemKindName', title: this.$t('mouldKind') },
-            ]
+            ],
+            pageLoading: false,//是否处于加载状态,加载过程中不触发load事件
+            pageFinished: false,//是否已加载完成,加载完成后不再触发load事件
+            page: 1,
+            page_size: 10,
+            pageTotal: 0,
 
         }
     },
+
     methods: {
         /**
+         * @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;
+        },
+        /**
          *   @desc   : 设置查询参数
          *   @date   : 2023/02/01
          *   @author : 于继渤
          */
         setSearchParams() {
             let params = {}
-            params.currentPage = 1
-            params.pageSize = 999
+            if (this.key === 'add') {
+                //查询可添加绑定条码的产品
+                params.modelIdList = []
+                if (this.formData.bomItems && this.formData.bomItems.length > 0) {
+                    this.formData.bomItems.forEach(res => {
+                        params.modelIdList.push(res.mouldId)
+                    })
+                }
+                params.moldlineId = this.moldlineId
+                params.pdtModelId = -999
+                params.total = 0
+                params.default = null
+
+            } else {
+                //查询可替换绑定条码的产品
+                params.pdtGlueKind = this.formData.pdtGlueKind
+                params.pdtModelId = this.formData.repPdtModelId
+            }
+            params.currentPage = this.page
+            params.pageSize = this.page_size
             params.ftyId = this.$store.state.user.ftyId
-            params.pdtGlueKind = this.formData.pdtGlueKind
-            params.pdtModelId = this.formData.repPdtModelId
+            params.moldingBatch = this.formDataView.moldingBatch  //成型批次
+            params.uniqueCode = this.formDataView.uniqueCode  //成型编码
+            params.moldingDateStart = this.formDataView.formingDate //成型日期
+            params.moldingDateEnd = this.formDataView.formingDate
+            params.groupName = this.formDataView.groupName  //分组序号
             return params
         },
         /**
@@ -74,36 +153,44 @@ export default {
          *   @author : 于继渤
          */
         getData() {
+            this.pageLoading = true
             // 参数设置
             let params = this.setSearchParams()
-            this.excute(this.$service.moldingRecordItemService, this.$service.moldingRecordItemService.selectProductByBindBarcode, params)
+            //默认 查询可替换绑定条码的产品
+            let API = this.$service.moldingRecordItemService.selectProductByBindBarcode
+            if (this.key === 'add') {
+                //查询可添加绑定条码的产品
+                API = this.$service.moldingRecordItemService.selectProductCanBindBarcode
+            }
+            this.excute(this.$service.moldingRecordItemService, API, 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 = []
-                            });
-
+                        this.tableRowData = this.tableRowData.concat(res.data.list)
+                        if (this.page == 1) {
+                            this.pageTotal = Math.ceil(res.data.total / this.page_size);
                         }
-
+                        // loading为false,此时会根据列表滚动位置判断是否触发load事件(列表内容不足一屏幕时,会直接触发)
+                        this.pageLoading = false
+                        if (this.page >= this.pageTotal) {
+                            // 数据全部加载完成
+                            this.pageFinished = true;
+                        }
+                        this.tableRowData.length === 0 ? (this.finishedText = "暂无数据") : (this.finishedText = "没有更多了");
+                        this.page++
+                    } else {
+                        this.pageFinished = true;
+                        this.pageLoading = false;
                     }
                 })
         },
-
-
         /**
          * @desc   : 搜索事件
          * @author : 于继渤
          * @date   : 2023/2/7 17:23
          */
         onSearch(e) {
+            this.page = 1
             this.tableRowData = []
-
             //获取数据
             this.getData()
         },
@@ -113,11 +200,6 @@ export default {
          * @date   : 2023/2/7 17:23
          */
         onClickCheckbox(e) {
-            this.tableRowData.forEach(item => {
-                item.checked = false
-            })
-            this.tableRowData[e.index].checked = true
-
         },
 
         /**
@@ -127,44 +209,64 @@ export default {
          */
         save() {
             let obj = {}
+            //处理数据
             this.tableRowData.forEach(res => {
                 if (res.checked) {
                     obj = res
                 }
             })
-            if (!obj) {
+
+            let tableRowDataTemp = this.tableRowData.filter(res => {
+                return res.checked
+            })
+            //校验是否选择数据
+            if (tableRowDataTemp.length == 0) {
                 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
+            if (this.tableList.bomItems.filter(it => it.pdtModelId == obj.pdtModelId && it.moldlineId == obj.moldlineId && it.moldlineItemNo == obj.moldlineItemNo).length == 0) {
+                if (this.key !== 'add') {
+                    //替换明细
+                    this.checkDetailByBindBarCode(obj)
+                }
             } else {
+                //重复数据,提示错误
                 this.appToastFail(this.$t('W_141'))
                 return
             }
-
+            let tempObj = {}
+            if (this.key === 'add') {
+                //新添明细
+                obj['moldingItemId'] = obj.itemId
+                tempObj = {
+                    key: 'add',
+                    children: obj,
+                    parentIndex: this.parentIndex
+                }
+            } else {
+                //替换明细
+                tempObj = {
+                    key: '',
+                    children: this.children,
+                    parentIndex: this.parentIndex
+                }
+            }
             //存缓存
-            localStorage.setItem("app-product-select-replace-data", JSON.stringify({
-                children:this.children,
-                parentIndex:this.parentIndex
-            }))
+            localStorage.setItem("app-product-select-replace-data", JSON.stringify(tempObj))
+            //返回
             this.$router.go(-1)
         },
 
 
-
+        /**
+         * @desc   : 处理数据
+         * @author : 于继渤
+         * @date   : 2023/2/14 9:35
+         */
         checkDetailByBindBarCode(row) {
-
             let children = this.tableList.bomItems
-
-     
             for (let i in children) {
                 //找到明细中需要替换的数据
                 if (children[i].id == this.formData.id) {
@@ -211,8 +313,6 @@ export default {
     },
 
     mounted() {
-        // 因为是封装的组件所以是两层
-        // this.$refs.moldLineCode.$refs.input.focus()
         // 设置滚动的位置和高度
         this.setAppTableHeight()
     },
@@ -223,9 +323,14 @@ export default {
      */
     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.formData = this.$route.params.item //上一页选择的数据对象
+            this.key = this.$route.params.key //上一页选择的操作类型   替换/新添  (key:add)
+            if (this.$route.params.key && this.$route.params.key === 'add') {
+                this.moldlineId = this.$route.params.moldlineId  //设置成型线id
+                this.title = this.$t('appProductSelectAddReplaceTitle') //设置标题
+            }
+            this.parentIndex = this.$route.params.parentIndex  //上一页选择的数据位置索引
+            this.tableList = this.$route.params.tableList  //上一页选择的数据
             this.onSearch()
         }
 

+ 1 - 0
src/view/mst/carr-kiln-car/index.vue

@@ -446,6 +446,7 @@ export default {
         if (res.code === this.$config.SUCCESS_CODE) {
           this.tableData = res.data
           //this.searchContent[1].valueFormat.data = res.data;
+          this.loading = false
         }
       })
     },

+ 2 - 2
src/view/mst/dictionary/index.vue

@@ -229,7 +229,7 @@ export default {
         remarks: ''
       }
       // 加载最大序号
-      this.getMaxDisplayNo(this.$config.displayNoTable.dictionaryData, this.dictCodeType);
+      this.getMaxDisplayNo(this.$config.displayNoTable.dictionaryData, {otherCond: 'dict_code = \''+this.dictCodeType+'\''});
     },
     /**
      *   @desc   : 给参数赋值
@@ -270,7 +270,7 @@ export default {
     initData(type) {
       if (type === this.$config.formMode.add) {
         // 加载最大序号
-        this.getMaxDisplayNo(this.$config.displayNoTable.dictionaryData, {dictCode: this.dictCodeType});
+        this.getMaxDisplayNo(this.$config.displayNoTable.dictionaryData, {otherCond: 'dict_code = \''+this.dictCodeType+'\''});
       }
     },
     /**

+ 2 - 2
src/view/mst/label-print-layout/index.vue

@@ -221,7 +221,7 @@ export default {
         remarks: ''
       }
       // 加载最大序号
-      this.getMaxDisplayNo(this.$config.displayNoTable.labelPrinterLayout);
+      this.getMaxDisplayNo(this.$config.displayNoTable.labelPrinterLayout, {otherCond: 'label_kind = \''+this.labelKind+'\''});
     },
     /**
      *   @desc   : 给参数赋值
@@ -278,7 +278,7 @@ export default {
     initData(type) {
       if (type === this.$config.formMode.add || type === this.$config.formMode.edit) {
         // 加载最大序号
-        this.getMaxDisplayNo(this.$config.displayNoTable.labelPrinterLayout);
+        this.getMaxDisplayNo(this.$config.displayNoTable.labelPrinterLayout, {otherCond: 'label_kind = \''+this.labelKind+'\''});
         // 获取打印模板分类
         this.getPrintTypeData();
       }

+ 2 - 2
src/view/mst/product-defect/index.vue

@@ -229,7 +229,7 @@ export default {
         remarks: ''
       }
       // 加载最大序号
-      this.getMaxDisplayNo(this.$config.displayNoTable.productDefect);
+      this.getMaxDisplayNo(this.$config.displayNoTable.productDefect, {otherCond: 'defect_kind = \''+this.defectKind+'\''});
     },
     /**
      *   @desc   : 给参数赋值
@@ -270,7 +270,7 @@ export default {
     initData(type) {
       if (type === this.$config.formMode.add) {
         // 加载最大序号
-        this.getMaxDisplayNo(this.$config.displayNoTable.productDefect);
+        this.getMaxDisplayNo(this.$config.displayNoTable.productDefect, {otherCond: 'defect_kind = \''+this.defectKind+'\''});
       }
       if (type === this.$config.formMode.add || type === this.$config.formMode.edit) {
         this.getDefectTypeList();   // 加载缺陷分类数据

+ 56 - 65
src/view/report/kiln-car-status-report/index.vue

@@ -1,6 +1,5 @@
 <!-- @desc:窑车状态表  @auth:王英杰  @time:2023/3/4 19:31 -->
 <template>
-
   <div class="main-div" ref="mainDiv">
     <!--加载中-->
     <loading :loading="loading"></loading>
@@ -37,78 +36,73 @@
           <!-- 窑炉类型 -->
           <DkTableColumn field="kilnType"></DkTableColumn>
           <!-- 窑车编码 -->
-          <DkTableColumn field="carCode"  ></DkTableColumn>
+          <DkTableColumn field="carCode"></DkTableColumn>
           <!-- 当前工序 -->
-          <DkTableColumn field="currentNode" ></DkTableColumn>
+          <DkTableColumn field="currentNode"></DkTableColumn>
           <!-- 最大产品数量 -->
-          <DkTableColumn field="maxProductNum" ></DkTableColumn>
-
+          <DkTableColumn field="maxProductNum"></DkTableColumn>
         </DkTable>
 
         <!--明细-->
         <div slot="bottom">
-          <DkTabs v-model="detailModel" :options="detailOptions" @on-click="detailTabsClick"> </DkTabs>
-            <!--生产数据-->
-              <DkTable v-show ="detailModel===this.$config.KilnCarStatusText.productionData" :pageFlag="true" multiple primaryKey="itemId"
-                       :id="'table-'+$options.name"
-                       :height="this.tableHeight * (1-split) - 15"
-                       ref="not-counted-select"
-                       name="notCountedTable"
-                       :choose-flag="false"
-                       :data="productionDataData">
-                <!-- 当前工序-->
-                <DkTableColumn field="currentNode" width="180px"></DkTableColumn>
-                <!-- 开始时间-->
-                <DkTableColumn field="startTime"></DkTableColumn>
-                <!-- 生产工号-->
-                <DkTableColumn field="makeUserId"></DkTableColumn>
-                <!-- 操作者-->
-                <DkTableColumn field="opnUserName"></DkTableColumn>
-                <!-- 操作说明-->
-                <DkTableColumn field="operatingInstructions"></DkTableColumn>
-              </DkTable>
-
-            <!--窑车产品-->
-              <DkTable  v-show ="detailModel===this.$config.KilnCarStatusText.KilnCarProducts" :pageFlag="true" multiple primaryKey="itemId"
-
-                       :id="'table-'+$options.name"
-                       :height="this.tableHeight * (1-split) - 15"
-                       ref="counted-select"
-                       name="countedTable"
-                       :choose-flag="false"
-                       :data="kilnCarProductsData">
-                <!-- 产品条码-->
-                <DkTableColumn field="pdtBarcode"></DkTableColumn>
-                <!-- 产品编码-->
-                <DkTableColumn field="productCode"></DkTableColumn>
-                <!-- 窑车位置-->
-                <DkTableColumn field="kilnCarPlace"></DkTableColumn>
-                <!-- 生产工号-->
-                <DkTableColumn field="prodUserCode"></DkTableColumn>
-                <!-- 员工姓名-->
-                <DkTableColumn field="staffNames"></DkTableColumn>
-                <!-- 操作时间-->
-                <DkTableColumn field="operationTime"></DkTableColumn>
-                <!-- 操作者-->
-                <DkTableColumn field="opnUserName"></DkTableColumn>
-              </DkTable>
-
-
+          <DkTabs v-model="detailModel" :options="detailOptions" @on-click="detailTabsClick"></DkTabs>
+          <!--生产数据-->
+          <DkTable v-show="detailModel===this.$config.KilnCarStatusText.productionData" :pageFlag="true" multiple
+                   primaryKey="itemId"
+                   :id="'table-'+$options.name"
+                   :height="this.tableHeight * (1-split) - 15"
+                   ref="not-counted-select"
+                   name="notCountedTable"
+                   :choose-flag="false"
+                   :data="productionDataData">
+            <!-- 当前工序-->
+            <DkTableColumn field="currentNode" width="180px"></DkTableColumn>
+            <!-- 开始时间-->
+            <DkTableColumn field="startTime"></DkTableColumn>
+            <!-- 生产工号-->
+            <DkTableColumn field="makeUserId"></DkTableColumn>
+            <!-- 操作者-->
+            <DkTableColumn field="opnUserName"></DkTableColumn>
+            <!-- 操作说明-->
+            <DkTableColumn field="operatingInstructions"></DkTableColumn>
+          </DkTable>
+
+          <!--窑车产品-->
+          <DkTable v-show="detailModel===this.$config.KilnCarStatusText.KilnCarProducts" :pageFlag="true" multiple
+                   primaryKey="itemId"
+                   :id="'table-'+$options.name"
+                   :height="this.tableHeight * (1-split) - 15"
+                   ref="counted-select"
+                   name="countedTable"
+                   :choose-flag="false"
+                   :data="kilnCarProductsData">
+            <!-- 产品条码-->
+            <DkTableColumn field="pdtBarcode"></DkTableColumn>
+            <!-- 产品编码-->
+            <DkTableColumn field="productCode"></DkTableColumn>
+            <!-- 窑车位置-->
+            <DkTableColumn field="kilnCarPlace"></DkTableColumn>
+            <!-- 生产工号-->
+            <DkTableColumn field="prodUserCode"></DkTableColumn>
+            <!-- 员工姓名-->
+            <DkTableColumn field="staffNames"></DkTableColumn>
+            <!-- 操作时间-->
+            <DkTableColumn field="operationTime"></DkTableColumn>
+            <!-- 操作者-->
+            <DkTableColumn field="opnUserName"></DkTableColumn>
+          </DkTable>
         </div>
       </DkSplit>
     </div>
-
   </div>
 </template>
 
 <script>
 import {indexMixin} from "@/mixins";
-import PrintModal from "_c/business/print/modal.vue";
 
 export default {
   name: "kiln-car-status-report",
   mixins: [indexMixin],
-  components: {PrintModal},
   data() {
     let self = this
     return {
@@ -129,8 +123,8 @@ export default {
       //明细tab默认
       detailModel: self.$config.KilnCarStatusText.productionData,
       //明细tab可选
-      detailOptions: [{label: self.$t('productionData'), name:  self.$config.KilnCarStatusText.productionData}, //生产数据
-        {label: self.$t('KilnCarProducts'), name:  self.$config.KilnCarStatusText.KilnCarProducts},//窑车产品
+      detailOptions: [{label: self.$t('productionData'), name: self.$config.KilnCarStatusText.productionData}, //生产数据
+        {label: self.$t('KilnCarProducts'), name: self.$config.KilnCarStatusText.KilnCarProducts},//窑车产品
       ],
       checkId: null,//总单id
     }
@@ -145,10 +139,8 @@ export default {
       if (row != null) {
         this.checkId = row.checkId
         if (this.tableData && this.tableData.length > 0) {
-          // this.getDetail(1)
           this.getCarrierFlow(row.carrierId)
           this.getProduction(row.carrierId)
-
         }
       }
     },
@@ -162,15 +154,14 @@ export default {
         this.detailModel = val
       }
     },
-
     /**
      * @desc   : 查询总单 item对应的 窑车产品
      * @author : 王英杰
      * @date   : 2023/4/28 16:42
      */
     getCarrierFlow(carrierId) {
-
-      this.excute(this.$service.reportCarrieFlowService, this.$service.reportCarrieFlowService.selectCarrierFlow, {"carrierId": carrierId}).then(res => {
+      this.excute(this.$service.reportCarrieFlowService, this.$service.reportCarrieFlowService.selectCarrierFlow,
+        {carrierId: carrierId}).then(res => {
         if (res.code === this.$config.SUCCESS_CODE) {
           this.kilnCarProductsData = res.data
         }
@@ -182,7 +173,8 @@ export default {
      * @date   : 2023/4/28 16:42
      */
     getProduction(carrierId) {
-      this.excute(this.$service.reportCarrieFlowService, this.$service.reportCarrieFlowService.selectProduction, {"carrierId": carrierId}).then(res => {
+      this.excute(this.$service.reportCarrieFlowService, this.$service.reportCarrieFlowService.selectProduction,
+        {carrierId: carrierId}).then(res => {
         if (res.code === this.$config.SUCCESS_CODE) {
           this.productionDataData = res.data
         }
@@ -209,8 +201,7 @@ export default {
         if (res.code === this.$config.SUCCESS_CODE) {
           let list = this.searchContent.filter(it => it.valueFormat.code == 'kilnIds')
           if (list.length > 0) {
-           list[0].valueFormat.data = res.data
-
+            list[0].valueFormat.data = res.data
           }
         }
       })