Bläddra i källkod

其他应收单新增编辑功能

chen 3 år sedan
förälder
incheckning
107901041c

+ 8 - 0
src/api/finance/receivable_list.js

@@ -73,3 +73,11 @@ export function getFinanceOtherReceAbandon(params) {
     params,
   });
 }
+// 其他应收单-修改
+export function getFinanceOtherReceUpdate(data) {
+  return request({
+    url: "/finance/other/rece/update",
+    method: "post",
+    data,
+  });
+}

+ 14 - 5
src/views/deposit_commerce/components/refund_list-detail.vue

@@ -156,14 +156,17 @@
         </el-col> -->
         <el-col :xs="24" :sm="24" :lg="16" class="item">
           <div class="label">备注</div>
-          <div class="value">{{ detailList.applyNote }}</div>
+          <!-- <div class="value">{{ detailList.applyNote }}</div> -->
+          <div class="value">
+            <el-input :disabled='detailList.examineStatus !== "WAIT"' v-model="detailList.remark" placeholder="请输入内容"></el-input>
+          </div>
         </el-col>
         <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="16" class="item">
           <div class="label">格力内部备注</div>
-          <!-- <div class="value">{{  detailList.geLiInerNote}}</div> -->
-          <div class="value">
-            <el-input v-model="detailList.geLiInerNote" placeholder="请输入内容"></el-input>
-          </div>
+          <div class="value">{{  detailList.geLiInerNote}}</div>
+          <!-- <div class="value">
+            <el-input :disabled='detailList.examineStatus !== "WAIT"' v-model="detailList.geLiInerNote" placeholder="请输入内容"></el-input>
+          </div> -->
 
         </el-col>
         <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
@@ -206,6 +209,12 @@
               <span>{{scope.row.materialOldNumber}}</span>
             </template>
           </el-table-column>
+          <el-table-column align="left" label="特价编号" prop="specialNo" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copyText="scope.row.specialNo" />
+              <span>{{scope.row.specialNo}}</span>
+            </template>
+          </el-table-column>
           <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
               <CopyButton :copyText="scope.row.materialNumber" />

+ 4 - 1
src/views/deposit_commerce/refund_list.vue

@@ -399,7 +399,10 @@ export default {
         for (let i = 0; i < this.selectData.length; i++) {
           arr.push(this.selectData[i].depositManageId);
         }
-        downloadFiles("/deposit-manage/export", { id: arr });
+        downloadFiles("/deposit-manage/export", {
+          id: arr,
+          enginOrderType: "TRADE",
+        });
       } else {
         this.$errorMsg("请选择押金项");
       }

+ 13 - 4
src/views/deposit_home/components/refund_list-detail.vue

@@ -156,14 +156,17 @@
         </el-col> -->
         <el-col :xs="24" :sm="24" :lg="16" class="item">
           <div class="label">备注</div>
-          <div class="value">{{ detailList.applyNote }}</div>
+          <!-- <div class="value">{{ detailList.remark }}</div> -->
+          <div class="value">
+            <el-input :disabled='detailList.examineStatus !== "WAIT"' v-model="detailList.remark" placeholder="请输入内容"></el-input>
+          </div>
         </el-col>
         <el-col v-if="!isCustomer" :xs="24" :sm="24" :lg="16" class="item">
           <div class="label">格力内部备注</div>
-          <!-- <div class="value">{{  detailList.geLiInerNote}}</div> -->
-          <div class="value">
+          <div class="value">{{  detailList.geLiInerNote}}</div>
+          <!-- <div class="value">
             <el-input :disabled='detailList.examineStatus !== "WAIT"' v-model="detailList.geLiInerNote" placeholder="请输入内容"></el-input>
-          </div>
+          </div> -->
 
         </el-col>
         <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
@@ -206,6 +209,12 @@
               <span>{{scope.row.materialOldNumber}}</span>
             </template>
           </el-table-column>
+          <el-table-column align="left" label="特价编号" prop="specialNo" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <CopyButton :copyText="scope.row.specialNo" />
+              <span>{{scope.row.specialNo}}</span>
+            </template>
+          </el-table-column>
           <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
               <CopyButton :copyText="scope.row.materialNumber" />

+ 5 - 2
src/views/deposit_home/refund_list.vue

@@ -32,7 +32,7 @@
               </el-form-item>
             </el-col> -->
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程名称" prop="refProjectName">
+              <el-form-item label="使用单位" prop="refProjectName">
                 <el-input v-model="searchForm.refProjectName" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
@@ -399,7 +399,10 @@ export default {
         for (let i = 0; i < this.selectData.length; i++) {
           arr.push(this.selectData[i].depositManageId);
         }
-        downloadFiles("/deposit-manage/export", { id: arr });
+        downloadFiles("/deposit-manage/export", {
+          id: arr,
+          enginOrderType: "HOME",
+        });
       } else {
         this.$errorMsg("请选择押金项");
       }

+ 199 - 6
src/views/finance/components/receivable_list-detail.vue

@@ -57,7 +57,7 @@
     <el-divider></el-divider>
     <!-- 列表 -->
     <div class="mymain-container">
-      <div class="table">
+      <div class="table" v-if="czType === 'detail'">
         <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column label="序号" align="left" type="index" width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="left" label="经销商编号" prop="customerNumber" min-width="160" show-overflow-tooltip>
@@ -107,8 +107,107 @@
           <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
+      <div class="table" v-if="czType ==='edit'">
+        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe :row-class-name="rouClassNameFn" @row-click="onRowClick">
+          <el-table-column align="left" label="序号">
+            <template slot-scope="scope">
+              {{ scope.$index + 1 }}
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="*经销商名称" prop="customerName" min-width="300" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-select class="selectClass" @change="changeCustomerFn($event, scope.$index)" v-model="scope.row.customerId" placeholder="请选择" filterable>
+                <el-option v-for="(item, i) in customerList" :key="i" :label="item.name" :value="item.id">
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="费用项目编码" prop="projectCode" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.projectCode"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="*项目费用名称" prop="projectName" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.projectName"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="*费用承担部门" prop="departmentId" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.departmentId"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="*收入部门" prop="incomeDept" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.incomeDept"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="现金钱包" prop="walletId" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-select filterable v-model="scope.row.customerWalletId" placeholder="请选择">
+                <el-option v-for="item in scope.row.walletList" :key="item.customerWalletId" :label="item.customerWalletName" :value="item.customerWalletId">
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="*发票类型" prop="invoiceType" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <!-- <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="不含税金额"
+            prop="afterTaxAmount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.afterTaxAmount"
+                type="number"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="税额"
+            prop="tax"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input type="number" v-model="scope.row.tax"></el-input>
+            </template>
+          </el-table-column> -->
+          <el-table-column align="right" label="*总金额" prop="tax" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input class='mountclass' type="number" v-model="scope.row.totalAmount"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="税率%" prop="" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input 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="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark"></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
     </div>
-    <div v-if="searchForm.examineStatus != '待审核'">
+    <div v-if="examineStatus === 'FAIL' || examineStatus === 'OK'">
       <span>审批记录</span>
       <el-divider></el-divider>
       <div class="diy-table-1">
@@ -140,21 +239,42 @@
       </div>
     </div>
 
+    <!-- 按钮 -->
+    <div class="btn-group clearfix">
+      <div class="fl">
+        <el-button v-if="czType == 'edit'" size="mini" type="primary" @click="saveFn">保存</el-button>
+      </div>
+      <div class="fr">
+        <el-button type="primary" size="small" @click="addRowFn">添加行</el-button>
+        <el-button type="primary" size="small" @click="delRowFn">删除行</el-button>
+      </div>
+    </div>
     <br />
   </div>
 </template>
 
 <script>
-import { getFinanceOtherReceDetail } from "@/api/finance/receivable_list";
+import {
+  getFinanceOtherReceDetail,
+  getCustomerList,
+  getFinanceCustomerList,
+  getFinanceOtherReceUpdate,
+} from "@/api/finance/receivable_list";
+
 export default {
   props: {
     approvalId: {
       type: String,
       required: true,
     },
+    czType: {
+      type: String,
+      required: true,
+    },
   },
   data() {
     return {
+      customerList: [], //经销商数据
       dataList: [],
       listLoading: false, // 列表加载loading
       examineBy: "", //审核人
@@ -175,11 +295,67 @@ export default {
   },
   created() {
     this.getDataList();
+    this.getCustomerList();
   },
   methods: {
+    //保存
+    async saveFn() {
+      await getFinanceOtherReceUpdate({
+        id: this.approvalId,
+        items: this.dataList,
+        examineStatus: this.examineStatus,
+        code: this.searchForm.code,
+      });
+      this.$message.success("编辑成功");
+      this.$parent.showPage = 1;
+    },
+    //选择经销商名称事件
+    async changeCustomerFn(v, index) {
+      // console.log(v, 322311);
+      this.dataList[index].customerWalletId = "";
+      const res = await getFinanceCustomerList({
+        customerId: v,
+        type: "COMMONLY",
+      });
+      this.$set(this.dataList[index], "walletList", res.data);
+      console.log(this.dataList, "kkk");
+      // this.walletList = res.data;
+    },
+    //获取经销商数据
+    async getCustomerList() {
+      const res = await getCustomerList({ pageNum: 1, pageSize: -1 });
+      this.customerList = res.data.records;
+    },
+    rouClassNameFn({ row, rowIndex }) {
+      //把每一行的索引放进row
+      row.index = rowIndex;
+    },
+    onRowClick(row, event, column) {
+      this.delIndex = row.index;
+    },
+    //删除行
+    delRowFn() {
+      this.dataList.splice(this.delIndex, 1);
+    },
+    //添加行数据
+    addRowFn() {
+      this.dataList.push({
+        customerId: "",
+        projectCode: "FYXM01_SYS",
+        projectName: "材料成本",
+        departmentId: "",
+        customerWalletId: "",
+        invoiceType: "",
+        incomeDept: "",
+        // afterTaxAmount: "",
+        // tax: "",
+        totalAmount: "",
+        taxRate: 13,
+      });
+    },
     async getDataList() {
       const res = await getFinanceOtherReceDetail({ id: this.approvalId });
-      console.log(res);
+      // console.log(res, 123456);
       this.examineBy = res.data.examineBy;
       this.examineTime = res.data.examineTime;
       this.examineStatus = res.data.examineStatus;
@@ -196,9 +372,23 @@ export default {
             ? "已通过"
             : res.data.examineStatus == "FAIL"
             ? "不通过"
+            : res.data.examineStatus == "SAVE"
+            ? "保存"
             : "待审核",
         remark: res.data.remark,
       };
+      // res.data.items.forEach((v) => {
+      //   this.changeCustomerFn(v.customerId, v.index);
+      // });
+      for (let index = 0; index < res.data.items.length; index++) {
+        const a = await getFinanceCustomerList({
+          customerId: res.data.items[index].customerId,
+          type: "COMMONLY",
+        });
+
+        res.data.items[index]["walletList"] = a.data;
+        // this.$set(this.dataList[index], "walletList", a.data);
+      }
       this.dataList = res.data.items;
     },
     goBack() {
@@ -207,5 +397,8 @@ export default {
   },
 };
 </script>
-
-<style></style>
+<style lang="scss" scoped>
+.selectClass {
+  width: 100%;
+}
+</style>

+ 9 - 10
src/views/finance/receivable_list.vue

@@ -116,14 +116,11 @@
 
             <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip fixed="right">
               <template slot-scope="scope">
-                <el-button v-show="
-                    (scope.row.examineStatus == 'WAIT' ||
-                      scope.row.examineStatus == 'FAIL') &&
-                    $checkBtnRole('examine', $route.meta.roles)
-                  " type="text" class="textColor" @click="approvalFn(scope.row.id)">审批</el-button>
-                <el-button type="text" class="textColor" v-show="scope.row.examineStatus == 'SAVE'" @click="bringFn(scope.row.id)">提审</el-button>
-                <el-button type="text" class="textColor" v-show="scope.row.examineStatus == 'OK' || scope.row.examineStatus == 'FAIL'" @click="unApprovalFn(scope.row.id)">弃审</el-button>
-                <el-button type="text" class="textColor" @click="detailFn(scope.row.id)">详情</el-button>
+                <el-button v-if="(scope.row.examineStatus == 'WAIT' ||scope.row.examineStatus == 'FAIL') && $checkBtnRole('examine', $route.meta.roles)" type="text" @click="approvalFn(scope.row.id)">审批</el-button>
+                <el-button type="text" v-if="scope.row.examineStatus == 'SAVE'" @click="bringFn(scope.row.id)">提审</el-button>
+                <el-button type="text" v-if="scope.row.examineStatus == 'OK' || scope.row.examineStatus == 'FAIL'" @click="unApprovalFn(scope.row.id)">弃审</el-button>
+                <el-button type="text" v-if="scope.row.examineStatus == 'SAVE'" @click="detailFn(scope.row.id,'edit')">编辑</el-button>
+                <el-button type="text" @click="detailFn(scope.row.id,'detail')">详情</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -137,7 +134,7 @@
     </div>
     <ReceivableListAdd @updateList="updateList" v-else-if="showPage == 2" />
     <ReceivableListApproval :approvalId="approvalId" @updateList="updateList" v-else-if="showPage == 3" />
-    <ReceivableListDetail :approvalId="approvalId" v-else-if="showPage == 4" />
+    <ReceivableListDetail :approvalId="approvalId" :czType='czType' v-else-if="showPage == 4" />
   </div>
 </template>
 
@@ -176,6 +173,7 @@ export default {
       examine: "",
       showPage: 1,
       approvalId: null,
+      czType: "",
       deleList: [],
     };
   },
@@ -296,7 +294,8 @@ export default {
       this.listTotal = res.data.total;
     },
     //详情
-    detailFn(id) {
+    detailFn(id, type) {
+      this.czType = type;
       this.approvalId = id;
       this.showPage = 4;
     },