lilei 2 rokov pred
rodič
commit
726c57aa8f

+ 22 - 12
src/views/salesManagement/pushOrderManagement/list.vue

@@ -133,22 +133,31 @@
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            class="button-warning"
-            :loading="!!tipData"
-            v-if="record.printStatus=='UNABLE_PRINT'&&record.voidFlag=='0'&&$hasPermissions('B_UNABLE_PRINT')"
-            @click="handlePrint(record)"
-          >允许备货打印</a-button>
-          <span v-else>--</span>
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              :loading="!!tipData"
+              v-if="(record.printStatus=='UNABLE_PRINT'||record.printStatus=='CANCEL_PRINT')&&record.voidFlag=='0'&&$hasPermissions('B_UNABLE_PRINT')"
+              @click="handlePrint(record,1)"
+            >允许打印</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              :loading="!!tipData"
+              v-if="record.printStatus=='UNABLE_PRINT'&&record.voidFlag=='0'&&$hasPermissions('B_UNABLE_PRINT')"
+              @click="handlePrint(record,0)"
+            >取消打印</a-button>
+          </div>
         </template>
       </s-table>
 
       <!-- 操作提示 -->
       <commonModal modalTit="操作提示" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
         <div style="text-align: center;">
-          <div style="margin-bottom: 15px;font-size: 14px;"><strong>确认允许此单进行备货打印吗?</strong></div>
+          <div style="margin-bottom: 15px;font-size: 14px;"><strong>{{ tipData&&tipData.printType==1?'确认允许此单进行备货打印吗?':'确认此单取消备货打印吗?' }}</strong></div>
           <div style="line-height: 24px;">
             <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
             <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
@@ -294,8 +303,9 @@ export default {
       }
     },
     // 允许备货打印
-    handlePrint (row) {
+    handlePrint (row, type) {
       this.tipData = row
+      this.tipData.printType = type
       this.showTipModal = true
     },
     canselModal () {
@@ -303,7 +313,7 @@ export default {
       this.showTipModal = false
     },
     updatePrintStatus () {
-      dispatchPrintStatus({ dispatchBillSn: this.tipData.dispatchBillSn, printStatus: 'NO_PRINT' }).then(res => {
+      dispatchPrintStatus({ dispatchBillSn: this.tipData.dispatchBillSn, printStatus: this.tipData && this.tipData.printType == 1 ? 'NO_PRINT' : 'CANCEL_PRINT' }).then(res => {
         if (res.status == 200) {
           this.canselModal()
           this.$message.info(res.message)

+ 38 - 3
src/views/salesManagement/stockPrint/list.vue

@@ -121,6 +121,11 @@
             <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
             <span v-else>{{ record.dispatchBillNo }}</span>
           </template>
+          <!-- 备货打印状态 -->
+          <template slot="printStatus" slot-scope="text, record">
+            <span v-if="record.printStatus=='NO_PRINT'" class="link-bule" @click="handlePrintStatus(record)">{{ record.printStatusDictValue }}</span>
+            <span v-else>{{ record.printStatusDictValue }}</span>
+          </template>
           <div slot="costTitle">
             <a-tooltip placement="top">
               <template slot="title">
@@ -163,6 +168,16 @@
           <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
           <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
         </commonModal>
+        <!-- 操作提示 -->
+        <commonModal modalTit="操作提示" :openModal="showPrintModal" @cancel="canselModal" @ok="updatePrintStatus">
+          <div style="text-align: center;">
+            <div style="margin-bottom: 15px;font-size: 14px;">如需将打印状态回退至<strong>【暂不打印】</strong>,请点击下方按钮</div>
+            <div style="line-height: 24px;">
+              <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
+              <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
+            </div>
+          </div>
+        </commonModal>
       </a-spin>
     </a-card>
   </div>
@@ -180,7 +195,7 @@ import recordModal from './recordModal.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
 import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
-import { dispatchlList, dispatchDetailPrint } from '@/api/dispatch'
+import { dispatchlList, dispatchDetailPrint, dispatchPrintStatus } from '@/api/dispatch'
 import { printFun } from '@/libs/JGPrint.js'
 export default {
   name: 'StockPrintList',
@@ -230,7 +245,9 @@ export default {
           this.spinning = false
           return data
         })
-      }
+      },
+      tipData: null,
+      showPrintModal: false
     }
   },
   computed: {
@@ -251,7 +268,7 @@ export default {
         // { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据状态', dataIndex: 'voidFlagDictValue', width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备货打印状态', width: '100px', align: 'center', scopedSlots: { customRender: 'printStatus' } },
         { title: '允许打印时间', dataIndex: 'allowPrintTime', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center', fixed: 'right' }
@@ -333,6 +350,24 @@ export default {
         billSn: row.dispatchBillSn
       })
     },
+    // 允许备货打印
+    handlePrintStatus (row) {
+      this.tipData = row
+      this.showPrintModal = true
+    },
+    canselModal () {
+      this.tipData = null
+      this.showPrintModal = false
+    },
+    updatePrintStatus () {
+      dispatchPrintStatus({ dispatchBillSn: this.tipData.dispatchBillSn, printStatus: 'UNABLE_PRINT' }).then(res => {
+        if (res.status == 200) {
+          this.canselModal()
+          this.$message.info(res.message)
+          this.$refs.table.refresh()
+        }
+      })
+    },
     // 重置
     resetSearchForm () {
       this.time = []