Browse Source

Merge branch 'feature/Feature-sales' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-sales

howie 3 năm trước cách đây
mục cha
commit
e1bab5db9a

+ 1 - 1
src/api/common.js

@@ -9,7 +9,7 @@ export function getDictList(params) {
   })
 }
 
-// 销售列表
+// 销售类型列表
 export function getTypeList(params) {
   return request({
     url: '/sale/type/list',

+ 18 - 0
src/api/finance/finance_sum.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+// 财务汇总
+export function getFinanceTotal(params) {
+    return request({
+      url: '/finance/total',
+      method: 'get',
+      params
+    })
+  }
+// 产品品类列表
+export function getProductCategoryList(params) {
+    return request({
+      url: '/product-category/list',
+      method: 'get',
+      params
+    })
+  }

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

@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+
+// 其他应收单-新增
+export function getFinanceOtherReceAdd(data) {
+    return request({
+      url: '/finance/other/rece/add',
+      method: 'post',
+      data
+    })
+  }
+// 经销商列表
+export function getCustomerList(params) {
+    return request({
+      url: '/customer/list',
+      method: 'get',
+      params
+    })
+  }
+// 经销商钱包列表
+export function getFinanceCustomerList(params) {
+    return request({
+      url: '/finance/customer/list',
+      method: 'get',
+      params
+    })
+  }
+

+ 2 - 2
src/api/supply/adjust.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 获取列表
 export function getList(params) {
   return request({
-    url: '/transfer/list',
+    url: '/direct/list',
     method: 'get',
     params
   })
@@ -12,7 +12,7 @@ export function getList(params) {
 // 获取详情
 export function getDetail(params) {
   return request({
-    url: '/transfer/detail',
+    url: '/direct/detail',
     method: 'get',
     params
   })

+ 22 - 4
src/api/supply/deliver.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 
-// 获取列表
-export function getList(params) {
+// 获取列表 - 零售发货单
+export function getDeliverList(params) {
   return request({
     url: '/ship/list',
     method: 'get',
@@ -9,11 +9,29 @@ export function getList(params) {
   })
 }
 
-// 获取详情
-export function getDetail(params) {
+// 获取详情 - 零售发货单
+export function getDeliverDetail(params) {
   return request({
     url: '/ship/detail',
     method: 'get',
     params
   })
+}
+
+// 获取列表 - 工程发货单
+export function getEnginList(params) {
+  return request({
+    url: '/ship/listProject',
+    method: 'get',
+    params
+  })
+}
+
+// 获取详情 - 工程发货单
+export function getEnginDetail(params) {
+  return request({
+    url: '/ship/detailProject',
+    method: 'get',
+    params
+  })
 }

+ 17 - 11
src/api/supply/retail.js

@@ -36,15 +36,6 @@ export function examineData(params) {
   })
 }
 
-// 退订
-export function returnData(params) {
-  return request({
-    url: '/retail/return',
-    method: 'post',
-    params
-  })
-}
-
 // 提交审核
 export function submitData(params) {
   return request({
@@ -72,6 +63,15 @@ export function editData(params) {
   })
 }
 
+// 退订
+export function returnData(params) {
+  return request({
+    url: '/retail/tuiding',
+    method: 'post',
+    data: params
+  })
+}
+
 // 获取销售类型列表
 export function getSalesTypeList(params) {
   return request({
@@ -117,5 +117,11 @@ export function checkStock(params) {
   })
 }
 
-
-
+// 直调发货
+export function adjustDeliver(params) {
+  return request({
+    url: '/retail/direct/deliver',
+    method: 'post',
+    data: params
+  })
+}

+ 57 - 47
src/views/basic_data/dealer/dealer_stock.vue

@@ -41,7 +41,7 @@
             size="small"
             class="textColor"
             slot="reference"
-            >删除</el-button
+            >批量删除</el-button
           >
         </el-popconfirm>
       </div>
@@ -176,8 +176,8 @@
     >
       <el-form
         ref="addForm"
-        :rules="rules"
         :model="addForm"
+        :rules="rules"
         label-width="100px"
         label-position="right"
       >
@@ -185,7 +185,7 @@
           <el-select
             class="selectStyle"
             v-model="addForm.customerId"
-            placeholder="名称"
+            placeholder="请选择"
           >
             <el-option
               v-for="item in dealerList"
@@ -200,7 +200,7 @@
           <el-select
             class="selectStyle"
             v-model="addForm.mainId"
-            placeholder="名称"
+            placeholder="请选择"
           >
             <el-option
               v-for="item in categoryList"
@@ -215,7 +215,7 @@
           <el-select
             class="selectStyle"
             v-model="addForm.oneParentId"
-            placeholder="名称"
+            placeholder="请选择"
           >
             <el-option
               v-for="item in oneList"
@@ -230,7 +230,7 @@
           <el-select
             class="selectStyle"
             v-model="addForm.twoParentId"
-            placeholder="名称"
+            placeholder="请选择"
           >
             <el-option
               v-for="item in twoList"
@@ -245,7 +245,7 @@
           ><el-select
             class="selectStyle"
             v-model="addForm.threeParentId"
-            placeholder="名称"
+            placeholder="请选择"
           >
             <el-option
               v-for="item in threeList"
@@ -307,14 +307,26 @@ export default {
         serviceId: "",
         mainId: "",
       },
-      // rules: {
-      //   mainId: [
-      //     { required: true, message: "请选择存货分类", trigger: "change" },
-      //   ],
-      //   customerId: [
-      //     { required: true, message: "请选择经销商", trigger: "change" },
-      //   ],
-      // },
+      rules: {
+        mainId: [
+          { required: true, message: "请选择存货分类", trigger: "blur" },
+        ],
+        customerId: [
+          { required: true, message: "请选择经销商", trigger: "blur" },
+        ],
+        oneParentId: [
+          { required: true, message: "请选择一级区域", trigger: "blur" },
+        ],
+        twoParentId: [
+          { required: true, message: "请选择二级区域", trigger: "blur" },
+        ],
+        threeParentId: [
+          { required: true, message: "请选择三级区域", trigger: "blur" },
+        ],
+        serviceId: [
+          { required: true, message: "请选择业务员", trigger: "blur" },
+        ],
+      },
 
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
@@ -333,6 +345,7 @@ export default {
       threeList: [], //三级区域数据
       userList: [], //业务员
       ids: [],
+      rowID: null, //编辑ID
     };
   },
   async created() {
@@ -373,13 +386,14 @@ export default {
 
     async editFn(id) {
       this.title = "编辑";
+      this.rowID = id;
       let res = await getCustomerPtDetail({ id });
       console.log(res);
       this.addForm.customerId = res.data.customerId;
       this.addForm.mainId = res.data.mainId;
-      this.addForm.oneParentId = res.data.adminWebsitId1;
-      this.addForm.twoParentId = res.data.adminWebsitId2;
-      this.addForm.threeParentId = res.data.adminWebsitId3;
+      this.addForm.oneParentId = res.data.adminWebsitId2;
+      this.addForm.twoParentId = res.data.adminWebsitId3;
+      this.addForm.threeParentId = res.data.adminCompanyId;
       this.addForm.serviceId = res.data.serviceId;
 
       this.dialogForm = true;
@@ -426,30 +440,7 @@ export default {
       this.dialogForm = true;
     },
     async addDataListFn() {
-      // await this.$refs.addForm.validate();
-      // let id = this.dealerList.filter((i) => {
-      //   return i.id === this.addForm.customerId;
-      // })[0];
-      // console.log(id, "id");
-      // let res = findElem(this.dealerList, "id", this.addForm.customerId);
-      // console.log(11111, res);
-      // let res = this.dealerList.filter(
-      //   (v) => v.id === this.addForm.customerId
-      // )[0];
-      // console.log(res);
-      // this.addForm.customerName = res.name;
-      // this.addForm.customerNumber = res.number;
-      // let res2 = this.selectList.filter(
-      //   (v) => v.sysDictId === this.addForm.mainId
-      // )[0];
-      // console.log(res2);
-      // this.addForm.mainName = res2.dictValue;
-      // console.log(this.addForm);
-      // await getDealerStockAdd({ ...this.addForm });
-      // this.$message.success("添加成功");
-      // await this.$refs.addForm.resetFields();
-      // await this.getList({ pageNum: 1, pageSize: 10 });
-
+      await this.$refs.addForm.validate();
       console.log(this.addForm);
       let data = this.dealerList.filter((v) => {
         return v.id === this.addForm.customerId;
@@ -473,18 +464,37 @@ export default {
       };
 
       if (this.title == "编辑") {
-        await getCustomerPtUpdate(value);
+        await getCustomerPtUpdate({ ...value, id: this.rowID });
+
         this.$message.success("编辑成功");
       } else {
         await getDealerStockAdd(value);
         this.$message.success("添加成功");
       }
+      this.addForm.customerId = "";
+      this.addForm.mainId = "";
+      this.addForm.oneParentId = "";
+      this.addForm.twoParentId = "";
+      this.addForm.threeParentId = "";
+      this.addForm.serviceId = "";
+      this.userList = [];
+      this.twoList = [];
+      this.threeList = [];
       this.getList({ pageNum: 1, pageSize: 10 });
       this.dialogForm = false;
     },
     //取消
     async cancelFn() {
-      await this.$refs.addForm.resetFields();
+      await this.$refs.addForm.clearValidate();
+      this.addForm.customerId = "";
+      this.addForm.mainId = "";
+      this.addForm.oneParentId = "";
+      this.addForm.twoParentId = "";
+      this.addForm.threeParentId = "";
+      this.addForm.serviceId = "";
+      this.userList = [];
+      this.twoList = [];
+      this.threeList = [];
       this.dialogForm = false;
     },
     //获取经销商数据
@@ -529,9 +539,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-// ::v-deep .el-popover__reference {
-//   margin-left: 10px;
-// }
+::v-deep .el-popover__reference {
+  margin-left: 10px;
+}
 // ::v-deep .selectStyle .el-input--suffix {
 //   width: 200%;
 // }

+ 200 - 88
src/views/finance/components/receivable_list-add.vue

@@ -22,58 +22,41 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="往来单位类型" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="结算组织" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="单据来源" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="单据编号" prop="">
               <el-input placeholder="请输入"></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="往来单位" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="收款组织" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="备注" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="单据来源" prop="">
+              <el-select v-model="searchForm.source" placeholder="请选择">
+                <el-option value="工程押金"> </el-option>
+                <el-option value="保证金"> </el-option>
+                <el-option value="工程价差"> </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="业务日期" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="币别" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="销售组织" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-date-picker
+                v-model="searchForm.theTime"
+                type="date"
+                placeholder="选择日期"
+                format="yyyy 年 MM 月 dd 日"
+                value-format="yyyy-MM-dd"
+              >
+              </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="到期日" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-date-picker
+                v-model="searchForm.endTime"
+                type="date"
+                placeholder="选择日期"
+                format="yyyy 年 MM 月 dd 日"
+                value-format="yyyy-MM-dd"
+              >
+              </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
@@ -82,43 +65,35 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="部门" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="单据状态" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="申请部门" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="组" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="制单人" prop="">
+              <el-input
+                v-model="searchForm.createBy"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单日期" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                v-model="searchForm.createTime"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="制单人" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="钱包" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="单据状态" prop="">
+              <el-input
+                v-model="searchForm.examineStatus"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="业务员" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="备注" prop="">
+              <el-input
+                v-model="searchForm.remark"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -141,76 +116,156 @@
           <el-table-column
             label="序号"
             align="center"
-            min-width="100"
+            width="100"
+            type="index"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+          </el-table-column>
           <el-table-column
             align="center"
-            label="*费用项目编码"
-            prop=""
+            label="*经销商名称"
+            prop="customerName"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-select
+                @change="changeCustomerFn"
+                v-model="scope.row.customerId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in customerList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="项目费用名称"
-            prop=""
+            label="费用项目编码"
+            prop="projectCode"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.projectCode"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            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="center"
             label="*费用承担部门"
-            prop=""
+            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="center"
+            label="现金钱包"
+            prop="walletId"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-select v-model="scope.row.walletId" placeholder="请选择">
+                <el-option
+                  v-for="item in walletList"
+                  :key="item.walletRebateId"
+                  :label="item.name"
+                  :value="item.walletRebateId"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="*发票类型"
-            prop=""
+            prop="invoiceType"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.invoiceType"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="不含税金额"
-            prop=""
+            prop="afterTaxAmount"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.afterTaxAmount"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="税额"
-            prop=""
+            prop="tax"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.tax"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="总金额"
-            prop=""
+            prop="tax"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.totalAmount"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="备注"
-            prop=""
+            prop="tax"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.tax"></el-input>
+            </template>
+          </el-table-column>
         </el-table>
       </div>
     </div>
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" size="small">提交审核</el-button>
+        <el-button type="primary" size="small" @click="addFn"
+          >提交审核</el-button
+        >
         <el-button type="primary" size="small">重置</el-button>
       </div>
       <div class="fr">
-        <el-button type="primary" size="small">添加行</el-button>
+        <el-button type="primary" size="small" @click="addRowFn"
+          >添加行</el-button
+        >
         <el-button type="primary" size="small">删除行</el-button>
       </div>
     </div>
@@ -218,8 +273,65 @@
 </template>
 
 <script>
+import {
+  getCustomerList,
+  getFinanceCustomerList,
+  getFinanceOtherReceAdd,
+} from "@/api/finance/receivable_list";
 export default {
+  data() {
+    return {
+      searchForm: {
+        source: "",
+        theTime: "",
+      },
+      dataList: [],
+      customerList: [], //经销商数据
+      listLoading: false, // 列表加载loading
+      walletList: [], //现金钱包数据
+    };
+  },
+  created() {
+    this.getCustomerList();
+  },
   methods: {
+    //新增
+    async addFn() {
+      console.log(this.dataList);
+      console.log(this.searchForm);
+      await getFinanceOtherReceAdd({
+        items: this.dataList,
+        ...this.searchForm,
+      });
+    },
+    //选择经销商名称事件
+    async changeCustomerFn(v) {
+      console.log(v);
+      const res = await getFinanceCustomerList({
+        customerId: v,
+        type: "COMMONLY",
+      });
+      this.walletList = res.data;
+    },
+    //获取经销商数据
+    async getCustomerList() {
+      const res = await getCustomerList({ pageNum: 1, pageSize: -1 });
+      this.customerList = res.data.records;
+    },
+    //添加行数据
+    addRowFn() {
+      this.dataList.push({
+        customerId: "",
+        projectCode: "",
+        projectName: "",
+        departmentId: "",
+        walletId: "",
+        invoiceType: "",
+        afterTaxAmount: "",
+        tax: "",
+        totalAmount: "",
+      });
+    },
     goBack() {
       this.$parent.showPage = 1;
     },

+ 54 - 10
src/views/finance/finance_sum.vue

@@ -11,17 +11,30 @@
       >
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="选择品类" prop="">
-              <el-select class="selectStyle" placeholder="请选择">
-                <el-option> </el-option>
+            <el-form-item label="选择品类" prop="mainId">
+              <el-select
+                v-model="searchForm.mainId"
+                class="selectStyle"
+                placeholder="请选择"
+                filterable
+              >
+                <el-option
+                  v-for="v in categoryList"
+                  :key="v.productCategoryNumber"
+                  :label="v.productCategoryName"
+                  :value="v.productCategoryNumber"
+                >
+                </el-option>
               </el-select>
             </el-form-item>
           </el-col>
 
           <el-col :xs="24" :sm="12" :lg="18">
             <el-form-item label="" class="fr">
-              <el-button size="small">清空</el-button>
-              <el-button size="small" type="primary">搜索</el-button>
+              <el-button size="small" @click="clearFn">清空</el-button>
+              <el-button size="small" type="primary" @click="searchFn"
+                >搜索</el-button
+              >
             </el-form-item>
           </el-col>
         </el-row>
@@ -42,28 +55,28 @@
           <el-table-column
             align="center"
             label="品类"
-            prop=""
+            prop="mainName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="钱包名称"
-            prop=""
+            prop="name"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="余额"
-            prop=""
+            prop="totalAmount"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="更新时间"
-            prop=""
+            prop="theTime"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -85,6 +98,10 @@
 </template>
 
 <script>
+import {
+  getFinanceTotal,
+  getProductCategoryList,
+} from "@/api/finance/finance_sum";
 export default {
   data() {
     return {
@@ -92,10 +109,37 @@ export default {
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
       dataList: [], // 列表数据
-      searchForm: {}, //搜索表单
+      searchForm: {
+        mainId: "",
+      }, //搜索表单
       listLoading: false, // 列表加载loading
+      categoryList: [], //品类数据
     };
   },
+  created() {
+    this.getCategoryList();
+    this.getDataList();
+  },
+  methods: {
+    //清空
+    async clearFn() {
+      await this.$refs.searchForm.resetFields();
+    },
+    //搜索
+    searchFn() {
+      this.getDataList({ mainId: this.searchForm.mainId });
+    },
+    //获取品类数据
+    async getCategoryList() {
+      const res = await getProductCategoryList();
+      this.categoryList = res.data;
+    },
+    //获取列表数据
+    async getDataList(data) {
+      const res = await getFinanceTotal(data);
+      this.dataList = res.data;
+    },
+  },
 };
 </script>
 

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

@@ -187,6 +187,7 @@
 </template>
 
 <script>
+import { getFinanceOtherReceAdd } from "@/api/finance/receivable_list";
 import ReceivableListAdd from "./components/receivable_list-add";
 import ReceivableListApproval from "./components/receivable_list-approval";
 import ReceivableListDetail from "./components/receivable_list-detail";

+ 1 - 1
src/views/finance/wallet.vue

@@ -28,7 +28,7 @@
           <el-table-column
             align="center"
             label="钱包类型"
-            prop="type"
+            prop="mainName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>

+ 57 - 67
src/views/supply/adjust/adjust_list.vue

@@ -3,26 +3,29 @@
     <div v-show="!isShowDetail">
       <!-- 筛选条件 -->
       <div class="screen-container">
-        <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
+        <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="订单号" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
+              <el-form-item label="发货单号" prop="deliverNum">
+                <el-input v-model="screenForm.deliverNum" placeholder="请输入发货单号"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="销售政策编号" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入销售政策编号"></el-input>
+              <el-form-item label="订单号" prop="orderNum">
+                <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="销售政策说明" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入销售政策说明"></el-input>
+              <el-form-item label="订单类型" prop="type">
+                <el-select v-model="screenForm.type" placeholder="请选择订单类型">
+                  <el-option label="全部" value=""></el-option>
+                  <el-option :label="item.label" :value="item.value" v-for="(item, index) in typeList" :key="index"></el-option>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="经销商" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入经销商"></el-input>
+              <el-form-item label="经销商" prop="dealer">
+                <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -38,18 +41,8 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="制表人" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入制表人"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="审核人" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入审核人"></el-input>
-              </el-form-item>
-            </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="12" :lg="18" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -67,32 +60,30 @@
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="单据编号" prop="billNo" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单据类型" prop="billType" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="调拨类型" prop="transferBizType" min-width="120" show-overflow-tooltip>
-              <template slot-scope="scope">
-                {{ scope.row.transferBizType | allotTypeFilter }}
-              </template>
-            </el-table-column>
-            <el-table-column align="center" label="申请日期" prop="fDate" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单据状态" prop="documentStatus" min-width="100" show-overflow-tooltip>
+            <el-table-column align="center" label="发货单号" prop="deliverNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="发货日期" prop="deliverDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="仓库" prop="correspondName" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单类型" prop="orderType" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{ scope.row.documentStatus | orderStatusFilter }}
+                {{ scope.row.orderType | typeFilter }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="关闭状态" prop="cancelStatus" min-width="100" show-overflow-tooltip>
+            <el-table-column align="center" label="订单号" prop="orderNo" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="specification" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="直调数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="价税合计" prop="mustTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="无税金额" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{ scope.row.cancelStatus | closeStatusFilter }}
+                {{ scope.row.qty * scope.row.afterTaxPrice }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="物料名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="规格型号" prop="model" min-width="240" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="辅助属性" prop="auxPropId" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单位" prop="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="申请数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="调出仓库" prop="srcStockId" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="调入仓库" prop="destStockId" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制表人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="100" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
@@ -125,31 +116,16 @@
 import { getList } from "@/api/supply/adjust";
 import AdjustDetail from "@/views/supply/adjust/components/adjust_detail";
 
+let that
 export default {
   components: {
     AdjustDetail,
   },
   filters: {
-    allotTypeFilter(val) {
-      const MAP = {
-        InnerOrgTransfer: '组织内调拨',
-        OverOrgTransfer: '跨组织调拨',
-      }
-      return MAP[val];
-    },
-    closeStatusFilter(val) {
-      const MAP = {
-        A: '正常',
-        B: '作废',
-      }
-      return MAP[val];
-    },
-    orderStatusFilter(val) {
-      const MAP = {
-        C: '审核',
-      }
-      return MAP[val];
-    },
+    typeFilter(val) {
+      let obj = that.typeList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
   },
   data() {
     return {
@@ -160,11 +136,20 @@ export default {
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
         orderNum: '',
-        wlName: '',
+        deliverNum: '',
+        type: '',
+        dealer: '',
         date: '',
       },
-
+      typeList: [
+        { label: '商用工程订单', value: 'TRADE' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '零售订单', value: 'RETAIL' },
+        { label: '销售政策订单', value: 'RETAIL_POLICY' },
+      ],
+      
       queryItem: {},
+      isShowDetail: false,
     }
   },
 
@@ -177,9 +162,10 @@ export default {
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       }
     },
-    isShowDetail() {
-      return this.queryItem.hasOwnProperty('id');
-    },
+  },
+
+  beforeCreate() {
+    that = this;
   },
 
   created() {
@@ -203,8 +189,10 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        billNo: this.screenForm.orderNum,
-        materialName: this.screenForm.wlName,
+        orderNo: this.screenForm.orderNum,
+        deliverNo: this.screenForm.deliverNum,
+        customerName: this.screenForm.dealer,
+        orderType: this.screenForm.type,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       };
@@ -244,10 +232,12 @@ export default {
     // 进入详情
     toDetail(item) {
       this.queryItem = item;
+      this.isShowDetail = true;
     },
 
     backList() {
       this.queryItem = {};
+      this.isShowDetail = false;
     },
   }
 }

+ 81 - 25
src/views/supply/adjust/components/adjust_detail.vue

@@ -4,52 +4,96 @@
 
     <div id="printData">
       <div class="main-title">
-        <div class="title">调拨单</div>
+        <div class="title">发货单信息</div>
       </div>
 
       <div class="diy-table-1">
         <el-row>
           <el-col :span="8" class="item">
-            <div class="label">单据编号:</div>
-            <div class="value">{{detailData.billNo}}</div>
+            <div class="label">直调发货单</div>
+            <div class="value">{{detailData.id}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">日期</div>
-            <div class="value">{{detailData.fdate}}</div>
+            <div class="label">发货日期</div>
+            <div class="value">{{detailData.deliverDate}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">转出仓库:</div>
-            <div class="value">{{detailData.srcStockId}}</div>
+            <div class="label">单据状态</div>
+            <div class="value">已受理</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">转入仓库:</div>
-            <div class="value">{{detailData.destStockId}}</div>
+            <div class="label">订单号</div>
+            <div class="value">{{detailData.orderNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">审核日期:</div>
-            <div class="value">{{detailData.approveDate}}</div>
+            <div class="label">订单类型</div>
+            <div class="value">{{detailData.orderType | typeFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">审核人:</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">经销商名称</div>
+            <div class="value">{{detailData.customerName}}</div>
           </el-col>
-          <el-col :span="24" class="item">
-            <div class="label">备注:</div>
-            <div class="value">{{detailData.note}}</div>
+          <el-col :span="8" class="item">
+            <div class="label">业务员</div>
+            <div class="value">{{detailData.serviceName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">工程编号</div>
+            <div class="value">{{detailData.projectNo}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">币种</div>
+            <div class="value">{{detailData.amountType}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">仓库</div>
+            <div class="value">{{detailData.correspondName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">仓位</div>
+            <div class="value">{{detailData.stockName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">台账备注</div>
+            <div class="value">{{detailData.aaa}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">项目名称</div>
+            <div class="value">{{detailData.projectName}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">备注</div>
+            <div class="value">{{detailData.remark}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">厂工程编码</div>
+            <div class="value">{{detailData.factoryNo}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">文件编号</div>
+            <div class="value">{{detailData.fileNo}}</div>
           </el-col>
         </el-row>
       </div>
 
+      <div class="main-title">
+        <div class="title">货品信息</div>
+      </div>
+
       <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.kingDeeTransferItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table :data="detailData.items" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="物料编号" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="物料名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="规格型号" prop="model" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="主计量单位" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单价" prop="consignPrice" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="金额" prop="consignAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编号" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单位" prop="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="申请数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="含税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="价税合计" prop="mustTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率(%)" prop="taxRate" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣额" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="厂产品代码" prop="consignAmount" min-width="100" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
       
@@ -78,6 +122,18 @@ export default {
   directives: {
     print
   },
+  filters: {
+    typeFilter(val) {
+      const typeList = [
+        { label: '商用工程订单', value: 'TRADE' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '零售订单', value: 'RETAIL' },
+        { label: '销售政策订单', value: 'RETAIL_POLICY' },
+      ];
+      let obj = typeList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
   data() {
     return {
       printObj: {
@@ -111,7 +167,7 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getDetail({id: this.listItem.deliverNo}).then(res => {
         this.detailData = res.data;
       })
     },

+ 2 - 2
src/views/supply/deliver/components/deliver_detail.vue

@@ -159,7 +159,7 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getDetail } from "@/api/supply/return";
+import { getDeliverDetail } from "@/api/supply/return";
 
 export default {
   name: 'DeliverDetail',
@@ -201,7 +201,7 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getDeliverDetail({id: this.listItem.id}).then(res => {
         this.detailData = res.data;
       })
     },

+ 2 - 2
src/views/supply/deliver/components/engin_detail.vue

@@ -159,7 +159,7 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getDetail } from "@/api/supply/return";
+import { getEnginDetail } from "@/api/supply/return";
 
 export default {
   name: 'EnginDetail',
@@ -201,7 +201,7 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getEnginDetail({id: this.listItem.id}).then(res => {
         this.detailData = res.data;
       })
     },

+ 4 - 6
src/views/supply/deliver/deliver_list.vue

@@ -107,7 +107,7 @@
 
 <script>
 import { COMMON_SELECT } from '@/utils/select_data'
-import { getList } from "@/api/supply/deliver";
+import { getDeliverList } from "@/api/supply/deliver";
 import DeliverDetail from "@/views/supply/deliver/components/deliver_detail";
 
 export default {
@@ -137,14 +137,13 @@ export default {
   computed: {
     exParams() {
       return {
-        retreatOrderNo: this.screenForm.orderNum,
+        id: this.screenForm.orderNum,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 1, // 1:发货单,2:工程发货单
       }
     },
     isShowDetail() {
@@ -173,16 +172,15 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        retreatOrderNo: this.screenForm.orderNum,
+        id: this.screenForm.orderNum,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 1, // 1:发货单,2:工程发货单
       };
-      getList(params).then((res) => {
+      getDeliverList(params).then((res) => {
         this.dataList = res.data.records;
         this.listTotal = res.data.total;
         this.listLoading = false;

+ 6 - 6
src/views/supply/deliver/engin_list.vue

@@ -135,7 +135,7 @@
 
 <script>
 import { COMMON_SELECT } from '@/utils/select_data'
-import { getList } from "@/api/supply/deliver";
+import { getEnginList } from "@/api/supply/deliver";
 import EnginDetail from "@/views/supply/deliver/components/engin_detail";
 
 export default {
@@ -170,14 +170,14 @@ export default {
   computed: {
     exParams() {
       return {
-        retreatOrderNo: this.screenForm.orderNum,
+        id: this.screenForm.orderNum,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 2, // 1:发货单,2:工程发货单
+        orderType: 2, // 2家用工程 3商用工程
       }
     },
     isShowDetail() {
@@ -206,16 +206,16 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        retreatOrderNo: this.screenForm.orderNum,
+        id: this.screenForm.orderNum,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 2, // 1:发货单,2:工程发货单
+        orderType: 2, // 2家用工程 3商用工程
       };
-      getList(params).then((res) => {
+      getEnginList(params).then((res) => {
         this.dataList = res.data.records;
         this.listTotal = res.data.total;
         this.listLoading = false;

+ 97 - 44
src/views/supply/retail/components/retail_detail.vue

@@ -77,10 +77,10 @@
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利类型" prop="walletRebateName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="返利钱包" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="格力折扣" prop="deductAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="现金钱包" prop="walletRebateName2" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -118,20 +118,15 @@
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
+        <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK'">直调发货</el-button>
         <el-button @click="goBack">关 闭</el-button>
       </div>
     </div>
 
     <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
-      <el-form ref="deliverForm" :model="deliverForm" label-width="70px" size="small" label-position="left">
+      <el-form ref="deliverForm" :model="deliverForm" :rules="deliverFormRules" label-width="80px" size="small" label-position="left">
         <el-row :gutter="20">
-          <el-col :xs="24" :sm="8" :lg="8">
-            <el-form-item label="工程订单" prop="orderNum">
-              <el-input v-model="deliverForm.orderNum" placeholder="请输入工程订单"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="8" :lg="8" style="height: 51px;">
+          <el-col :xs="8" :sm="8" :lg="8" style="height: 51px;">
             <el-form-item label="发货日期" prop="date">
               <el-date-picker
                 v-model="deliverForm.date"
@@ -142,15 +137,17 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="8" :lg="8">
+          <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="发货仓库" prop="warehouse">
-              <el-select v-model="deliverForm.warehouse" placeholder="请选择发货仓库">
-                <el-option
-                  v-for="item in warehouseList"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select v-model="deliverForm.warehouse" placeholder="请选择发货仓库" style="width: 100%" filterable @change="changeWarehouse">
+                <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="8" :sm="8" :lg="8">
+            <el-form-item label="选择仓位" prop="position">
+              <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
+                <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
@@ -158,30 +155,25 @@
       </el-form>
 
       <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.retailOrderItemList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="返利类型" prop="walletRebateName" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="格力折扣" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="现金钱包" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{scope.row.isDirectTransfer ? '是':'否'}}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="原订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="税率" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="直调数量" prop="adjustNum" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.adjustNum" size="small" type="number"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="返利" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
@@ -194,7 +186,7 @@
 </template>
 
 <script>
-import { getDetail } from "@/api/supply/retail";
+import { getDetail, getWarehouseList, adjustDeliver } from "@/api/supply/retail";
 
 export default {
   name: 'RetailDetail',
@@ -218,10 +210,25 @@ export default {
 
       isShowDeliverDialog: false,
       deliverForm: {
-        orderNum: '',
         date: '',
+        warehouse: '',
+        position: '',
+      },
+      deliverFormRules: {
+        date: [
+          { required: true, message: '请选择发货日期', trigger: 'change' }
+        ],
+        warehouse: [
+          { required: true, message: '请选择发货仓库', trigger: 'change' }
+        ],
+        position: [
+          { required: true, message: '请选择仓位', trigger: 'change' }
+        ],
       },
       warehouseList: [],
+      positionList: [],
+
+      goodsList: [],
     }
   },
 
@@ -261,9 +268,28 @@ export default {
       })
     },
 
+    // 获取仓库列表
+    getWarehouseList() {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then(res => {
+        this.warehouseList = res.data.records;
+      })
+    },
+
+    // 更改仓库
+    changeWarehouse() {
+      this.deliverForm.position = '';
+      let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse);
+      this.positionList = obj.kingDeeStocks;
+    },
+
     // 打开 直调发货
     openDeliverDialog() {
       this.isShowDeliverDialog = true;
+      this.goodsList = this.detailData.retailOrderItemList;
+      this.getWarehouseList();
     },
 
     // 关闭 直调发货
@@ -273,7 +299,34 @@ export default {
 
     // 提交 直调发货
     submitDeliverForm() {
-
+      this.$refs.deliverForm.validate((valid) => {
+        if (valid) {
+          for(let i=0; i<this.goodsList.length; i++) {
+            if(!this.goodsList[i].adjustNum) {
+              this.$errorMsg('请输入直调数量');
+              return;
+            }
+          }
+          let goodsList = this.goodsList.map((item) => {
+            return {
+              itemId: item.id,
+              qty: item.adjustNum,
+            }
+          });
+          let params = {
+            orderNo: this.listItem.id,
+            orderDate: this.deliverForm.date + ' 00:00:00',
+            correspondId: this.deliverForm.warehouse,
+            stockId: this.deliverForm.position,
+            directItems: goodsList
+          }
+          adjustDeliver(params).then(res => {
+            this.$successMsg();
+            this.isShowDeliverDialog = false;
+            this.getDetail();
+          })
+        }
+      })
     },
 
   }

+ 1 - 1
src/views/supply/retail/components/retail_form.vue

@@ -164,7 +164,7 @@
         <el-row :gutter="20">
           <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item prop="type">
-              <el-select v-model="screenForm.type" placeholder="选择品类" style="width: 100%">
+              <el-select v-model="mainForm.type" placeholder="选择品类" style="width: 100%">
                 <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
               </el-select>
             </el-form-item>

+ 26 - 9
src/views/supply/retail/components/retail_return.vue

@@ -58,10 +58,10 @@
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利类型" prop="walletRebateName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="返利钱包" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="格力折扣" prop="deductAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="现金钱包" prop="walletRebateName2" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -69,7 +69,12 @@
           </template>
         </el-table-column>
         <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.tdQty" size="small" type="number"></el-input>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>
@@ -88,10 +93,10 @@
           <div class="label">退订日期</div>
           <div class="value">{{nowDate}}</div>
         </el-col>
-        <el-col :span="24" class="item">
+        <!-- <el-col :span="24" class="item">
           <div class="label">退订说明</div>
           <div class="value"><el-input v-model="mainForm.remark" placeholder="请输入内容"></el-input></div>
-        </el-col>
+        </el-col> -->
       </el-row>
     </div>
     
@@ -131,7 +136,6 @@ export default {
 
       formLoading: false,
       mainForm: {
-        status: true,
         remark: '',
       }
     }
@@ -181,13 +185,26 @@ export default {
       })
     },
 
-    // 提交审批
+    // 提交
     clickSubmitForm() {
+      for(let i=0; i<this.detailData.retailOrderItemList.length; i++) {
+        if(this.detailData.retailOrderItemList[i].tdQty === '' || this.detailData.retailOrderItemList[i].tdQty === null) {
+          this.$errorMsg('请填写退订数量');
+          return;
+        }
+        if(Number(this.detailData.retailOrderItemList[i].tdQty) < 0) {
+          this.$errorMsg('退订数量不可为负数');
+          return;
+        }
+      }
+
       this.formLoading = true;
       returnData({
         id: this.listItem.id,
-        examineStatus: this.mainForm.status ? 'OK' : 'FAIL',
-        examineRemark: this.mainForm.remark,
+        type: 1, // 1:普通零售单,2:政策零售单
+        // examineRemark: this.mainForm.remark,
+        theTime: this.detailData.theTime,
+        retailOrderItemList: this.detailData.retailOrderItemList
       }).then(res => {
         this.$successMsg('退订成功');
         this.goBack();

+ 2 - 2
src/views/supply/retail/retail_list.vue

@@ -93,9 +93,9 @@
                 {{scope.row.isDirectTransfer ? '是':'否'}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="总数量" prop="totalQty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="出库数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="出库数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="返利使用比例" prop="rebateRate" min-width="110" show-overflow-tooltip></el-table-column>