Explorar o código

其他应收单新增功能更改

chen %!s(int64=3) %!d(string=hai) anos
pai
achega
809966ee70

+ 14 - 1
src/views/basic_data/dealer/dealer_list.vue

@@ -31,6 +31,13 @@
           </el-row>
         </el-form>
       </div>
+      <!-- 按钮 -->
+      <div class="btn-group clearfix">
+        <div class="fr">
+          <ExportButton :exUrl="'/customer/export'" :exParams="exParams" />
+        </div>
+      </div>
+
       <div class="mymain-container">
         <div class="table">
           <el-table
@@ -168,7 +175,13 @@ export default {
   async created() {
     await this.getList({ pageNum: 1, pageSize: 10 });
   },
-  computed: {},
+  computed: {
+    exParams() {
+      return {
+        keyword: this.searchForm.keyword,
+      };
+    },
+  },
   methods: {
     // 提交筛选表单
     submitScreenForm() {

+ 11 - 3
src/views/basic_data/dealer/dealer_stock.vue

@@ -597,18 +597,26 @@ export default {
     handleSizeChange(val) {
       this.pageSize = val;
       this.currentPage = 1;
-      this.getList({ pageNum: 1, pageSize: this.pageSize });
+      this.getList({
+        pageNum: 1,
+        pageSize: this.pageSize,
+        customerName: this.searchForm.customerName,
+      });
     },
     // 更改当前页
     handleCurrentChange(val) {
       this.currentPage = val;
-      this.getList({ pageNum: val, pageSize: 10 });
+      this.getList({
+        pageNum: val,
+        pageSize: 10,
+        customerName: this.searchForm.customerName,
+      });
     },
     //搜索功能
     async searchFn() {
       console.log(this.searchForm);
       await this.getList({
-        cusotmerName: this.searchForm.customerName,
+        customerName: this.searchForm.customerName,
         pageNum: 1,
         pageSize: 10,
       });

+ 94 - 27
src/views/finance/components/receivable_list-add.vue

@@ -10,6 +10,7 @@
     <div>
       <el-form
         ref="searchForm"
+        :rules="rulesForm"
         :model="searchForm"
         label-width="100px"
         size="small"
@@ -23,7 +24,7 @@
           </el-col>
 
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="单据来源" prop="">
+            <el-form-item label="单据来源" prop="source">
               <el-select
                 class="selectStyle"
                 v-model="searchForm.source"
@@ -50,7 +51,7 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="到期日" prop="">
+            <el-form-item label="到期日" prop="endTime">
               <el-date-picker
                 class="selectStyle"
                 v-model="searchForm.endTime"
@@ -62,7 +63,7 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
+          <!-- <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="总金额" prop="">
               <el-input
                 disabled
@@ -70,10 +71,10 @@
                 placeholder=""
               ></el-input>
             </el-form-item>
-          </el-col>
+          </el-col> -->
 
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="单据状态" prop="">
+            <el-form-item label="单据状态" prop="examineStatus">
               <el-select
                 class="selectStyle"
                 v-model="searchForm.examineStatus"
@@ -203,21 +204,35 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.invoiceType"></el-input>
+              <!-- <el-input v-model="scope.row.invoiceType"></el-input> -->
+              <el-select
+                filterable
+                v-model="scope.row.invoiceType"
+                placeholder="请选择"
+              >
+                <el-option label="普通发票" value=""> </el-option>
+                <el-option label="增值税发票" value="1"> </el-option>
+                <el-option label="机票" value="P"> </el-option>
+                <el-option label="火车票" value="R"> </el-option>
+                <el-option label="其他运输票" value="O"> </el-option>
+                <el-option label="其他" value="E"> </el-option>
+              </el-select>
             </template>
           </el-table-column>
           <el-table-column
             align="center"
-            label="不含税金额"
+            label="*不含税金额"
             prop="afterTaxAmount"
             min-width="160"
             show-overflow-tooltip
           >
             <template slot-scope="scope">
               <el-input
-                :min="0"
-                oninput="if(value<0)value=0"
+                @input="
+                  changeAfterTaxAmount($event, scope.$index, scope.row.taxRate)
+                "
                 v-model="scope.row.afterTaxAmount"
+                type="number"
               ></el-input>
             </template>
           </el-table-column>
@@ -230,6 +245,7 @@
           >
             <template slot-scope="scope">
               <el-input
+                disabled
                 :min="0"
                 oninput="if(value<0)value=0"
                 v-model="scope.row.tax"
@@ -245,6 +261,7 @@
           >
             <template slot-scope="scope">
               <el-input
+                disabled
                 :min="0"
                 oninput="if(value<0)value=0"
                 v-model="scope.row.totalAmount"
@@ -253,6 +270,29 @@
           </el-table-column>
           <el-table-column
             align="center"
+            label="税率%"
+            prop=""
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input
+                @input="
+                  changeAfterTaxAmount(
+                    scope.row.afterTaxAmount,
+                    scope.$index,
+                    scope.row.taxRate
+                  )
+                "
+                type="number"
+                :min="0"
+                oninput="if(value>100)value=100;if(value<0)value=0"
+                v-model="scope.row.taxRate"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
             label="备注"
             prop="remark"
             min-width="160"
@@ -298,9 +338,21 @@ export default {
     return {
       searchForm: {
         source: "",
-
         billType: "其他应收单",
-        examineStatus: "",
+        examineStatus: "SAVE",
+        endTime: "",
+        remark: "",
+      },
+      rulesForm: {
+        source: [
+          { required: true, trigger: "change", message: "请选择单据来源" },
+        ],
+        examineStatus: [
+          { required: true, trigger: "change", message: "请选择单据状态" },
+        ],
+        endTime: [
+          { required: true, trigger: "change", message: "请选择到期日期" },
+        ],
       },
       dataList: [],
       customerList: [], //经销商数据
@@ -313,6 +365,25 @@ export default {
     this.getCustomerList();
   },
   methods: {
+    // 不含税金额改变事件
+    changeAfterTaxAmount(v, i, sl) {
+      // console.log(v, i);
+      // let rule = /(^-?[1-9](\d+)?(\.\d{1,2})?$)|(^-?0$)|(^-?\d\.\d{1,2}$)/;
+      // console.log();
+      // if (!rule.test(v)) {
+      //   this.$message.error("请输入正确的不含税金额");
+      //   return;
+      // }
+      //税额
+      let tax = (v * (sl / 100)).toFixed(2);
+      // console.log(tax, "税额");
+      //总金额
+      let totalAmount = (v * 1 + tax * 1).toFixed(2);
+      // console.log(totalAmount, "总金额");
+
+      this.$set(this.dataList[i], "tax", tax);
+      this.$set(this.dataList[i], "totalAmount", totalAmount);
+    },
     //重置
     resetFn() {
       this.searchForm = {};
@@ -331,29 +402,26 @@ export default {
 
     //新增
     async addFn() {
+      await this.$refs.searchForm.validate();
       if (this.dataList.length == 0) {
         this.$message.error("请添加数据");
         return;
       }
       let aaa = this.dataList.find((v) => {
-        if (v.afterTaxAmount == "") {
-          this.$message.error("请输入不含税金额");
-          return v;
-        }
         if (v.customerId == "") {
           this.$message.error("请选择经销商");
           return v;
         }
-        if (!v.walletId) {
-          this.$message.error("请选择现金钱包");
+        if (v.departmentId == "") {
+          this.$message.error("请输入费用承担部门");
           return v;
         }
-        if (v.tax == "") {
-          this.$message.error("请输入税额");
+        if (!v.walletId) {
+          this.$message.error("请选择现金钱包");
           return v;
         }
-        if (v.totalAmount == "") {
-          this.$message.error("请输入金额");
+        if (v.afterTaxAmount == "") {
+          this.$message.error("请输入不含税金额");
           return v;
         }
       });
@@ -361,7 +429,6 @@ export default {
       if (aaa != undefined) {
         return;
       }
-
       this.dataList.forEach((v) => {
         let res = this.customerList.filter((i) => i.id == v.customerId);
         console.log(res);
@@ -371,7 +438,6 @@ export default {
         v.customerWalletId = res2[0].customerWalletId;
         v.walletId = res2[0].walletRebateId;
       });
-
       await getFinanceOtherReceAdd({
         items: this.dataList,
         ...this.searchForm,
@@ -403,14 +469,15 @@ export default {
     addRowFn() {
       this.dataList.push({
         customerId: "",
-        projectCode: "",
-        projectName: "",
+        projectCode: "CI004",
+        projectName: "收差价",
         departmentId: "",
         walletId: "",
         invoiceType: "",
         afterTaxAmount: "",
-        tax: "",
-        totalAmount: "",
+        // tax: "",
+        // totalAmount: "",
+        taxRate: 13,
       });
     },
     goBack() {

+ 18 - 2
src/views/finance/components/receivable_list-approval.vue

@@ -178,7 +178,23 @@
             prop="invoiceType"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-select
+                disabled
+                filterable
+                v-model="scope.row.invoiceType"
+                placeholder="请选择"
+              >
+                <el-option label="普通发票" value=""> </el-option>
+                <el-option label="增值税发票" value="1"> </el-option>
+                <el-option label="机票" value="P"> </el-option>
+                <el-option label="火车票" value="R"> </el-option>
+                <el-option label="其他运输票" value="O"> </el-option>
+                <el-option label="其他" value="E"> </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="不含税金额"
@@ -316,7 +332,7 @@ export default {
         theTime: res.data.theTime,
         endTime: res.data.endTime,
         totalAmount: res.data.totalAmount,
-        create: res.data.create,
+        createBy: res.data.createBy,
         createTime: res.data.createTime,
         examineStatus: res.data.examineStatus == "WAIT" ? "待审核" : "",
         remark: res.data.remark,

+ 17 - 1
src/views/finance/components/receivable_list-detail.vue

@@ -160,7 +160,23 @@
             prop="invoiceType"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-select
+                disabled
+                filterable
+                v-model="scope.row.invoiceType"
+                placeholder="请选择"
+              >
+                <el-option label="普通发票" value=""> </el-option>
+                <el-option label="增值税发票" value="1"> </el-option>
+                <el-option label="机票" value="P"> </el-option>
+                <el-option label="火车票" value="R"> </el-option>
+                <el-option label="其他运输票" value="O"> </el-option>
+                <el-option label="其他" value="E"> </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="不含税金额"

+ 5 - 1
src/views/finance/receivable_list.vue

@@ -170,7 +170,11 @@
               prop="userType"
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                {{ scope.row.userType == "BD_Customer" ? "客户" : "" }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="往来单位"