Bläddra i källkod

增加费用确认打印单

lichao 3 år sedan
förälder
incheckning
39acf20e54

+ 272 - 0
src/views/Warehousing/components/incomeMoney.vue

@@ -39,6 +39,12 @@
         >计算仓储费
         </el-button>
         <el-button
+          size="small"
+          type="primary"
+          @click="feesConfirm"
+          v-if="false"
+        >费用确认单</el-button>
+        <el-button
           type="primary"
           size="small"
           v-if="browseStatus"
@@ -652,12 +658,125 @@
         >
       </div>
     </el-dialog>
+    <!--    费用确认单-->
+    <el-dialog
+      :visible.sync="print_fyqr"
+      width="70%"
+      :close-on-click-modal="false"
+      :modal="false"
+    >
+      <div id="print_fyqr" class="print-div">
+        <div
+          class="print-title"
+          style="
+            display: flex;
+            justify-content: center;
+            font-size: 24px;
+            margin-bottom: 5px;
+          "
+        >
+          {{ company }}
+        </div>
+        <div
+          style="
+            display: flex;
+            justify-content: center;
+            margin-bottom: 5px;
+          ">
+          <div style="font-size: 18px">费用确认</div>
+        </div>
+        <div style="display: flex;justify-content: space-between;">
+          <div>
+            <div>业务编号:</div>
+            <div>客户名称:{{ form.fCorpidName }}</div>
+            <div>提单号:{{ form.fBillno }}</div>
+          </div>
+          <div>
+            <div>制单日期:{{ form.createTime | fBsdateFormat }}</div>
+            <div>仓库名称:{{ form.fWarehouseid | warehouseFormat(warehouseOptions) }}</div>
+            <div>箱型/箱量:{{ form.fCntval }}</div>
+          </div>
+          <div>
+            <div>制单人:{{ form.createBy }}</div>
+            <div>打印日期:{{ nowTime | fBsdateFormat }}</div>
+          </div>
+        </div>
+        <div class="print_table" style="display: flex">
+          <table
+            border="0"
+            cellspacing="0"
+            cellpadding="0"
+            style="width: 100%; line-height: 30px"
+          >
+            <tr>
+              <td>序号</td>
+              <td>费用项目</td>
+              <td>计价单位</td>
+              <td>数量</td>
+              <td>单价</td>
+              <td>是否含税</td>
+              <td>税率</td>
+              <td>不含税金额</td>
+              <td>税额</td>
+              <td>应收金额</td>
+              <td>备注</td>
+            </tr>
+            <tr v-for="(item, index) in Collectionoptionss" :key="index">
+              <td>{{ index + 1 }}</td>
+              <td>{{ item.fFeeid | fFeetFormat(fDNameOptions) }}</td>
+              <td>{{ item.fFeeUnitid | fFeetUnitFormat(fFeetUnitOptions) }}</td>
+              <td>{{ item.fQty }}</td>
+              <td>{{ item.fUnitprice }}</td>
+              <td>{{ item.fTaxrate != 0? '√': '×' }}</td>
+              <td>{{ item.fTaxrate }}</td>
+              <td>{{ item.exclTax }}</td>
+              <td>{{ item.taxAmount }}</td>
+              <td>{{ item.fAmount }}</td>
+              <td>{{ item.remark }}</td>
+            </tr>
+            <tr>
+              <td colspan="7">合计</td>
+              <td>{{ allExclTax }}</td>
+              <td>{{ allTaxAmount }}</td>
+              <td>{{ allDrAmount }}</td>
+              <td></td>
+            </tr>
+          </table>
+        </div>
+        <div>人民币汇款路径:</div>
+        <div>公司名称:{{ company }}</div>
+        <div>纳税人识别号:</div>
+        <div>地址:</div>
+        <div>电话:</div>
+        <div>开户行:</div>
+        <div>银行账户:</div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button
+          type="primary"
+          @click="
+            addprint('fyqrd');
+            print_fyqr = false;
+          "
+        >打印
+        </el-button>
+        <el-button @click="print_fyqr = false">取消 </el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import {operationAgreement} from "@/api/agreement/agreement";
 import {feesCheck,revokefeeCheck} from "@/api/warehouseBusiness/warehouseInStock";
+import print from "print-js";
+import Cookies from "js-cookie";
+import {
+  listWarehouse,
+  treeselect,
+  listWarehousesss,
+  deliveryDetails
+} from "@/api/basicdata/warehouse";
 
 export default {
   props: {
@@ -710,6 +829,14 @@ export default {
       type: Object,
       default: null,
     },
+    CntrTable: {
+      type: Array,
+      default: [],
+    },
+    cntrList: {
+      type: Array,
+      default: [],
+    },
   },
   data() {
     return {
@@ -721,8 +848,63 @@ export default {
       dialogWhgenlegList: [],
       pageNum: 1,
       pageSize: 10,
+      nowTime: '',
+      // 税额总数
+      allTaxAmount: 0,
+      // 不含税金额总数
+      allExclTax: 0,
+      // 收款金额合计
+      allDrAmount: 0,
+      print_fyqr: false,
+      company: '',
+      warehouseOptions:[],
     };
   },
+  created() {
+    this.company = Cookies.get("companyName")
+    listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
+      this.warehouseOptions = response.rows;
+    });
+  },
+  filters: {
+    fBsdateFormat(row) {
+      if (row) {
+        const dateMat = new Date(row);
+        const year = dateMat.getFullYear();
+        const month = dateMat.getMonth() + 1;
+        const day = dateMat.getDate();
+        const timeFormat = year + "-" + month + "-" + day;
+        return timeFormat;
+      }
+    },
+    warehouseFormat(row, warehouseOptions) {
+      let warehouse;
+      warehouseOptions.map((e) => {
+        if (row == e.fId) {
+          warehouse = e.fName;
+        }
+      });
+      return warehouse;
+    },
+    fFeetFormat(row, fNameOptions) {
+      let name;
+      fNameOptions.map((e) => {
+        if (row == e.fId) {
+          name = e.fName;
+        }
+      });
+      return name;
+    },
+    fFeetUnitFormat(row, fFeetUnitOptions) {
+      let name;
+      fFeetUnitOptions.map((e) => {
+        if (row == e.dictValue) {
+          name = e.dictLabel;
+        }
+      });
+      return name;
+    },
+  },
   methods: {
     feeChange() {
       this.$emit("feeChangeD", 'D');
@@ -932,6 +1114,76 @@ export default {
         }
       })
     },
+    // 打印费用确认单准备
+    feesConfirm() {
+      if (this.Collectionoptionss.length > 0) {
+        for (let item in this.Collectionoptionss) {
+          if (!this.Collectionoptionss[item].fId) {
+            return this.$message.error("请先保存!");
+          }
+        }
+        if (this.CntrTable.length > 0) {
+          let arr = [];
+          this.CntrTable.map((e) => {
+            this.cntrList.map((item) => {
+              if (item.fId == e.fCntrid) {
+                arr.push(item.fName + "X" + e.fCntrcount);
+              }
+            });
+          });
+          arr = [...new Set(arr)];
+          this.form.fCntval = arr.join(",");
+        } else {
+          this.form.fCntval = null;
+        }
+        this.allTaxAmount = 0;
+        this.allExclTax = 0;
+        this.allDrAmount = 0;
+        this.Collectionoptionss.forEach(item => {
+          // 税额
+          this.$set(item, 'taxAmount', Number(item.fAmount) / (1 + Number(Number(item.fTaxrate) / 100)))
+          item.taxAmount = item.taxAmount.toSuperFixed(2)
+          // 不含税金额
+          this.$set(item, 'exclTax', Number(item.fAmount) - Number(item.taxAmount))
+          item.exclTax = item.exclTax.toSuperFixed(2)
+          this.allTaxAmount = Number(this.allTaxAmount) + Number(item.taxAmount)
+          this.allExclTax = Number(this.allExclTax) + Number(item.exclTax)
+          this.allDrAmount = Number(this.allDrAmount) + Number(item.fAmount)
+          this.allTaxAmount = this.allTaxAmount.toSuperFixed(2)
+          this.allExclTax = this.allExclTax.toSuperFixed(2)
+          this.allDrAmount = this.allDrAmount.toSuperFixed(2)
+        })
+        this.nowTime = new Date().toLocaleDateString()
+        for (let corp in this.fMblnoOptions) {
+          if (this.form.fCorpid === this.fMblnoOptions[corp].fId) {
+            this.$set(
+              this.form,
+              "fCorpidName",
+              this.fMblnoOptions[corp].fName
+            );
+          }
+        }
+        this.print_fyqr = true;
+      } else {
+        this.$message.error("请选择需要打印的明细!");
+      }
+    },
+    // 打印
+    addprint(status) {
+      const style =
+        "@page {  } " +
+        "@media print { .print-div{ padding:8px;background-color:#cccccc;} .print-title{display:flex;justify-content: center;font-size:24px} .print_form{font-size:12px} .print_table table {border-right: 1px solid #000;border-bottom: 1px solid #000;font-size:12px} .print_table table td {border-left: 1px solid #000;border-top: 1px solid #000;padding:2px;vertical-align:middle;text-align: center;}";
+      switch (status) {
+        case "fyqrd":
+          print({
+            printable: "print_fyqr",
+            type: "html",
+            style: style, // 亦可使用引入的外部css;
+            scanStyles: false,
+          });
+          break;
+      }
+    },
   },
   watch: {
     browseStatus(val) {
@@ -945,4 +1197,24 @@ export default {
 </script>
 
 <style scoped lang="scss">
+.print_table {
+  table {
+    border-right: 1px solid #000;
+    border-bottom: 1px solid #000;
+    font-size: 12px;
+    margin-bottom: 5px;
+  }
+
+  table td {
+    border-left: 1px solid #000;
+    border-top: 1px solid #000;
+    vertical-align: middle;
+    padding: 2px;
+    text-align: center;
+  }
+}
+
+.print_form {
+  font-size: 12px;
+}
 </style>

+ 2 - 0
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -1415,6 +1415,8 @@
             :fCntqty="fCntqty"
             :form="form"
             :company="company"
+            :CntrTable="CntrTable"
+            :cntrList="cntrList"
         ></income-money>
       </el-collapse-item>
 

+ 198 - 0
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -1257,6 +1257,12 @@
             >计算仓储费
             </el-button>
             <el-button
+              size="small"
+              type="primary"
+              @click="feesConfirm"
+              v-if="false"
+            >费用确认单</el-button>
+            <el-button
               type="primary"
               size="small"
               v-if="browseStatus"
@@ -3638,6 +3644,111 @@
         <el-button @click="print_zccdckd = false">取消 </el-button>
       </span>
     </el-dialog>
+<!--    费用确认单-->
+    <el-dialog
+      :visible.sync="print_fyqr"
+      width="70%"
+      :close-on-click-modal="false"
+      :modal="false"
+    >
+      <div id="print_fyqr" class="print-div">
+        <div
+          class="print-title"
+          style="
+            display: flex;
+            justify-content: center;
+            font-size: 24px;
+            margin-bottom: 5px;
+          "
+        >
+          {{ company }}
+        </div>
+        <div
+          style="
+            display: flex;
+            justify-content: center;
+            margin-bottom: 5px;
+          ">
+          <div style="font-size: 18px">费用确认</div>
+        </div>
+        <div style="display: flex;justify-content: space-between;">
+          <div>
+            <div>业务编号:{{ form.fBillno }}</div>
+            <div>客户名称:{{ form.fCorpidName }}</div>
+            <div>提单号:{{ form.fBillno }}</div>
+          </div>
+          <div>
+            <div>制单日期:{{ form.createTime | fBsdateFormat }}</div>
+            <div>仓库名称:{{ form.fWarehouseid | warehouseFormat(warehouseOptions) }}</div>
+            <div>箱型/箱量:{{ form.fCntval }}</div>
+          </div>
+          <div>
+            <div>制单人:{{ form.createBy }}</div>
+            <div>打印日期:{{ nowTime | fBsdateFormat }}</div>
+          </div>
+        </div>
+        <div class="print_table" style="display: flex">
+          <table
+            border="0"
+            cellspacing="0"
+            cellpadding="0"
+            style="width: 100%; line-height: 30px"
+          >
+            <tr>
+              <td>序号</td>
+              <td>费用项目</td>
+              <td>计价单位</td>
+              <td>数量</td>
+              <td>单价</td>
+              <td>是否含税</td>
+              <td>税率</td>
+              <td>不含税金额</td>
+              <td>税额</td>
+              <td>应收金额</td>
+              <td>备注</td>
+            </tr>
+            <tr v-for="(item, index) in Collectionoptionss" :key="index">
+              <td>{{ index + 1 }}</td>
+              <td>{{ item.fFeeid | fFeetFormat(fDNameOptions) }}</td>
+              <td>{{ item.fFeeUnitid | fFeetUnitFormat(fFeetUnitOptions) }}</td>
+              <td>{{ item.fQty }}</td>
+              <td>{{ item.fUnitprice }}</td>
+              <td>{{ item.fTaxrate != 0? '√': '×' }}</td>
+              <td>{{ item.fTaxrate }}</td>
+              <td>{{ item.exclTax }}</td>
+              <td>{{ item.taxAmount }}</td>
+              <td>{{ item.fAmount }}</td>
+              <td>{{ item.remark }}</td>
+            </tr>
+            <tr>
+              <td colspan="7">合计</td>
+              <td>{{ allExclTax }}</td>
+              <td>{{ allTaxAmount }}</td>
+              <td>{{ allDrAmount }}</td>
+              <td></td>
+            </tr>
+          </table>
+        </div>
+        <div>人民币汇款路径:</div>
+        <div>公司名称:{{ company }}</div>
+        <div>纳税人识别号:</div>
+        <div>地址:</div>
+        <div>电话:</div>
+        <div>开户行:</div>
+        <div>银行账户:</div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button
+          type="primary"
+          @click="
+            addprint('fyqrd');
+            print_fyqr = false;
+          "
+        >打印
+        </el-button>
+        <el-button @click="print_fyqr = false">取消 </el-button>
+      </span>
+    </el-dialog>
     <!-- 选择作业费协议数据 -->
     <el-dialog
         v-dialogDrag
@@ -4381,6 +4492,13 @@ export default {
       firstReviewer: '',
       // 复级审核人
       secondReviewer: '',
+      // 税额总数
+      allTaxAmount: 0,
+      // 不含税金额总数
+      allExclTax: 0,
+      // 收款金额合计
+      allDrAmount: 0,
+      print_fyqr: false,
     };
   },
   computed: {
@@ -4503,6 +4621,15 @@ export default {
         return timeFormat;
       }
     },
+    warehouseFormat(row, warehouseOptions) {
+      let warehouse;
+      warehouseOptions.map((e) => {
+        if (row == e.fId) {
+          warehouse = e.fName;
+        }
+      });
+      return warehouse;
+    },
     fStorageFormat(row) {
       let name;
       for (const item of JSON.parse(localStorage.getItem("fStorageTypeList"))) {
@@ -4557,6 +4684,15 @@ export default {
       });
       return name;
     },
+    fFeetUnitFormat(row, fFeetUnitOptions) {
+      let name;
+      fFeetUnitOptions.map((e) => {
+        if (row == e.dictValue) {
+          name = e.dictLabel;
+        }
+      });
+      return name;
+    },
     fStorageTypeFormat(row, fStorageTypeOptions) {
       let fStorageType;
       fStorageTypeOptions.map((e) => {
@@ -7229,6 +7365,14 @@ export default {
             scanStyles: false,
           });
           break;
+        case "fyqrd":
+          print({
+            printable: "print_fyqr",
+            type: "html",
+            style: style, // 亦可使用引入的外部css;
+            scanStyles: false,
+          });
+          break;
       }
     },
     cancel() {
@@ -7397,6 +7541,60 @@ export default {
         this.$set(this.form, 'fTel', res.data.fTel)
       })
     },
+    // 打印费用确认单准备
+    feesConfirm() {
+      if (this.Collectionoptionss.length > 0) {
+        for (let item in this.Collectionoptionss) {
+          if (!this.Collectionoptionss[item].fId) {
+            return this.$message.error("请先保存!");
+          }
+        }
+        if (this.CntrTable.length > 0) {
+          let arr = [];
+          this.CntrTable.map((e) => {
+            this.cntrList.map((item) => {
+              if (item.fId == e.fCntrid) {
+                arr.push(item.fName + "X" + e.fCntrcount);
+              }
+            });
+          });
+          arr = [...new Set(arr)];
+          this.form.fCntval = arr.join(",");
+        } else {
+          this.form.fCntval = null;
+        }
+        this.allTaxAmount = 0;
+        this.allExclTax = 0;
+        this.allDrAmount = 0;
+        this.Collectionoptionss.forEach(item => {
+          // 税额
+          this.$set(item, 'taxAmount', Number(item.fAmount) / (1 + Number(Number(item.fTaxrate) / 100)))
+          item.taxAmount = item.taxAmount.toSuperFixed(2)
+          // 不含税金额
+          this.$set(item, 'exclTax', Number(item.fAmount) - Number(item.taxAmount))
+          item.exclTax = item.exclTax.toSuperFixed(2)
+          this.allTaxAmount = Number(this.allTaxAmount) + Number(item.taxAmount)
+          this.allExclTax = Number(this.allExclTax) + Number(item.exclTax)
+          this.allDrAmount = Number(this.allDrAmount) + Number(item.fAmount)
+          this.allTaxAmount = this.allTaxAmount.toSuperFixed(2)
+          this.allExclTax = this.allExclTax.toSuperFixed(2)
+          this.allDrAmount = this.allDrAmount.toSuperFixed(2)
+        })
+        this.nowTime = new Date().toLocaleDateString()
+        for (let corp in this.fMblnoOptions) {
+          if (this.form.fCorpid === this.fMblnoOptions[corp].fId) {
+            this.$set(
+              this.form,
+              "fCorpidName",
+              this.fMblnoOptions[corp].fName
+            );
+          }
+        }
+        this.print_fyqr = true;
+      } else {
+        this.$message.error("请选择需要打印的明细!");
+      }
+    },
   },
   watch: {
     // 监听 addOrUpdateVisible 改变