Sfoglia il codice sorgente

库存表格组件优化:替换el-button为el-link提升交互体验,清理调试代码,调整表单元素类型和显示逻辑

yusheng 9 mesi fa
parent
commit
ff0f152e09

+ 1 - 0
src/BIZComponents/inventoryTable.vue

@@ -270,6 +270,7 @@
               dictName="质保期单位"
               clearable
               v-model="scope.row.guaranteePeriodUnitCode"
+              
               @change="
                 setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
               "

+ 1 - 1
src/components/Dict/DictSelection.vue

@@ -85,7 +85,7 @@
     },
     created() {
       if (this.dictName&&this.isOne) {
-        console.log(this.dictName,'this.dictName')
+        
         this.requestDict(this.dictName);
       }
     },

+ 63 - 141
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -29,46 +29,68 @@
       </template>
 
       <template v-slot:requirementTotalCount="{ row, $index }">
-        <el-button type="text" @click="handleGetBillDetail(row, 1)">{{
-          row.purchaseCount
-        }}</el-button>
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="handleGetBillDetail(row, 1)"
+        >
+          {{ row.purchaseCount }}
+        </el-link>
       </template>
       <template v-slot:planTotalCount="{ row, $index }">
-        <el-button type="text" @click="handleGetBillDetail(row, 2)">{{
-          row.planTotalCount
-        }}</el-button>
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="handleGetBillDetail(row, 2)"
+        >
+          {{ row.planTotalCount }}
+        </el-link>
       </template>
       <template v-slot:inquiryTotalCount="{ row, $index }">
-        <el-button type="text" @click="handleGetBillDetail(row, 3)">{{
-          row.inquiryTotalCount
-        }}</el-button>
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="handleGetBillDetail(row, 3)"
+        >
+          {{ row.inquiryTotalCount }}
+        </el-link>
       </template>
       <template v-slot:contractTotalCount="{ row, $index }">
-        <el-button type="text" @click="handleGetBillDetail(row, 4)">{{
-          row.contractTotalCount
-        }}</el-button>
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="handleGetBillDetail(row, 4)"
+        >
+          {{ row.contractTotalCount }}
+        </el-link>
       </template>
       <template v-slot:doneTotalCount="{ row, $index }">
-        <el-button type="text" @click="handleGetBillDetail(row, 5)">{{
-          row.doneTotalCount
-        }}</el-button>
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="handleGetBillDetail(row, 5)"
+        >
+          {{ row.doneTotalCount }}
+        </el-link>
       </template>
       <template v-slot:waitTotalCount="{ row, $index }">
-        <el-button type="text" @click="handleGetBillDetail(row, 6)">{{
-          row.waitTotalCount
-        }}</el-button>
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="handleGetBillDetail(row, 6)"
+        >
+          {{ row.waitTotalCount }}
+        </el-link>
       </template>
       <template v-slot:taskName="scope">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.taskName'"
         >
-          <el-input
-            v-model="scope.row.taskName"
-            placeholder="请选择"
-            style="width: 60%; margin-right: 10px"
-            disabled
-          ></el-input>
+
+          <span>
+            {{ scope.row.taskName }}
+          </span>
           <el-button
             v-if="scope.row.productCode"
             size="small"
@@ -79,41 +101,12 @@
         </el-form-item>
       </template>
       <template v-slot:productName="{ row, $index }">
-        <span @click.native="handParent(row, $index)">
+        <div @click="handParent(row, $index)">
           {{ row.productName }}
-        </span>
-        <!-- <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + $index + '.productName'"
-          :rules="{
-            required: true,
-            message: '请输入',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="row.productName"
-            placeholder="请输入"
-            @click.native="handParent(row, $index)"
-          ></el-input>
-        </el-form-item> -->
+        </div>
+     
       </template>
-      <!-- <template v-slot:productCode="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.productCode'"
-        >
-          <el-input v-model="scope.row.productCode" disabled></el-input>
-        </el-form-item>
-      </template> -->
-      <!-- <template v-slot:productCategoryName="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.productCategoryName'"
-        >
-          <el-input v-model="scope.row.productCategoryName" disabled></el-input>
-        </el-form-item>
-      </template> -->
+    
       <template v-slot:taxRate="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -124,24 +117,7 @@
           </el-input>
         </el-form-item>
       </template>
-      <!-- <template v-slot:totalCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.totalCount'"
-          :rules="{
-            required: true,
-            message: '请输入',
-            trigger: 'blur'
-          }"
-        >
-          <el-input
-            v-model="scope.row.totalCount"
-            placeholder="请输入"
-            @input="changeCount(scope.row, scope.$index)"
-            type="number"
-          ></el-input>
-        </el-form-item>
-      </template> -->
+   
       <template v-slot:totalPrice="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -151,23 +127,7 @@
         </el-form-item>
       </template>
 
-      <!-- <template v-slot:productBrand="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.productBrand'"
-        >
-          <el-input v-model="scope.row.productBrand" disabled></el-input>
-        </el-form-item>
-      </template> -->
-
-      <!-- <template v-slot:modelType="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.modelType'"
-        >
-          <el-input v-model="scope.row.modelType" disabled></el-input>
-        </el-form-item>
-      </template> -->
+     
       <template v-slot:specification="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -176,23 +136,7 @@
           <el-input v-model="scope.row.specification"></el-input>
         </el-form-item>
       </template>
-      <!-- <template v-slot:deliveryDays="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.deliveryDays'"
-          :rules="{
-            pattern: numberReg,
-            message: '请输入数字',
-            trigger: 'blur'
-          }"
-        >
-          <el-input
-            v-model="scope.row.deliveryDays"
-            @change="setDeliveryDays(scope.row, scope.$index, 'deliveryDays')"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </template> -->
+      
       <template v-slot:guaranteePeriod="scope">
         <div class="period">
           <div class="borderleftnone">
@@ -219,6 +163,7 @@
               dictName="质保期单位"
               clearable
               v-model="scope.row.guaranteePeriodUnitCode"
+              :isOne="scope.$index === 0"
               @change="
                 setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
               "
@@ -227,7 +172,6 @@
           </div>
         </div>
       </template>
-      <!-- <template v-slot:guaranteePeriodUnitCode="scope"> </template> -->
       <template v-slot:measuringUnit="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -259,18 +203,11 @@
           :prop="'datasource.' + scope.$index + '.singlePrice'"
           :rules="{
             required: true,
-            pattern: numberReg,
             message: '请输入正确的单价',
             trigger: 'change'
           }"
         >
-          <!-- <el-input
-            v-model="scope.row.singlePrice"
-            placeholder="请输入"
-            @input="changeCount(scope.row, scope.$index)"
-          >
-            <template slot="append">元</template>
-          </el-input> -->
+         
           <el-popover
             placement="right"
             width="600"
@@ -296,6 +233,7 @@
             <el-input
               slot="reference"
               v-model="scope.row.singlePrice"
+              type="number"
               placeholder="请输入"
               @input="changeCount(scope.row, scope.$index)"
             >
@@ -310,6 +248,7 @@
             dictName="商品价格类型"
             clearable
             v-model="row.goodsPriceType"
+            :isOne="$index === 0"
             @change="goodsPriceTypeChange(row, $index)"
           >
           </DictSelection>
@@ -423,6 +362,7 @@
             clearable
             v-model="scope.row.provenance"
             multiple
+            :isOne="scope.$index === 0"
           >
           </DictSelection>
         </el-form-item>
@@ -499,27 +439,7 @@
           </template>
         </el-popconfirm>
       </template>
-      <!-- <template v-slot:pricingWay="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '.pricingWay'"
-          :rules="{
-            required: true,
-            message: '请选择计价方式',
-            trigger: 'change'
-          }"
-        >
-          <el-select v-model="scope.row.pricingWay" placeholder="请选择">
-            <el-option
-              v-for="item in pricingWayList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-              @click.native="changeCount(scope.row, scope.$index)"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </template> -->
+      
       <template v-slot:headerPricingWay="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -623,7 +543,9 @@
       detailType: {
         default: 0
       },
-      cacheKeyUrl: 'eos-purchasingManage-purchaseOrder-inventoryTable'
+      cacheKeyUrl:{
+        default: 'eos-purchasingManage-purchaseOrder-inventoryTable'
+      }
     },
     components: {
       taskinstanceDialog,
@@ -1056,7 +978,7 @@
             showOverflowTooltip: true
           }
         ],
-        purchaseSinglePriceData:[]
+        purchaseSinglePriceData: []
       };
     },
     created() {

+ 11 - 77
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -10,7 +10,7 @@
       :cache-key="cacheKeyUrl"
       height="350"
       full-height="calc(100vh - 76px)"
-      show-summary
+      :show-summary="clientEnvironmentId == 4"
       :summary-method="getSummaries"
     >
       <!-- 表头工具栏 -->
@@ -32,7 +32,6 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="handParent()"
-            v-if="isShowAdd && needProduce == 4"
           >
             新增
           </el-button>
@@ -53,55 +52,6 @@
           />
         </el-form-item>
       </template>
-      <template v-slot:stockLedger="scope">
-        <el-form-item>
-          <el-popover
-            @hide="() => (selection = [])"
-            placement="right"
-            width="60%"
-            trigger="hover"
-          >
-            <ele-pro-table
-              :ref="'childrenTable' + scope.$index"
-              row-key="id"
-              max-height="300px"
-              :selection.sync="selection"
-              :needPage="false"
-              :columns="childrenColumns"
-              :datasource="scope.row.sendProductDetail"
-              cache-key="stockLedgerRoleTable"
-              class="time-form"
-            >
-              <!-- 表头工具栏 -->
-              <template v-slot:toolbar="childrenScope">
-                <div class="headbox">
-                  <el-button
-                    size="small"
-                    type="primary"
-                    icon="el-icon-plus"
-                    class="ele-btn-icon"
-                    @click="stockLedgerSelect(scope.row, scope.$index)"
-                  >
-                    选择
-                  </el-button>
-
-                  <el-button
-                    size="small"
-                    type="danger"
-                    icon="el-icon-delete"
-                    class="ele-btn-icon"
-                    :disabled="!selection.length"
-                    @click="stockLedgerRemove(scope.$index)"
-                  >
-                    删除
-                  </el-button>
-                </div>
-              </template>
-            </ele-pro-table>
-            <el-button type="text" slot="reference">明细</el-button>
-          </el-popover>
-        </el-form-item>
-      </template>
 
       <template v-slot:packagingStrength="scope">
         <el-form-item>
@@ -109,6 +59,7 @@
             dict-name="包装强度"
             @change="keyChange(scope.$index, scope.row, 'packagingStrength')"
             v-model="scope.row.extField.packagingStrength"
+            :isOne="scope.$index === 0"
           ></DictSelection>
         </el-form-item>
       </template>
@@ -118,21 +69,12 @@
             dict-name="包装密度"
             @change="keyChange(scope.$index, scope.row, 'packagingDensity')"
             v-model="scope.row.extField.packagingDensity"
+            :isOne="scope.$index === 0"
           ></DictSelection>
         </el-form-item>
       </template>
 
-      <!-- <template v-slot:totalCount="scope">
-        <el-form-item
-          :prop="'datasource.' + scope.$index + '.totalCount'"
-          :rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
-        >
-          <el-input
-            v-model="scope.row.totalCount"
-            @input="(val) => changeCount1(scope.row, scope.$index)"
-          ></el-input>
-        </el-form-item>
-      </template> -->
+
       <template v-slot:batchNo="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.batchNo'">
           <el-input v-model="scope.row.batchNo" v-no-chinese></el-input>
@@ -248,32 +190,20 @@
           </el-input>
         </el-form-item>
       </template>
-      <template v-slot:notaxSinglePrice="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.notaxSinglePrice'"
-        >
-          <el-input
-            v-model="scope.row.notaxSinglePrice"
-            placeholder="请输入"
-            type="number"
-          >
-            <template slot="append">元</template>
-          </el-input>
-        </el-form-item>
-      </template>
+
       <template v-slot:singleWeight="scope" v-if="needProduce == 4">
         <el-form-item
           style="margin-bottom: 20px"
           :rules="{
             required: false,
-            pattern: numberReg,
+
             trigger: 'change'
           }"
           :prop="'datasource.' + scope.$index + '.singleWeight'"
         >
           <el-input
             v-model="scope.row.singleWeight"
+            type="number"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -966,6 +896,10 @@
     },
     methods: {
       getSummaries(param) {
+        if (this.clientEnvironmentId != 4) {
+          return;
+        }
+
         return getSummaries(
           param,
           ['saleCount', 'blockCount', 'totalCount'],