Browse Source

【新增】发货单汇总表-二次打印密码确认

莫绍宝 3 years ago
parent
commit
8df91723d8
2 changed files with 106 additions and 20 deletions
  1. 90 7
      src/views/supply/deliver/sum_list.vue
  2. 16 13
      src/views/supply/pickup/check.vue

+ 90 - 7
src/views/supply/deliver/sum_list.vue

@@ -120,16 +120,15 @@
             highlight-current-row stripe @select="handleSelect" @select-all="handleSelectAll" show-summary
             :summary-method="$getSummaries">
             <el-table-column align="center" type="selection" width="55"></el-table-column>
+            <el-table-column align="right" label="打印次数" prop="printNum" min-width="80" show-overflow-tooltip></el-table-column>
 
             <el-table-column align="left" label="订单类型" prop="orderType" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.orderType | orderTypeFilter }}
               </template>
             </el-table-column>
-            <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip>
-            </el-table-column>
-            <el-table-column align="left" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip>
-            </el-table-column>
+            <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="发货单号" prop="id" min-width="130" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.id" />
@@ -277,6 +276,33 @@
       </div>
     </div>
 
+    <el-dialog title="密码确认" :visible.sync="isShowDialog" :show-close="false" width="40%" :close-on-click-modal="false">
+      <el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="right" label-width="70px">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="24" :lg="24">
+            <el-form-item label="密码" prop="password">
+              <el-input v-model="dialogForm.password" autocomplete="off" placeholder="请输入密码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="12">
+            <el-form-item label="操作人" prop="createMan">
+              <el-input v-model="dialogForm.createMan" readonly></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="12" style="height: 51px;">
+            <el-form-item label="操作日期" prop="createDate">
+              <el-date-picker v-model="dialogForm.createDate" readonly type="date" value-format="yyyy-MM-dd" style="width: 100%;" placeholder="选择日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelDialogForm">取 消</el-button>
+        <el-button type="primary" @click="submitDialogForm">确 定</el-button>
+      </div>
+    </el-dialog>
+
     <SumPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />
 
   </div>
@@ -284,6 +310,7 @@
 
 <script>
 import { getSumList } from '@/api/supply/deliver'
+import { checkPassword } from "@/api/supply/pickup";
 import { getCategoryList, getSalesmanList } from '@/api/common'
 import SumPrint from '@/views/supply/deliver/components/sum_print'
 
@@ -338,6 +365,16 @@ export default {
       tableSelection: [],
       queryItem: {},
       isShowPrint: false,
+
+      isShowDialog: false,
+      dialogForm: {
+        password: "",
+        createMan: "",
+        createDate: "",
+      },
+      dialogFormRules: {
+        password: [{ required: true, message: "请输入密码", trigger: "blur" }],
+      },
     }
   },
 
@@ -370,7 +407,6 @@ export default {
           } else {
             return row.refundableQty
           }
-
         }
 
       }
@@ -483,8 +519,55 @@ export default {
 
     // 点击打印
     toPrint() {
-      this.queryItem = this.tableSelection;
-      this.isShowPrint = true;
+      if (!this.tableSelection[0].printNum) {
+        this.queryItem = this.tableSelection;
+        this.isShowPrint = true;
+      } else {
+        this.queryItem = this.tableSelection;
+        this.dialogForm.createMan = JSON.parse(
+          localStorage.getItem("supply_user")
+        ).nickName;
+        this.dialogForm.createDate = this.getDate();
+        this.isShowDialog = true;
+      }
+    },
+
+    // 关闭弹窗
+    cancelDialogForm() {
+      this.isShowDialog = false;
+      this.$refs.dialogForm.resetFields();
+    },
+
+    // 提交 弹窗
+    submitDialogForm() {
+      this.$refs.dialogForm.validate((valid) => {
+        if (valid) {
+          let params = {
+            shipId: this.queryItem[0].invoiceId,
+            password: this.dialogForm.password,
+          };
+          checkPassword(params).then((res) => {
+            this.cancelDialogForm();
+            this.isShowPrint = true;
+          });
+        }
+      });
+    },
+
+    getDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+        month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+        strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
     },
 
     backList() {

+ 16 - 13
src/views/supply/pickup/check.vue

@@ -270,7 +270,7 @@ export default {
 
       queryItem: {},
       isShowPrint: false,
-dealerList:[],
+      dealerList:[],
       isShowDialog: false,
       dialogForm: {
         password: "",
@@ -313,10 +313,12 @@ dealerList:[],
       var currentdate = year + seperator1 + month + seperator1 + strDate;
       return currentdate;
     },
-  async getDealerList() {
+
+    async getDealerList() {
       const res = await getDealerList({ pageNum: 1, pageSize: -1 });
       this.dealerList = res.data.records;
     },
+    
     // 获取短信验证码
     getCode() {
       getCode({ mobile: this.screenForm.phone }).then((res) => {
@@ -348,6 +350,7 @@ dealerList:[],
         this.getListCustomer()
       });
     },
+
     onChage(e){
        const  userInfo =   this.userList.filter(k=>{
           return e === k.id
@@ -357,25 +360,25 @@ dealerList:[],
         this.screenForm.manId = userInfo[0].id;
         this.screenForm.customerName = userInfo[0].customerName
     },
+
     getListCustomer(){
-    getListCustomer({
-          keyword:'',
-          phone: this.screenForm.phone,
-          pageNum:1,
-          pageSize:-1
-        }).then(res=>{
-          this.dealerList = res.data.records
-          // this.screenForm.customerNumber = this.dataList[0].number
-        })
+      getListCustomer({
+        keyword:'',
+        phone: this.screenForm.phone,
+        pageNum:1,
+        pageSize:-1
+      }).then(res=>{
+        this.dealerList = res.data.records
+        // this.screenForm.customerNumber = this.dataList[0].number
+      })
+    },
 
-},
     // 查询列表
     getList() {
       if (!this.screenForm.manId) {
         return this.$errorMsg("请先查询提货人信息");
       }
 
-
       this.listLoading = true;
 
       let params = {