Procházet zdrojové kódy

优化修改建议

gongwencan před 2 měsíci
rodič
revize
8e90efefbb

+ 2 - 1
src/api/TagDistributeApi.js

@@ -11,7 +11,8 @@ class TagDistributeApi extends BaseCurdApi {
     data: {
       id: data.id,
       deliveryMethodId: data.deliveryMethodId,
-      deliveryOrderNo: data.deliveryOrderNo
+      deliveryOrderNo: data.deliveryOrderNo,
+      recipient: data.recipient
     }
   })
 }

+ 0 - 14
src/components/DialogTagCodeSerialDetail.vue

@@ -79,20 +79,6 @@
             min-width="70"
             align="center"
           ></el-table-column>
-          <el-table-column
-            label="单价(元)"
-            prop="unitPrice"
-            header-align="right"
-            min-width="70"
-            align="right"
-          ></el-table-column>
-          <el-table-column
-            label="费用(元)"
-            prop="amount"
-            header-align="right"
-            min-width="70"
-            align="right"
-          ></el-table-column>
         </el-table>
       </div>
     </div>

+ 5 - 2
src/components/DialogTagDistribute.vue

@@ -27,8 +27,11 @@
             </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="发货单号" prop="deliveryOrderNo" :rules= "(data.deliveryMethodId === '1') ? []:[{required:true,message:'请输入发货单号'}]">
-            <el-input v-model="data.deliveryOrderNo" :disabled="(data.deliveryMethodId === '1') || (data.tagApplyStateId === '6')"/>
+          <el-form-item v-if="data.deliveryMethodId === '1'" label="提货人姓名" prop="recipient" :rules= "[{required:true,message:'请输入提货人姓名'}]">
+            <el-input v-model="data.recipient" :disabled="data.tagApplyStateId === '6'"/>
+          </el-form-item>
+          <el-form-item v-else label="发货单号" prop="deliveryOrderNo" :rules= "[{required:true,message:'请输入发货单号'}]">
+            <el-input v-model="data.deliveryOrderNo" :disabled="data.tagApplyStateId === '6'"/>
           </el-form-item>
         </el-col>
         </el-row>

+ 22 - 2
src/components/DialogTagPurchaseDetail.vue

@@ -15,6 +15,7 @@
           class="custom-plain-button"
           @click="onAddTagBtnClick"
           :disabled="oData && oData.tagPurchaseStateId !='0'"
+          v-if="!hideAddButton"
         >添加采购</el-button>
         <el-button
           plain
@@ -116,7 +117,7 @@
       </template>
       <dialog-add-tag-purchase
       ref="addTagPurchaseDialog"
-      :optionGroup="optionGroup1"
+      :optionGroup="{ TagType: { list: filteredTagTypes } }"
       @saved="loadTag"
     ></dialog-add-tag-purchase>
     </el-dialog>
@@ -145,6 +146,22 @@ export default {
     visible: false,
     oData: null
   }),
+  computed: {
+    hideAddButton () {
+      const listTagTypes = new Set(this.list.map(item => item.tagTypeId))
+      const optionGroupTagTypes = new Set(this.optionGroup1.TagType.list.map(item => item.id))
+      return listTagTypes.size === optionGroupTagTypes.size
+    },
+    filteredTagTypes () {
+      if (this.list.length <= 0) {
+        return null
+      }
+      const listTagTypes = this.list ? new Set(this.list.map(item => item.tagTypeId)) : []
+      const optionGroupTagTypes = this.optionGroup1.TagType.list.filter(tagType => !listTagTypes.has(tagType.id))
+      // console.log({ TagType: { list: optionGroupTagTypes } })
+      return optionGroupTagTypes || []
+    }
+  },
   methods: {
     open (data) {
       this.oData = data
@@ -209,7 +226,10 @@ export default {
       this.selectedData.amount = sanitizedValue === '' ? 0 : (sanitizedValue * this.selectedData.unitPrice).toFixed(2)
     },
     onAddTagBtnClick () {
-      this.$refs.addTagPurchaseDialog.open({tagTypeId: '1', number: 0})
+      const firstTagType = this.filteredTagTypes[0]
+      if (firstTagType) {
+        this.$refs.addTagPurchaseDialog.open({ tagTypeId: firstTagType.id, number: 0 })
+      }
     },
     loadTag (data) {
       if (data.number > 0) {

+ 42 - 28
src/components/DialogTagPurchaseOrderExport.vue

@@ -27,7 +27,7 @@
               <th><div class="cell">采购日期</div></th>
               <th><div class="cell">采购人员</div></th>
               <th><div class="cell">标签类型</div></th>
-              <th><div class="cell">需采购数量(个)</div></th>
+              <th><div class="cell">采购数量(张)</div></th>
               <th><div class="cell">总价(元)</div></th>
             </tr>
           </thead>
@@ -41,10 +41,7 @@
               <td align="center"><div class="cell">{{ item.amount}}</div></td>
             </tr>
             <tr>
-              <td align="center"><div class="cell">总计</div></td>
-              <td><div class="cell"></div></td>
-              <td><div class="cell"></div></td>
-              <td><div class="cell"></div></td>
+              <td align="center" colspan="4"><div class="cell">总计</div></td>
               <td align="center"><div class="cell">{{number}}</div></td>
               <td align="center"><div class="cell">{{amount}}</div></td>
             </tr>
@@ -52,30 +49,27 @@
         </table>
       </div>
       <div class="flex-1 fit-size order-table-footer" style="padding:0 40px;">
-        <label>制单人:</label>
-        <div></div>
-
-        <label>日期:</label>
-        <div></div>
-
-        <label>需求单位物资部门(签章):</label>
-        <div></div>
-
-        <label>日期:</label>
-        <div></div>
-
+        <div class="flex">
+          <div class="flex-item">
+            <label>制单人:</label>
+            <div>{{ data.buyerName }}</div>
+          </div>
+        <div class="flex-item">
         <label>签收人:</label>
         <div></div>
-
-        <label>日期:</label>
-        <div></div>
-
-        <label>现场交接人:</label>
-        <div></div>
-
-        <label>日期:</label>
-        <div></div>
       </div>
+    </div>
+    <div class="flex">
+    <div class="flex-item">
+      <label>日期:</label>
+      <div>{{ formatDate(data.dataTime) }}</div>
+    </div>
+    <div class="flex-item">
+      <label>日期:</label>
+      <div>{{ formatDate(data.dataTime) }}</div>
+    </div>
+  </div>
+</div>
     </pdf-exporter>
 
     <template #footer>
@@ -161,6 +155,10 @@ export default {
     },
     delay (ms) {
       return new Promise(resolve => setTimeout(resolve, ms))
+    },
+    formatDate (date) {
+      if (!date) return ''
+      return new Date(date).format('yyyy-MM-dd')
     }
   }
 }
@@ -168,7 +166,23 @@ export default {
 
 <style lang="scss">
 .order-table-footer {
-  display: grid;
-  grid-template-columns: repeat(4, max-content auto);
+  display: flex;
+  flex-direction: column;
+}
+
+.order-table-footer .flex {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 80px; /* Adjust as needed */
+}
+
+.order-table-footer .flex-item {
+  flex: 1;
+  display: flex;
+  align-items: center;
+}
+
+.order-table-footer .flex-item label {
+  margin-right: 10px; /* Adjust as needed */
 }
 </style>

+ 1 - 1
src/entries/TagApply.js

@@ -98,7 +98,7 @@ export default class TagApply extends BaseCurdEntry {
   static $$optionTargetConfigGroup = [
     [{
       Target: TagApplyState,
-      getQuery: () => ({}),
+      getQuery: () => ({type: 1}),
       setQuery: (options, query, Target) => {
         const [ option ] = options
         if (option) {

+ 22 - 1
src/entries/TagCode.js

@@ -2,6 +2,7 @@ import BaseCurdEntry from './BaseCurdEntry'
 
 import tagCodeApi from '@@/api/TagCodeApi'
 import TagApplyState from './TagApplyState'
+import Provider from './Provider'
 
 export default class TagCode extends BaseCurdEntry {
   orderNo
@@ -43,13 +44,33 @@ export default class TagCode extends BaseCurdEntry {
     return 'TagCode'
   }
 
+  static $$getQuery = () => ({
+    providerId: '',
+    tagApplyStateId: ''
+  })
+
   static get $$api () {
     return tagCodeApi
   }
 
   static $$optionTargetConfigGroup = [
     [{
-      Target: TagApplyState
+      Target: TagApplyState,
+      getQuery: () => ({type: 2}),
+      setQuery: (options, query, Target) => {
+        const [ option ] = options
+        if (option) {
+          query.tagApplyStateId = option[Target.$$idProp]
+        }
+      }
+    }, {
+      Target: Provider,
+      setQuery: (options, query, Target) => {
+        const [ option ] = options
+        if (option) {
+          query.providerId = option[Target.$$idProp]
+        }
+      }
     }]
   ]
   static $$optionData = {}

+ 15 - 2
src/entries/TagDistribute.js

@@ -71,15 +71,28 @@ export default class TagDistribute extends BaseCurdEntry {
 
   static $$getQuery = () => ({
     tagApplyStateId: '',
+    providerId: '',
     order: [['dataTime', 'DESC']]
   })
 
   static $$optionTargetConfigGroup = [
     [{
       Target: TagApplyState,
-      getQuery: () => ({})
+      getQuery: () => ({type: 8}),
+      setQuery: (options, query, Target) => {
+        const [ option ] = options
+        if (option) {
+          query.tagApplyStateId = option[Target.$$idProp]
+        }
+      }
     }, {
-      Target: Provider
+      Target: Provider,
+      setQuery: (options, query, Target) => {
+        const [ option ] = options
+        if (option) {
+          query.providerId = option[Target.$$idProp]
+        }
+      }
     }, {
       Target: DeliveryType
     }]

+ 4 - 4
src/views/MaterialTag.vue

@@ -47,7 +47,7 @@
                 fixed
               ></el-table-column>
               <el-table-column
-                label="商品Id"
+                label="商品编码"
                 prop="goodsCode"
                 align="center"
                 min-width="100"
@@ -62,15 +62,15 @@
                 align="center"
               ></el-table-column>
               <el-table-column
-                label="物料名称"
-                prop="name"
+                label="物料描述"
+                prop="materielDescribe"
                 min-width="150"
                 header-align="left"
                 align="left"
               ></el-table-column>
               <el-table-column
                 label="商品名称"
-                prop="providerName"
+                prop="goodsName"
                 min-width="150"
                 header-align="left"
                 align="left"

+ 1 - 1
src/views/TagApply.vue

@@ -19,7 +19,7 @@
               :options="optionGroup.Provider ? optionGroup.Provider.list : []"
               filterable
               clearable
-              placeholder="输入供应商全名或缩写"
+              placeholder="输入供应商"
             ></my-select>
           </el-form-item>
         </el-col>

+ 76 - 4
src/views/TagCode.vue

@@ -5,7 +5,67 @@
       class="z-card flex column flex-1 fit-size"
     >
       <div class="wrapper flex column layout-gap">
-        <div class="flex valign-center">
+        <!-- <div class="flex valign-center">
+          <el-button
+           :disabled="selectedList.length === 0"
+            plain
+            icon="el-icon-plus"
+            type="primary"
+            size="small"
+            class="custom-plain-button"
+            @click="onCodeBtnClick"
+          >赋码</el-button>
+
+          <el-button
+            :disabled="selectedList.length === 0"
+            plain
+            type="primary"
+            size="small"
+            class="custom-plain-button"
+            @click="onBatchPrintBtnClick"
+          >
+            <div class="flex center" style="height:1em">
+              <svg
+                viewBox="0 0 1024 1024"
+                version="1.1"
+                xmlns="http://www.w3.org/2000/svg"
+                width="14"
+                height="14"
+              >
+                <path d="M928 288H96v384h160v224h512V672h160zM704 832H320V544h384z m160-224h-96v-128H256v128h-96V352h704zM320 192h384v64h64V128H256v128h64v-64z" fill="currentColor"></path>
+                <path d="M384 608h256v64H384zM384 704h256v64H384z" fill="currentColor"></path>
+                <path d="M800 416m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z" fill="currentColor"></path>
+              </svg>
+              <span style="margin-left:5px;">批量打印</span>
+            </div>
+          </el-button>
+        </div> -->
+        <el-form label-width="80px">
+          <el-row :gutter="$$Constant.LAYOUT_GAP">
+          <el-col :span="8">
+            <el-form-item label="供应商">
+              <my-select
+                v-model="query.providerId"
+                :options="optionGroup.Provider ? optionGroup.Provider.list : []"
+                filterable
+                clearable
+                placeholder="输入供应商"
+              ></my-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="状态">
+            <my-select
+              v-model="query.tagApplyStateId"
+              :options="optionGroup.TagApplyState ? optionGroup.TagApplyState.list : []"
+            >
+            </my-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <div class="flex valign-right" style="justify-content: flex-end;">
+          <el-button type="primary" class="filter-button" @click="onSearchBtnClick">查询</el-button>
           <el-button
            :disabled="selectedList.length === 0"
             plain
@@ -40,6 +100,9 @@
             </div>
           </el-button>
         </div>
+          </el-col>
+      </el-row>
+    </el-form>
 
         <div class="flex-1 fit-size">
           <el-table
@@ -198,11 +261,20 @@ export default {
         .filter(data => data.tagApplyStateId === '2')
         .map(data => data[$$idProp])
 
-      this.$$request(this.$$api.setCode, ids).then((flag) => {
-        if (flag) {
+      if (!Array.isArray(ids) || ids.length === 0) {
+        this.$notify.error({
+          title: '失败',
+          message: '所有订单都已赋码,无需重复操作!',
+          position: 'bottom-right'
+        })
+        return
+      }
+
+      this.$$request(this.$$api.setCode, ids).then((data) => {
+        if (data && typeof data === 'number') {
           this.$notify({
             title: '成功',
-            message: '操作成功',
+            message: `已成功赋码 ${data}个`,
             type: 'success',
             position: 'bottom-right'
           })

+ 19 - 2
src/views/TagDistribute.vue

@@ -9,11 +9,21 @@
                         v-model="query.tagApplyStateId"
                         :options="optionGroup.TagApplyState ? optionGroup.TagApplyState.list : []"
                     >
-              <el-option label="全部" value=""></el-option>
             </my-select>
           </el-form-item>
             </el-col>
-            <el-col :span="16" class="text-right">
+            <el-col :span="8">
+            <el-form-item label="供应商">
+              <my-select
+                v-model="query.providerId"
+                :options="optionGroup.Provider ? optionGroup.Provider.list : []"
+                filterable
+                clearable
+                placeholder="输入供应商"
+              ></my-select>
+          </el-form-item>
+        </el-col>
+            <el-col :span="8" class="text-right">
               <el-button
                 plain
                 class="filter-button"
@@ -109,6 +119,13 @@
                 min-width="120"
                 header-align="center"
               ></el-table-column>
+              <el-table-column
+                label="提货人姓名"
+                prop="recipient"
+                align="center"
+                min-width="100"
+                header-align="center"
+              ></el-table-column>
               <el-table-column
                 label="操作员"
                 prop="operatorName"