gongwencan 1 місяць тому
батько
коміт
fb988c73cc

+ 20 - 0
src/api/PrintCodeApi.js

@@ -0,0 +1,20 @@
+import BaseCurdApi from './BaseCurdApi'
+
+class PrintCodeApi extends BaseCurdApi {
+  constructor () {
+    super('/print/code')
+  }
+
+  getPrintCode = (id) => this.api({
+    url: `${this.basePath}/list/${id}`,
+    method: 'GET'
+  })
+
+  rePrint = (data) => this.api({
+    url: `${this.basePath}/reprint/send`,
+    method: 'POST',
+    data
+  })
+}
+
+export default new PrintCodeApi()

+ 3 - 4
src/api/PrintQueueApi.js

@@ -16,10 +16,9 @@ class PrintQueueApi extends BaseCurdApi {
       method: 'POST'
     })
 
-    allContinuePrint = (data) => this.api({
-      url: `${this.basePath}/continue`,
-      method: 'POST',
-      data
+    allContinuePrint = () => this.api({
+      url: `${this.basePath}/continue/all`,
+      method: 'POST'
     })
 
     constructor () {

+ 2 - 2
src/components/DialogTagApplyDetail.vue

@@ -99,7 +99,7 @@
                     <el-input v-model="scope.row.number" :class="{ 'input-error': scope.row.number === '' }" maxlength="10" @input="handleInput" :disabled="oData.tagApplyStateId !='0'"></el-input>
                 </template>
             </el-table-column>
-            <el-table-column
+            <!-- <el-table-column
                 label="单价(元)"
                 prop="unitPrice"
                 align="right"
@@ -118,7 +118,7 @@
               >
               <template slot-scope="scope">
               {{ parseFloat(scope.row.amount).toFixed(2) }}
-              </template></el-table-column>
+              </template></el-table-column> -->
               <el-table-column
                 label="标签类型"
                 prop="tagTypeName"

+ 6 - 6
src/components/DialogTagApplyOrderExport.vue

@@ -30,9 +30,9 @@
               <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>
-              <th><div class="cell">小计(元)</div></th>
+              <!-- <th><div class="cell">小计(元)</div></th> -->
             </tr>
           </thead>
           <tbody>
@@ -41,14 +41,14 @@
               <td align="center"><div class="cell">{{ providerName }}</div></td>
               <td align="center"><div class="cell">{{ item.tagTypeName}}</div></td>
               <td align="center"><div class="cell">{{ formatDataTime }}</div></td>
-              <td align="center"><div class="cell">{{ item.unitPrice }}</div></td>
+              <!-- <td align="center"><div class="cell">{{ item.unitPrice }}</div></td> -->
               <td align="center"><div class="cell">{{ item.number }}</div></td>
-              <td align="center"><div class="cell">{{ formatAmount(item.amount) }}</div></td>
+              <!-- <td align="center"><div class="cell">{{ formatAmount(item.amount) }}</div></td> -->
             </tr>
             <tr>
-              <td align="center" colspan="5"><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>
+              <!-- <td align="center"><div class="cell">{{amount}}</div></td> -->
             </tr>
           </tbody>
         </table>

+ 136 - 0
src/components/DialogTagCodeDetail.vue

@@ -0,0 +1,136 @@
+<template>
+    <el-dialog
+      :visible.sync="visible"
+      title="标签详情"
+      append-to-body
+      width="1200px"
+      :close-on-click-modal="false"
+    >
+      <div class="flex column" style="padding-bottom:20px;height:600px">
+        <div class="flex valign-center">
+        <el-button
+          plain
+          type="primary"
+          size="small"
+          class="custom-plain-button"
+          @click="onRePrintBtnClick"
+          :disabled="selectedList.length === 0"
+        >重新打印</el-button>
+      </div>
+        <div class="flex-1 fit-size" style="padding-top:20px;">
+          <el-table
+            ref="table"
+            :data="data"
+            stripe
+            border
+            height="100%"
+            size="small"
+            class="custom-el-table-style"
+            @selection-change="onSelectionChange"
+            @row-click="onRowClick"
+          >
+           <el-table-column
+              type="selection"
+              width="55"
+              align="center"
+              :selectable="tagSelectAble"
+              fixed
+            ></el-table-column>
+            <el-table-column
+              type="index"
+              label="序号"
+              width="60"
+              align="center"
+              fixed
+            ></el-table-column>
+            <el-table-column
+              label="商品编码"
+              prop="goodsCode"
+              header-align="center"
+              min-width="100"
+              align="center"
+              fixed
+            ></el-table-column>
+            <el-table-column
+              label="商品名称"
+              min-width="200"
+              prop="goodsName"
+              header-align="center"
+              align="center"
+              fixed
+            ></el-table-column>
+            <el-table-column
+              label="供应商"
+              min-width="200"
+              prop="providerName"
+              header-align="left"
+              align="left"
+            ></el-table-column>
+            <el-table-column
+              label="EPC"
+              min-width="200"
+              prop="qrCode"
+              header-align="center"
+              align="center"
+            ></el-table-column>
+            <el-table-column
+              label="流水号"
+              min-width="130"
+              prop="serialNumber"
+              header-align="center"
+              align="center"
+            ></el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </el-dialog>
+  </template>
+
+<script>
+import BaseCurdList from '@@/utils/BaseCurdList'
+import PrintCode from '@@/entries/PrintCode'
+
+export default {
+  name: 'DialogTagCodeDetail',
+  extends: BaseCurdList(PrintCode),
+  data: () => ({
+    visible: false,
+    data: []
+  }),
+  methods: {
+    open (data) {
+      this.visible = true
+      this.data = data
+    },
+    close () {
+      this.visible = false
+      this.data = Object.freeze([])
+    },
+    // 重写方法否则接口会调用2次
+    setOptionGroup () {
+
+    },
+    onRePrintBtnClick () {
+      const { selectedList } = this
+      const ids = new Set(selectedList.map(data => data.id))
+      console.log(ids)
+      this.$$request(this.$$api.rePrint, ids).then((flag) => {
+        if (flag) {
+          this.$notify({
+            title: '成功',
+            message: '操作成功',
+            type: 'success',
+            position: 'bottom-right'
+          })
+          this.close()
+        }
+      }).catch(console.error).finally(() => {})
+    },
+    tagSelectAble (row) {
+      return !row.isReprinting
+    }
+  }
+}
+</script>
+
+<style lang="scss"></style>

+ 28 - 4
src/components/DialogTagDistributeDetail.vue

@@ -68,7 +68,7 @@
               header-align="center"
               align="center"
             ></el-table-column>
-            <el-table-column
+            <!-- <el-table-column
                 label="单价(元)"
                 prop="unitPrice"
                 align="right"
@@ -85,7 +85,7 @@
                 header-align="right"
               ><template slot-scope="scope">
               {{ parseFloat(scope.row.amount).toFixed(2) }}
-              </template></el-table-column>
+              </template></el-table-column> -->
               <el-table-column
                 label="标签类型"
                 prop="tagTypeName"
@@ -144,19 +144,36 @@
                 min-width="100"
                 header-align="center"
               ></el-table-column>
+              <el-table-column
+                label="操作栏"
+                min-width="100"
+                header-align="center"
+                align="center"
+                width="130"
+                fixed="right"
+              >
+                <template v-slot="{ row }">
+                  <div class="flex center layout-gap">
+                    <edit-button :data="row" :on-click="onTagCodeDetailBtnClick" icon="el-icon-tickets">打印详情</edit-button>
+                  </div>
+                </template>
+              </el-table-column>
           </el-table>
         </div>
       </div>
+      <dialog-tag-code-detail
+       ref="tagCodeDetailDialog"
+    ></dialog-tag-code-detail>
     </el-dialog>
   </template>
 
 <script>
 import BaseCurdList from '@@/utils/BaseCurdList'
-import TagDistribute from '@@/entries/TagDistribute'
+import PrintCode from '@@/entries/PrintCode'
 
 export default {
   name: 'DialogTagDistributeDetail',
-  extends: BaseCurdList(TagDistribute),
+  extends: BaseCurdList(PrintCode),
   data: () => ({
     visible: false,
     oData: null
@@ -175,6 +192,13 @@ export default {
     // 重写方法否则接口会调用2次
     setOptionGroup () {
 
+    },
+    onTagCodeDetailBtnClick (data) {
+      this.$$request(this.$$api.getPrintCode, data.id).then((data) => {
+        if (data) {
+          this.$refs.tagCodeDetailDialog.open(data)
+        }
+      }).catch(console.error).finally(() => {})
     }
   }
 }

+ 20 - 5
src/components/DialogTagDistributeOperate.vue

@@ -6,7 +6,7 @@
       width="1200px"
       :close-on-click-modal="false"
     >
-      <div class="flex column" style="padding-bottom:20px;height:600px">
+      <div class="flex column" style="padding-bottom:20px;height:590px">
         <div class="flex-1 fit-size">
           <el-table
             ref="table"
@@ -69,7 +69,7 @@
               header-align="center"
               align="center"
             ></el-table-column>
-            <el-table-column
+            <!-- <el-table-column
                 label="单价(元)"
                 prop="unitPrice"
                 align="right"
@@ -86,7 +86,7 @@
                 header-align="right"
               ><template slot-scope="scope">
               {{ parseFloat(scope.row.amount).toFixed(2) }}
-              </template></el-table-column>
+              </template></el-table-column> -->
               <el-table-column
                 label="标签类型"
                 prop="tagTypeName"
@@ -155,7 +155,7 @@
               >
                 <template v-slot="{ row }">
                   <div class="flex center layout-gap">
-                    <edit-button :data="row" :on-click="onTagDistributeBtnClick" :disabled="row.isSend" icon="el-icon-share">发放</edit-button>
+                    <edit-button :data="row" :on-click="onTagDistributeBtnClick" :disabled="distributeBtnDisabled(row)" icon="el-icon-share">发放</edit-button>
                   </div>
                 </template>
               </el-table-column>
@@ -235,7 +235,7 @@ export default {
     onMergeCellsMethod ({ row, column, rowIndex, columnIndex }) {
       let rowspan = 1
 
-      if (columnIndex === 17) { // 操作栏的列索引
+      if (columnIndex === 15) { // 操作栏的列索引
         const spanData = this.colspanMap[`${row.address}|${row.applicantName}|${row.phone}|${row.isSend}`]
         rowspan = -(spanData.index === rowIndex) & spanData.span
       }
@@ -280,6 +280,21 @@ export default {
           }
         }).catch(console.error).finally(() => {})
       }
+    },
+    distributeBtnDisabled (row) {
+      if (row.isSend) {
+        return true
+      }
+      const spanData = this.colspanMap[`${row.address}|${row.applicantName}|${row.phone}|${row.isSend}`]
+      if (spanData) {
+        const ids = new Set(spanData.ids)
+        this.list.forEach(item => {
+          if (ids.has(item.id)) {
+            if (!item.isReprinting) { return true }
+          }
+        })
+      }
+      return false
     }
   }
 }

+ 2 - 2
src/components/DialogTagPurchaseDetail.vue

@@ -74,7 +74,7 @@
                     <el-input v-model="scope.row.number" :class="{ 'input-error': scope.row.number === '' }" maxlength="10" @input="handleInput" :disabled="oData.tagPurchaseStateId !='0'"></el-input>
                 </template>
             </el-table-column>
-            <el-table-column
+            <!-- <el-table-column
                 label="单价(元)"
                 prop="unitPrice"
                 align="right"
@@ -95,7 +95,7 @@
               <template slot-scope="scope">
               {{ parseFloat(scope.row.amount).toFixed(2) }}
               </template>
-            </el-table-column>
+            </el-table-column> -->
               <el-table-column
                 v-if="oData && oData.tagPurchaseStateId === '0'"
                 label="操作栏"

+ 3 - 3
src/components/DialogTagPurchaseOrderExport.vue

@@ -29,7 +29,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> -->
             </tr>
           </thead>
           <tbody>
@@ -39,12 +39,12 @@
               <td align="center"><div class="cell">{{ buyerName}}</div></td>
               <td align="center"><div class="cell">{{ item.tagTypeName}}</div></td>
               <td align="center"><div class="cell">{{ item.number}}</div></td>
-              <td align="center"><div class="cell">{{ formatAmount(item.amount)}}</div></td>
+              <!-- <td align="center"><div class="cell">{{ formatAmount(item.amount)}}</div></td> -->
             </tr>
             <tr>
               <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>
+              <!-- <td align="center"><div class="cell">{{amount}}</div></td> -->
             </tr>
           </tbody>
         </table>

+ 12 - 0
src/entries/PrintCode.js

@@ -0,0 +1,12 @@
+import BaseCurdEntry from './BaseCurdEntry'
+import printCodeApi from '@@/api/PrintCodeApi'
+
+export default class PrintCode extends BaseCurdEntry {
+  static get $$name () {
+    return 'PrintCode'
+  }
+
+  static get $$api () {
+    return printCodeApi
+  }
+}

+ 7 - 7
src/entries/TagCode.js

@@ -64,13 +64,13 @@ export default class TagCode extends BaseCurdEntry {
         }
       }
     }, {
-      Target: Provider,
-      setQuery: (options, query, Target) => {
-        const [ option ] = options
-        if (option) {
-          query.providerId = option[Target.$$idProp]
-        }
-      }
+      Target: Provider
+      // setQuery: (options, query, Target) => {
+      //   const [ option ] = options
+      //   if (option) {
+      //     query.providerId = option[Target.$$idProp]
+      //   }
+      // }
     }]
   ]
   static $$optionData = {}

+ 7 - 7
src/entries/TagDistribute.js

@@ -86,13 +86,13 @@ export default class TagDistribute extends BaseCurdEntry {
         }
       }
     }, {
-      Target: Provider,
-      setQuery: (options, query, Target) => {
-        const [ option ] = options
-        if (option) {
-          query.providerId = option[Target.$$idProp]
-        }
-      }
+      Target: Provider
+      // setQuery: (options, query, Target) => {
+      //   const [ option ] = options
+      //   if (option) {
+      //     query.providerId = option[Target.$$idProp]
+      //   }
+      // }
     }, {
       Target: DeliveryType
     }]

+ 3 - 19
src/views/PrintQueue.vue

@@ -32,13 +32,13 @@
               class="custom-el-table-style"
               @selection-change="onSelectionChange"
             >
-            <el-table-column
+            <!-- <el-table-column
               type="selection"
               width="55"
               align="center"
               :selectable="printSelectAble"
               fixed
-            ></el-table-column>
+            ></el-table-column> -->
               <el-table-column
                 type="index"
                 label="序号"
@@ -206,23 +206,7 @@ export default {
       return row.printStatus === 2
     },
     onAllContinuePrintBtnClick () {
-      const { selectedList } = this
-      const { $$idProp } = this
-
-      const ids = selectedList
-        .filter(data => data.printStatus === 2)
-        .map(data => data[$$idProp])
-
-      if (!Array.isArray(ids) || ids.length === 0) {
-        this.$notify.error({
-          title: '失败',
-          message: '请选择需要继续打印的任务',
-          position: 'bottom-right'
-        })
-        return
-      }
-      console.log(ids)
-      this.$$request(this.$$api.allContinuePrint, ids).then((flag) => {
+      this.$$request(this.$$api.allContinuePrint).then((flag) => {
         if (flag) {
           this.$notify({
             title: '成功',

+ 2 - 2
src/views/TagApply.vue

@@ -157,7 +157,7 @@
             header-align="center"
             align="center"
           ></el-table-column>
-          <el-table-column
+          <!-- <el-table-column
             label="费用(元)"
             prop="amount"
             min-width="84"
@@ -166,7 +166,7 @@
           >
           <template slot-scope="scope">
               {{ parseFloat(scope.row.amount).toFixed(2) }}
-              </template></el-table-column>
+              </template></el-table-column> -->
           <el-table-column
             label="状态"
             prop="tagApplyStateName"

+ 1 - 1
src/views/TagCode.vue

@@ -50,7 +50,7 @@
                 filterable
                 clearable
                 placeholder="输入供应商"
-              ></my-select>
+              ><el-option label="全部" value=""></el-option></my-select>
           </el-form-item>
         </el-col>
 

+ 3 - 3
src/views/TagDistribute.vue

@@ -20,7 +20,7 @@
                 filterable
                 clearable
                 placeholder="输入供应商"
-              ></my-select>
+              ><el-option label="全部" value=""></el-option></my-select>
           </el-form-item>
         </el-col>
             <el-col :span="8" class="text-right">
@@ -84,7 +84,7 @@
                 header-align="left"
                 align="left"
               ></el-table-column>
-              <el-table-column
+              <!-- <el-table-column
                 label="费用(元)"
                 prop="amount"
                 align="right"
@@ -92,7 +92,7 @@
                 header-align="right"
               ><template slot-scope="scope">
               {{ parseFloat(scope.row.amount).toFixed(2) }}
-              </template></el-table-column>
+              </template></el-table-column> -->
               <el-table-column
                 label="状态"
                 prop="tagApplyStateName"

+ 1 - 1
src/views/TagInventory.vue

@@ -8,7 +8,7 @@
               type="primary"
               class="filter-button"
               @click="onSearchBtnClick"
-            >查询</el-button>
+            >刷新</el-button>
           </el-col>
         </el-row>
       </el-form>

+ 2 - 2
src/views/TagPurchase.vue

@@ -114,7 +114,7 @@
               header-align="center"
               align="center"
             ></el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               label="总价(元)"
               prop="amount"
               min-width="84"
@@ -124,7 +124,7 @@
             <template slot-scope="scope">
               {{ parseFloat(scope.row.amount).toFixed(2) }}
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column
               label="采购人员"
               prop="buyerName"