Browse Source

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie 3 years ago
parent
commit
fb0f7526fd
29 changed files with 2078 additions and 415 deletions
  1. 9 0
      src/api/basicData/inventoryAccount.js
  2. 53 0
      src/api/dealer/purchase.js
  3. 61 0
      src/api/dealer/sales.js
  4. 16 2
      src/components/finance/config/option.json
  5. 34 2
      src/components/finance/financialAccount.vue
  6. 55 26
      src/components/price-Library/main.vue
  7. 10 0
      src/util/date.js
  8. 4 4
      src/views/basicData/customerInformation/configuration/addressOption.json
  9. 1 13
      src/views/basicData/customerInformation/configuration/customerContact.json
  10. 0 5
      src/views/basicData/customerInformation/detailsPageEdit.vue
  11. 4 4
      src/views/basicData/customerManagement/companyMaterial/configuration/addressOption.json
  12. 2 9
      src/views/basicData/customerManagement/companyMaterial/configuration/customerContact.json
  13. 4 4
      src/views/basicData/customerManagement/supplierMaterial/configuration/addressOption.json
  14. 2 9
      src/views/basicData/customerManagement/supplierMaterial/configuration/customerContact.json
  15. 82 37
      src/views/basicData/productInformation/detailsPageEdit.vue
  16. 5 7
      src/views/businessManagement/salesOrder/detailsPageEdit.vue
  17. 1 1
      src/views/dealer/purchase/config/commodity.json
  18. 33 5
      src/views/dealer/purchase/config/customerContact.json
  19. 2 2
      src/views/dealer/purchase/config/mainList.json
  20. 606 79
      src/views/dealer/purchase/detail.vue
  21. 31 51
      src/views/dealer/purchase/index.vue
  22. 1 1
      src/views/dealer/sales/config/commodity.json
  23. 31 9
      src/views/dealer/sales/config/customerContact.json
  24. 6 6
      src/views/dealer/sales/config/mainList.json
  25. 615 104
      src/views/dealer/sales/detail.vue
  26. 33 35
      src/views/dealer/sales/index.vue
  27. 8 0
      src/views/dealer/stock/config/mainList.json
  28. 350 0
      src/views/statisticAnalysis/payment/index.vue
  29. 19 0
      src/views/wel/components/quick-launch.vue

+ 9 - 0
src/api/basicData/inventoryAccount.js

@@ -57,3 +57,12 @@ export const getStock = (current, size, params) => {
     }
   })
 }
+
+// 库存账获得详情
+export function getDetail(data) {
+  return request({
+    url: '/api/blade-stock/stockgoods/message',
+    method: 'get',
+    params: data
+  })
+}

+ 53 - 0
src/api/dealer/purchase.js

@@ -0,0 +1,53 @@
+import request from '@/router/axios';
+
+//采购资料列表查询
+export function getPurchaseList(params) {
+  return request({
+    url: '/api/trade-purchase/dealer/purchaseOrder/list',
+    method: 'get',
+    params
+  })
+}
+//采购资料列表删除
+export function deleteDetails(data) {
+  return request({
+    url: '/api/trade-purchase/dealer/purchaseOrder/remove',
+    method: 'post',
+    params: {
+      ids:data
+    }
+  })
+}
+//采购资料列表查看明细
+export function dataDetail(data) {
+  return request({
+    url: '/api/trade-purchase/dealer/purchaseOrder/'+data,
+    method: 'get'
+  })
+}
+//采购资料列表修改和新增
+export function typeSave(data) {
+  return request({
+    url: '/api/trade-purchase/dealer/purchaseOrder/submit',
+    method: 'post',
+    data
+  })
+}
+//商品从表列表删除
+export function removeGoods(data) {
+  return request({
+    url: '/api/trade-purchase/dealer/purchaseOrder/removeByItem',
+    method: 'post',
+    data: {
+      id:data
+    }
+  })
+}
+//采购确认或取消订单
+export function dealerSubmit(params) {
+  return request({
+    url: '/api/trade-purchase/dealer/purchaseOrder/dealerSubmit',
+    method: 'get',
+    params
+  })
+}

+ 61 - 0
src/api/dealer/sales.js

@@ -0,0 +1,61 @@
+import request from '@/router/axios';
+
+//列表查询
+export function getSalesList(params) {
+  return request({
+    url: '/api/blade-purchase-sales/dealerOrder/page',
+    method: 'get',
+    params
+  })
+}
+//修改和保存
+export function typeSave(data) {
+  return request({
+    url: '/api/blade-purchase-sales/dealerOrder/submit',
+    method: 'post',
+    data
+  })
+}
+//查看详情
+export function dataDetail(data) {
+  return request({
+    url: '/api/blade-purchase-sales/dealerOrder/detail?id='+data,
+    method: 'get'
+  })
+}
+//列表删除
+export function deleteDetails(data) {
+  return request({
+    url: '/api/blade-purchase-sales/dealerOrder/update',
+    method: 'post',
+    data: {
+      id: data
+    }
+  })
+}
+//商品从表列表删除
+export function removeGoods(data) {
+  return request({
+    url: '/api/blade-purchase-sales/orderitems/update',
+    method: 'post',
+    data: {
+      id:data
+    }
+  })
+}
+//列表查询
+export function getLotNo(params) {
+  return request({
+    url: '/api/blade-purchase-sales/dealerOrder/lotNo',
+    method: 'get',
+    params
+  })
+}
+//确认或取消订单
+export function dealerSubmit(params) {
+  return request({
+    url: '/api/blade-purchase-sales/dealerOrder/dealerSubmit',
+    method: 'get',
+    params
+  })
+}

+ 16 - 2
src/components/finance/config/option.json

@@ -100,11 +100,17 @@
       ]
     },
     {
+      "label": "数量",
+      "prop": "quantity",
+      "index": 6,
+      "width": 120,
+      "overHidden": true
+    },
+    {
       "label": "单价",
       "prop": "price",
       "overHidden": true,
       "index": 7,
-      "cell": true,
       "width": 120
     },
     {
@@ -152,10 +158,18 @@
       "width": 120
     },
     {
+      "label": "商品名称",
+      "prop": "cname",
+      "overHidden": true,
+      "index": 12,
+      "value": 0,
+      "width": 120
+    },
+    {
       "label": "备注",
       "prop": "remarks",
       "overHidden": true,
-      "index": 12,
+      "index": 13,
       "cell": true,
       "width": 150
     }

+ 34 - 2
src/components/finance/financialAccount.vue

@@ -47,7 +47,7 @@
           <span v-else>{{corpsName}}</span>
         </template>
         <template slot-scope="{row,index}" slot="costType">
-          <span v-if="row.$cellEdit" class="required_fields">*</span>
+<!--          <span v-if="row.$cellEdit" class="required_fields">*</span>-->
           <breakdown-select
             v-if="row.$cellEdit"
             v-model="row.costType"
@@ -99,6 +99,30 @@
           </el-select>
           <span v-else>{{ row.unit }}</span>
         </template>
+        <template slot-scope="{row,index}" slot="price">
+          <el-input-number
+            v-if="row.$cellEdit"
+            v-model="row.price"
+            size="small"
+            :controls="false"
+            :precision="2"
+            @input="amountChange(row)"
+            style="width: 100%"
+          />
+          <span v-else>{{ row.price }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="quantity">
+          <el-input-number
+            v-if="row.$cellEdit"
+            v-model="row.quantity"
+            size="small"
+            :controls="false"
+            :precision="0"
+            @input="amountChange(row)"
+            style="width: 100%"
+          />
+          <span v-else>{{ row.quantity }}</span>
+        </template>
       </avue-crud>
       <div class="dialogButton">
         <el-button size="small" :loading="submitButton" @click="$emit('choceFun')">取消</el-button>
@@ -230,7 +254,6 @@
           this.billData = this.arrList[0]
           this.corpId = this.arrList[0].corpId
           this.corpsName = this.arrList[0].corpsName[0].cname
-          console.log(this.billData)
           this.arrList.forEach(item=>{
             this.$refs.crud.rowCellAdd(item);
           })
@@ -381,6 +404,15 @@
       resetColumn(){
 
       },
+      amountChange(row) {
+        if (!row.quantity) {
+          row.quantity = 0;
+        }
+        if (!row.price) {
+          row.price = 0;
+        }
+        row.amount = Number(row.price) * Number(row.quantity)
+      },
     }
   }
 </script>

+ 55 - 26
src/components/price-Library/main.vue

@@ -12,32 +12,44 @@
       v-dialog-drag
     >
       <span>
-        <avue-crud
-          ref="crud"
-          :data="data"
-          :option="tableOption"
-          :page.sync="page"
-          :search.sync="search"
-          @search-change="searchChange"
-          @current-change="currentChange"
-          @size-change="sizeChange"
-          @refresh-change="refreshChange"
-          @on-load="getList"
-          @saveColumn="saveColumn"
-          @selection-change="selectionChange"
-          :cell-style="cellStyle"
-          :table-loading="loading"
-        >
-          <template slot="cnameSearch">
-            <goods-select
-              v-model="search.cname"
-              :configuration="goodsConfiguration"
+        <el-row>
+          <el-col :span="4">
+            <avue-tree
+              :option="treeOption"
+              :data="treeData"
+              @node-click="nodeClick"
+              style="height:74vh"
             />
-          </template>
-          <template slot="corpId" slot-scope="{ row }">
-            <span>{{ row.corpName }}</span>
-          </template>
-        </avue-crud>
+          </el-col>
+          <el-col :span="20">
+            <avue-crud
+              ref="crud"
+              :data="data"
+              :option="tableOption"
+              :page.sync="page"
+              :search.sync="search"
+              @search-change="searchChange"
+              @current-change="currentChange"
+              @size-change="sizeChange"
+              @refresh-change="refreshChange"
+              @on-load="getList"
+              @saveColumn="saveColumn"
+              @selection-change="selectionChange"
+              :cell-style="cellStyle"
+              :table-loading="loading"
+            >
+              <template slot="cnameSearch">
+                <goods-select
+                  v-model="search.cname"
+                  :configuration="goodsConfiguration"
+                />
+              </template>
+              <template slot="corpId" slot-scope="{ row }">
+                <span>{{ row.corpName }}</span>
+              </template>
+            </avue-crud>
+          </el-col>
+        </el-row>
       </span>
       <span slot="footer" class="dialog-footer">
         <el-button @click="visible = false">取 消</el-button>
@@ -60,6 +72,17 @@ import _ from "lodash";
 export default {
   data() {
     return {
+      treeForm:{},
+      treeOption: {
+        addBtn: false,
+        menu: false,
+        filter: false,
+        size: "small",
+        props: {
+          label: "cname",
+          value: "cname"
+        }
+      },
       visible: false,
       loading: true,
       data: [],
@@ -81,7 +104,8 @@ export default {
         clearable: true
       },
       partType: false,
-      partreData: false
+      partreData: false,
+      treeData: []
     };
   },
   props: {},
@@ -90,6 +114,7 @@ export default {
     getGoodstype(1, 500).then(res => {
       this.findObject(this.tableOption.column, "goodsTypeName").dicData =
         res.data.data.records;
+      this.treeData = res.data.data.records;
     });
   },
   methods: {
@@ -102,6 +127,10 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
+    nodeClick(data) {
+      this.search.goodsTypeName = data.cname;
+      this.getList(this.page, this.search);
+    },
     importData() {
       if (this.partreData) {
         if (this.selectionList.length != 1) {

+ 10 - 0
src/util/date.js

@@ -72,3 +72,13 @@ export function defaultDate(type) {
     ];
   }
 }
+// 获得当前日期
+export function getCurrentDate(type = 'dateTime') {
+  const date = new Date();
+  const currentDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
+  if (type == 'date') {
+    return dateFormat(currentDate, 'yyyy-MM-dd')
+  } else if (type == 'dateTime') {
+    return dateFormat(currentDate, 'yyyy-MM-dd') + ' 00:00:00'
+  }
+}

+ 4 - 4
src/views/basicData/customerInformation/configuration/addressOption.json

@@ -23,7 +23,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入地址",
           "trigger": "blur"
         }
       ]
@@ -36,7 +36,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入联系人",
           "trigger": "blur"
         }
       ]
@@ -49,7 +49,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入电话",
           "trigger": "blur"
         }
       ]
@@ -62,7 +62,7 @@
       "rules": [
         {
           "required": false,
-          "message": "请输入账户名称",
+          "message": "请输入备注",
           "trigger": "blur"
         }
       ]

+ 1 - 13
src/views/basicData/customerInformation/configuration/customerContact.json

@@ -54,19 +54,7 @@
       "label": "手机号",
       "prop": "tel",
       "index": 4,
-      "width":180,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入手机号",
-          "trigger": "blur"
-        },
-        {
-          "pattern": "",
-          "message": "手机号格式错误",
-          "trigger": "blur"
-        }
-      ]
+      "width":180
     },{
       "label": "邮箱",
       "prop": "email",

+ 0 - 5
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -675,11 +675,6 @@ export default {
         }
       }
     }
-    this.customerContact.column.map(item => {
-      if (item.prop == "tel") {
-        item.rules[1].pattern = /^1[3-9]\d{9}$/;
-      }
-    });
     corpstypeTree({ corpType: customerParameter.code }).then(res => {
       this.dic = res.data.data;
     });

+ 4 - 4
src/views/basicData/customerManagement/companyMaterial/configuration/addressOption.json

@@ -23,7 +23,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入地址",
           "trigger": "blur"
         }
       ]
@@ -36,7 +36,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入联系人",
           "trigger": "blur"
         }
       ]
@@ -49,7 +49,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入电话",
           "trigger": "blur"
         }
       ]
@@ -62,7 +62,7 @@
       "rules": [
         {
           "required": false,
-          "message": "请输入账户名称",
+          "message": "请输入备注",
           "trigger": "blur"
         }
       ]

+ 2 - 9
src/views/basicData/customerManagement/companyMaterial/configuration/customerContact.json

@@ -51,17 +51,10 @@
       ]
     },
     {
-      "label": "电话",
+      "label": "手机号",
       "prop": "tel",
       "index": 4,
-      "width":180,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入电话",
-          "trigger": "blur"
-        }
-      ]
+      "width":180
     },
     {
       "label": "性别",

+ 4 - 4
src/views/basicData/customerManagement/supplierMaterial/configuration/addressOption.json

@@ -23,7 +23,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入地址",
           "trigger": "blur"
         }
       ]
@@ -36,7 +36,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入联系人",
           "trigger": "blur"
         }
       ]
@@ -49,7 +49,7 @@
       "rules": [
         {
           "required": true,
-          "message": "请输入账户名称",
+          "message": "请输入电话",
           "trigger": "blur"
         }
       ]
@@ -62,7 +62,7 @@
       "rules": [
         {
           "required": false,
-          "message": "请输入账户名称",
+          "message": "请输入备注",
           "trigger": "blur"
         }
       ]

+ 2 - 9
src/views/basicData/customerManagement/supplierMaterial/configuration/customerContact.json

@@ -51,17 +51,10 @@
       ]
     },
     {
-      "label": "电话",
+      "label": "手机号",
       "prop": "tel",
       "index": 4,
-      "width":180,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入电话",
-          "trigger": "blur"
-        }
-      ]
+      "width":180
     },
     {
       "label": "性别",

+ 82 - 37
src/views/basicData/productInformation/detailsPageEdit.vue

@@ -75,6 +75,30 @@
               placeholder="请输入 兑换积分"
             ></el-input>
           </template>
+          <template slot="batch">
+            <el-switch
+              v-model="form.batch"
+              active-text="是"
+              inactive-text="否"
+              :active-value="1"
+              :inactive-value="0"
+            />
+          </template>
+          <template slot="unit">
+            <el-select
+              v-model="form.unit"
+              clearable
+              filterable
+              placeholder="请选择 计量单位"
+            >
+              <el-option
+                v-for="(item, index) in unitOption"
+                :key="index"
+                :label="item.dictValue"
+                :value="item.dictValue"
+              />
+            </el-select>
+          </template>
         </avue-form>
       </basic-container>
     </div>
@@ -109,7 +133,7 @@ export default {
       detailsSelect: {},
       option: {
         menuBtn: false,
-        labelWidth: 100,
+        labelWidth: 110,
         column: [
           {
             label: "产品编码",
@@ -149,8 +173,8 @@ export default {
             ]
           },
           {
-            label: "花纹",
-            prop: "brandItem",
+            label: "规格",
+            prop: "typeno", //specs
             span: 8,
             rules: [
               {
@@ -161,8 +185,8 @@ export default {
             ]
           },
           {
-            label: "品牌",
-            prop: "brand",
+            label: "规格1(花纹)",
+            prop: "brandItem",
             span: 8,
             rules: [
               {
@@ -173,24 +197,25 @@ export default {
             ]
           },
           {
-            label: "状态",
-            prop: "status",
-            span: 8,
-            type: "select",
-            dicData: [
-              {
-                label: "正常",
-                value: 0
-              },
+            label: "规格2(尺寸)",
+            prop: "size",
+            span: 8
+          },
+          {
+            label: "供应商",
+            prop: "corpId",
+            span:16,
+            rules: [
               {
-                label: "停用",
-                value: 1
+                required: true,
+                message: " ",
+                trigger: "blur"
               }
             ]
           },
           {
-            label: "规格",
-            prop: "typeno", //specs
+            label: "品牌",
+            prop: "brand",
             span: 8,
             rules: [
               {
@@ -201,31 +226,31 @@ export default {
             ]
           },
           {
-            label: "负荷指数",
+            label: "级别(负荷指数)",
             prop: "specsOne",
             span: 8,
             rules: [
               {
-                required: true,
+                required: false,
                 message: " ",
                 trigger: "blur"
               }
             ]
           },
           {
-            label: "速级",
+            label: "级别2(速级)",
             prop: "specsTwo",
             span: 8,
             rules: [
               {
-                required: true,
+                required: false,
                 message: " ",
                 trigger: "blur"
               }
             ]
           },
           {
-            label: "加强型",
+            label: "级别3(加强型)",
             prop: "level",
             span: 8,
             rules: [
@@ -273,23 +298,32 @@ export default {
             ]
           },
           {
-            label: "供应商",
-            prop: "corpId",
-             span:16,
-            rules: [
-              {
-                required: true,
-                message: " ",
-                trigger: "blur"
-              }
-            ]
+            label: "计量单位",
+            prop: "unit",
+            span: 8
           },
           {
-            label: "三包",
-            prop: "threeGuarantees",
+            label: "辅助单位",
+            prop: "assistUnit",
             span: 8
           },
           {
+            label: "状态",
+            prop: "status",
+            span: 8,
+            type: "select",
+            dicData: [
+              {
+                label: "正常",
+                value: 0
+              },
+              {
+                label: "停用",
+                value: 1
+              }
+            ]
+          },
+          {
             label: "积分倍数",
             prop: "integralMultiples",
             span: 8
@@ -300,6 +334,11 @@ export default {
             span: 8
           },
           {
+            label: "按批次号计算",
+            prop: "batch",
+            span: 8
+          },
+          {
             label: "备注",
             prop: "remarks",
             type: "textarea",
@@ -307,17 +346,22 @@ export default {
             span: 24
           }
         ]
-      }
+      },
+      unitOption: [], //计量单位数组
     };
   },
   //初始化查询
   created() {
+    this.getWorkDicts('unit').then(res => {
+      this.unitOption = res.data.data;
+    })
     this.$set(this.form, 'status', 0)
     getDeptTree().then(res => {
       this.dicData = res.data.data;
     });
     this.$set(this.form, 'integralMultiples', 1)
     this.$set(this.form, 'integral', 0)
+    this.$set(this.form, 'batch', 0)
     if (this.detailData.id) {
       this.queryData(this.detailData.id)
     } else {
@@ -351,7 +395,8 @@ export default {
     },
     //修改提交触发
     editProductInfo() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid, done) => {
+        done();
         //校验明细列表
         if (valid) {
           this.configuration.dicData.forEach(e => {

+ 5 - 7
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -478,8 +478,8 @@
                        @on-load="onLoad">
               <template slot="menuLeft" slot-scope="{size}">
                 <el-tabs v-model="activeName" @tab-click="tabHandle">
-                  <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
-                  <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
+                  <el-tab-pane label="查询结果" name="searchList"/>
+                  <el-tab-pane label="已选定数据" name="importStaging"/>
                 </el-tabs>
               </template>
               <template slot-scope="scope" slot="menu">
@@ -490,16 +490,14 @@
                   @click.stop="importStagList(scope.row,scope.index)"
                   v-if="activeName=='searchList'"
                   :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1"
-                >选择
-                </el-button>
+                >选择</el-button>
                 <el-button
                   type="text"
                   icon="el-icon-delete"
                   size="small"
                   @click.stop="removeStagList(scope.row,scope.index)"
                   v-else
-                >移除
-                </el-button>
+                >移除</el-button>
               </template>
             </avue-crud>
           </basic-container>
@@ -629,7 +627,7 @@
       :reportId="form.id"
       reportName="销售明细(N)"
       @onClose="onClose()"
-    ></report-dialog>
+    />
 
     <el-dialog
       append-to-body

+ 1 - 1
src/views/dealer/purchase/config/commodity.json

@@ -9,7 +9,7 @@
   "editBtn": false,
   "delBtn": false,
   "addBtn": false,
-  "menu": false,
+  "menu": true,
   "align": "center",
   "menuWidth": "180",
   "selection": true,

+ 33 - 5
src/views/dealer/purchase/config/customerContact.json

@@ -14,7 +14,7 @@
   "summaryText": "合计",
   "sumColumnList": [
     {
-      "name": "actualQuantity",
+      "name": "orderQuantity",
       "type": "sum"
     },
     {
@@ -31,7 +31,7 @@
       "label": "产品编码",
       "prop": "code",
       "index": 1,
-      "width": 100,
+      "width": 200,
       "overHidden": true
     },
     {
@@ -42,6 +42,13 @@
       "overHidden": true
     },
     {
+      "label": "是否按照批次号",
+      "prop": "batch",
+      "index": 2,
+      "width": 110,
+      "overHidden": true
+    },
+    {
       "label": "规格",
       "prop": "typeno",
       "index": 3,
@@ -71,7 +78,7 @@
     },
     {
       "label": "单位",
-      "prop": "a",
+      "prop": "unit",
       "index": 7,
       "width": 100,
       "overHidden": true
@@ -85,7 +92,7 @@
     },
     {
       "label": "数量",
-      "prop": "actualQuantity",
+      "prop": "orderQuantity",
       "index": 9,
       "width": 100,
       "overHidden": true
@@ -105,9 +112,30 @@
       "overHidden": true
     },
     {
+      "label": "库存价格",
+      "prop": "purchaseAmount",
+      "index": 12,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "税率",
+      "prop": "taxRate",
+      "index": 13,
+      "width": 100,
+      "overHidden": true
+    },
+    {
       "label": "小计",
       "prop": "amount",
-      "index": 12,
+      "index": 14,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "index": 15,
       "width": 100,
       "overHidden": true
     }

+ 2 - 2
src/views/dealer/purchase/config/mainList.json

@@ -59,7 +59,7 @@
     },
     {
       "label": "电话",
-      "prop": "tel",
+      "prop": "corpTel",
       "search": false,
       "index": 5,
       "minWidth": 80,
@@ -67,7 +67,7 @@
     },
     {
       "label": "地址",
-      "prop": "attn",
+      "prop": "arrivalAddress",
       "search": false,
       "index": 6,
       "minWidth": 80,

+ 606 - 79
src/views/dealer/purchase/detail.vue

@@ -7,6 +7,7 @@
           style="border: none;background: none;color: red"
           icon="el-icon-arrow-left"
           @click="backToList"
+          :loading="btnLoading"
         >返回列表</el-button>
       </div>
       <div class="add-customer-btn">
@@ -15,12 +16,34 @@
           size="small"
           class="el-button--small-yh"
           @click.stop="openEdit"
+          v-if="form.id && disabled"
         >编 辑</el-button>
         <el-button
+          type="primary"
+          size="small"
+          class="el-button--small-yh"
+          style="margin-right: 8px;"
+          @click="dealerSubmit"
+          :disabled="disabled"
+          v-if="form.id"
+        >
+          {{ form.status == 0? '确认订单': form.status == 3? '撤销订单': '' }}
+        </el-button>
+        <el-dropdown style="margin-right: 8px;">
+          <el-button type="warning" size="small">账单处理<i class="el-icon-arrow-down el-icon--right"></i></el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item
+              @click.native="applySettlement('申请')"
+              :disabled="disabled">申请货款
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-button
           type="success"
           :disabled="!form.id"
           size="small"
           @click="copyDoc"
+          :loading="btnLoading"
         >
           复制单据
         </el-button>
@@ -28,6 +51,8 @@
           type="primary"
           @click="editCustomer"
           size="small"
+          :loading="btnLoading"
+          :disabled="disabled || confirmDisabled"
         >保存数据
         </el-button>
       </div>
@@ -46,8 +71,15 @@
               v-model="form.corpId"
               @getCorpData="getCorpData"
               corpType="GYS"
+              :disabled="disabled || confirmDisabled"
             ></crop-select>
           </template>
+          <template slot="storageId">
+            <warehouse-select
+              v-model="form.storageId"
+              :configuration="configurationWarehouse"
+              :disabled="disabled || confirmDisabled"/>
+          </template>
         </avue-form>
       </basic-container>
       <containerTitle title="商品信息"/>
@@ -66,14 +98,38 @@
               icon="el-icon-plus"
               size="small"
               @click.stop="newDetails"
+              :disabled="disabled || confirmDisabled"
             >录入明细</el-button>
             <el-button
               type="info"
               icon="el-icon-printer"
               size="small"
               @click.stop="openReport()"
-            >报 表</el-button
+            >报 表</el-button>
+            <el-button
+              type="primary"
+              size="small"
+              icon="el-icon-download"
+              @click="downloadHandle"
+            >下载模板</el-button>
+            <el-upload
+              :action="baseURL"
+              :headers="headers"
+              :disabled="disabled || confirmDisabled"
+              :on-progress="uploading"
+              :show-file-list=false
+              accept=".xls,.xlsx"
+              multiple
+              :on-success="importTemplate"
+              :on-error="uploadError"
+              style="float: right"
             >
+              <el-button
+                type="primary"
+                size="small"
+                icon="el-icon-upload"
+              >导 入</el-button>
+            </el-upload>
           </template>
           <template slot="menu" slot-scope="{ row, index }">
             <el-button
@@ -81,6 +137,7 @@
               icon="el-icon-edit"
               type="text"
               @click="rowCell(row, index)"
+              :disabled="disabled || confirmDisabled"
             >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
             >
             <el-button
@@ -88,9 +145,37 @@
               icon="el-icon-delete"
               type="text"
               @click="rowDel(row, index)"
+              :disabled="disabled || confirmDisabled"
             >删除</el-button
             >
           </template>
+          <template slot="code" slot-scope="{ row, index }">
+            <span v-if="row.$cellEdit" style="display:flex">
+              <el-select
+                v-model="row.code"
+                placeholder="请选择"
+                filterable
+                size="small"
+                style="width:60%"
+                @change="codeChange(row, index)"
+                :disabled="!form.storageId"
+              >
+                <el-option
+                  v-for="item in goodsoptions"
+                  :key="item.id"
+                  :label="item.code"
+                  :value="item.code"
+                >
+                </el-option>
+              </el-select>
+              <el-button
+                icon="el-icon-search"
+                size="small"
+                @click="rePick(row, index)"
+              ></el-button>
+            </span>
+            <span v-else> {{ row.code }}</span>
+          </template>
           <template slot="cname" slot-scope="{ row, index }">
             <span v-if="row.$cellEdit" style="display:flex">
               <el-select
@@ -98,7 +183,9 @@
                 placeholder="请选择"
                 size="small"
                 style="width:60%"
+                filterable
                 @change="cnameChange(row, index)"
+                :disabled="!form.lotNo"
               >
                 <el-option
                   v-for="item in goodsoptions"
@@ -114,20 +201,23 @@
                 @click="rePick(row, index)"
               ></el-button>
             </span>
-
             <span v-else> {{ row.cname }}</span>
           </template>
-          <template slot="actualQuantity" slot-scope="{ row, index }">
+          <template slot="batch" slot-scope="{row, index}">
+            <span>{{ row.batch == 0? '否': '是' }}</span>
+          </template>
+          <template slot="orderQuantity" slot-scope="{ row, index }">
             <el-input-number
               v-if="row.$cellEdit"
-              v-model="row.actualQuantity"
+              v-model="row.orderQuantity"
               size="small"
               :controls="false"
               :precision="0"
               @input="amountChange(row)"
               style="width: 100%"
+              :disabled="!form.lotNo"
             />
-            <span v-else>{{ row.actualQuantity }}</span>
+            <span v-else>{{ row.orderQuantity | IntegerFormat }}</span>
           </template>
           <template slot="price" slot-scope="{ row, index }">
             <el-input-number
@@ -138,33 +228,41 @@
               :precision="2"
               @input="amountChange(row)"
               style="width: 100%"
+              :disabled="!form.lotNo"
             ></el-input-number>
             <span v-else>{{ row.price }}</span>
           </template>
           <!--          单位-->
-          <template slot="a" slot-scope="{ row, index }">
-            <el-input
+          <template slot="unit" slot-scope="{ row, index }">
+            <el-select
               v-if="row.$cellEdit"
-              v-model="row.a"
+              v-model="row.unit"
               size="small"
-            ></el-input>
-            <span v-else>{{ row.a }}</span>
+              :disabled="!form.lotNo"
+              clearable
+              filterable
+            >
+              <el-option
+                v-for="(item, index) in unitOption"
+                :key="index"
+                :label="item.dictValue"
+                :value="item.dictValue"
+              />
+            </el-select>
+            <span v-else>{{ row.unit }}</span>
           </template>
-          <!--          尺寸-->
-          <template slot="size" slot-scope="{ row, index }">
-            <el-input
-              v-if="row.$cellEdit"
-              v-model="row.size"
-              size="small"
-            ></el-input>
-            <span v-else>{{ row.size }}</span>
+          <template slot="amount" slot-scope="{ row, index }">
+            <span>{{ row.amount | decimalFormat }}</span>
+          </template>
+          <template slot="storageQuantity" slot-scope="{ row, index }">
+            <span>{{ row.storageQuantity | IntegerFormat }}</span>
           </template>
         </avue-crud>
       </basic-container>
       <containerTitle title="详细信息"/>
       <basic-container :showBtn="true">
         <avue-form
-          ref="form"
+          ref="form1"
           class="trading-form"
           v-model="form"
           :option="detailOption"
@@ -175,6 +273,7 @@
         :data="uploadData"
         deleteUrl="/api/blade-client/corpsbank/update"
         :enumerationValue="84"
+        :disabled="disabled || confirmDisabled"
       />
     </div>
     <el-dialog
@@ -220,7 +319,33 @@
               @saveColumn="saveGoodsColumn"
               @resetColumn="resetGoodsColumn"
               :cell-style="cellStyle"
-            ></avue-crud>
+            >
+              <template slot="menuLeft">
+                <el-tabs v-model="activeName" @tab-click="tabHandle">
+                  <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
+                  <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
+                </el-tabs>
+              </template>
+              <template slot-scope="scope" slot="menu">
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  size="small"
+                  @click.stop="importStagList(scope.row,scope.index)"
+                  v-if="activeName=='searchList'"
+                  :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1"
+                >选择
+                </el-button>
+                <el-button
+                  type="text"
+                  icon="el-icon-delete"
+                  size="small"
+                  @click.stop="removeStagList(scope.row,scope.index)"
+                  v-else
+                >移除
+                </el-button>
+              </template>
+            </avue-crud>
           </el-col>
         </el-row>
       </span>
@@ -230,11 +355,31 @@
         <el-button
           type="primary"
           @click="importGoods"
-          :disabled="selectionList.length == 0"
+          :disabled="selectionList.length == 0 && goodsListSave.length == 0"
         >导入</el-button
         >
       </span>
     </el-dialog>
+    <!--    账单-->
+    <el-dialog
+      append-to-body
+      title="账单"
+      class="el-dialogDeep"
+      :visible.sync="financialAccountDialog"
+      width="70%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <financial-account
+        :billType="billType"
+        :billData="{}"
+        :arrList="applyPaymentList"
+        :belongCompany="form.belongToCorpId"
+        @choceFun="choceFun"
+      />
+    </el-dialog>
   </div>
 </template>
 
@@ -245,6 +390,21 @@ import {getDeptLazyTree,
   getGoods,} from "@/api/basicData/customerInquiry";
 import {selectGoodsNum} from "@/api/basicData/inventoryAccount"; // 库存查询
 import {getUserInfo} from "@/api/system/user"; //登录用户信息
+import {dataDetail, removeGoods, typeSave, dealerSubmit} from "@/api/dealer/purchase";
+import {
+  isDiscount,
+  isPercentage,
+  micrometerFormat,
+  IntegerFormat
+} from "@/util/validate";
+import reportDialog from "@/components/report-dialog/main";
+import financialAccount from "../../../components/finance/financialAccount";
+import checkSchedule from "@/components/check/checkSchedule";
+import  billApplication from "@/components/bill/billApplication";
+import { customerList as feeList } from "@/api/basicData/basicFeesDesc";
+import {getDetail} from "@/api/basicData/inventoryAccount";
+import { getToken } from "@/util/auth";
+import { getCurrentDate } from "@/util/date";
 
 export default {
   name: "detail",
@@ -253,9 +413,18 @@ export default {
       type: Object
     }
   },
+  components: {
+    reportDialog,
+    billApplication,
+    financialAccount,
+    checkSchedule,
+  },
   data() {
     return {
       pageLoading: false,
+      btnLoading: false,
+      disabled: false,
+      confirmDisabled: false, // 确认禁用
       form: {},
       option: {
         menuBtn: false,
@@ -272,7 +441,7 @@ export default {
               }
             ],
             span: 16,
-            slot: true
+            slot: true,
           },
           {
             label: "业务时间",
@@ -290,6 +459,31 @@ export default {
             ]
           },
           {
+            label: "批次号",
+            prop: "lotNo",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ],
+            span: 8,
+            slot: true
+          },
+          {
+            label: "收货仓库",
+            prop: "storageId",
+            span: 8,
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "change"
+              }
+            ],
+          },
+          {
             label: "电话",
             prop: "corpTel",
             span: 8
@@ -320,48 +514,56 @@ export default {
           },
           {
             label: "打印时间",
-            prop: "a",
+            prop: "printTime",
             span: 8,
             disabled: true
           },
           {
             label: "打印次数",
-            prop: "a",
+            prop: "printNumber",
             span: 8,
             disabled: true
           },
           {
             label: "客户欠款",
-            prop: "a",
+            prop: "corpDebt",
             span: 8,
             disabled: true
           },
           {
             label: "总数量",
-            prop: "b",
+            prop: "orderQuantity",
             span: 8,
             disabled: true
           },
           {
             label: "应付金额",
-            prop: "c",
+            prop: "debitAmount",
             span: 8,
             disabled: true
           },
           {
             label: "总金额",
-            prop: "d",
+            prop: "amount",
             span: 8,
             disabled: true
           },
           {
             label: "制单人",
-            prop: "createUser",
+            prop: "createUserName",
             span: 8,
             disabled: true,
           },
         ]
       },
+      // 仓库配置
+      configurationWarehouse: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+      },
       dataList: [],
       tableOption: {},
       dialogVisible: false,
@@ -405,6 +607,25 @@ export default {
       treeStyle: "height:" + (window.innerHeight - 315) + "px",
       goodsoptions: [],
       uploadData: [],
+      activeName: 'searchList',
+      // 商品列表数据合计
+      goodsListShow: [],
+      // 商品列表暂存
+      goodsListSave: [],
+      pageList: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      applyPaymentList: [],
+      billType:"收费",  //账单类型
+      billData:{},     //账单需要数据
+      applySettlementDialog:false,//生成账单组件
+      financialAccountDialog:false,
+      feesOption: [],
+      unitOption: [],
+      baseURL: '/api/blade-purchase-sales/orderitems/importDealerOrder',
+      headers: { "Blade-Auth": 'Bearer ' + getToken()},
     }
   },
   async created() {
@@ -416,19 +637,27 @@ export default {
       this.getColumnName(83),
       goodsOption
     );
+    this.getWorkDicts('unit').then(res => {
+      this.unitOption = res.data.data;
+    })
     getGoods(1, 500).then(res => {
       this.goodsoptions = res.data.data.records;
     });
     getUserInfo().then(res => {
-      this.$set(this.form, 'createUser', res.data.data.realName)
+      this.$set(this.form, 'createUserName', res.data.data.realName)
+      this.$set(this.form, 'createUser', res.data.data.id)
     })
-
-    if (this.detailData.id) {
-      this.$set(this.form, 'id', this.detailData.id)
-      this.$set(this.form, 'businesDate', this.detailData.row.businesDate)
-      this.$set(this.form, 'corpId', this.detailData.row.corpsName)
-      this.$set(this.form, 'corpTel', '1918766221')
-      this.$set(this.form, 'arrivalAddress', '山东省青岛市')
+    feeList().then(res => {
+      this.feesOption = res.data.data.records
+    });
+    this.$set(this.form, 'businesDate', getCurrentDate());
+    this.$set(this.form, 'status', 0);
+    if (this.detailData.query) {
+      this.disabled = true;
+      this.option.column.map(e => {
+        this.$set(e, 'disabled', true)
+      })
+      this.queryData(this.detailData.id);
     } else {
       this.dataList = [
         {
@@ -438,9 +667,9 @@ export default {
           brandItem: null,
           specsOne: null,
           specsTwo: null,
-          a: null,
+          unit: null,
           storageQuantity: 0,
-          actualQuantity: 0,
+          orderQuantity: 0,
           size: null,
           price: 0,
           amount: 0,
@@ -449,18 +678,74 @@ export default {
       ]
     }
   },
+  filters: {
+    IntegerFormat(num) {
+      return IntegerFormat(num);
+    },
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
   methods: {
+    // 查询
+    queryData(id) {
+      this.pageLoading = true;
+      dataDetail(id).then(res => {
+        this.form = res.data.data;
+        this.form.amount = Number(this.form.amount).toFixed(2);
+        this.confirmDisabled = this.form.status == 3? true: false;
+        if (this.confirmDisabled) {
+          this.option.column.map(e => {
+            this.$set(e, 'disabled', true)
+          })
+        }
+        this.dataList = this.form.orderItemsList? this.form.orderItemsList: [];
+        this.uploadData = this.form.orderFilesList? this.form.orderFilesList: [];
+        delete this.form.orderItemsList;
+        delete this.form.orderFilesList;
+      }).finally(() => {
+        this.pageLoading = false;
+      })
+    },
     cellStyle() {
       return "padding:0;height:40px;";
     },
-    openEdit() {},
+    openEdit() {
+      this.disabled = false;
+      if (this.form.status != 3) {
+        this.option.column.map(e => {
+          this.$set(e, 'disabled', false)
+        })
+      }
+    },
     copyDoc() {
       this.$emit("copyOrder", this.form.id);
     },
     getCorpData(row) {},
     //修改提交触发
     editCustomer(status) {
-      this.$message.success('保存成功')
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          // 总金额计算
+          let amount = 0;
+          this.dataList.forEach(item => {
+            amount = Number(amount) + Number(item.amount)
+          })
+          this.$set(this.form, 'debitAmount', amount.toFixed(2));
+          this.$set(this.form, 'amount', amount.toFixed(2));
+          this.form.billType = 'CG';
+          this.$set(this.form, 'itemsVOList', this.dataList);
+          this.$set(this.form, 'orderFilesList', this.uploadData);
+          this.btnLoading = true;
+          typeSave(this.form).then(res => {
+            this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
+            this.queryData(res.data.data);
+          }).finally(() => {
+            this.btnLoading = false;
+          })
+        }
+      })
     },
     //返回列表
     backToList() {
@@ -499,26 +784,32 @@ export default {
     },
     //商品明细导入
     newDetails() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          this.dialogVisible = !this.dialogVisible;
+        }
+      })
       // if (!this.form.corpId) {
       //   return this.$message.error("请选择客户名称");
       // }
-      this.dialogVisible = !this.dialogVisible;
     },
     importGoods() {
+      let form = {};
       if (this.reData) {
         if (this.selectionList.length != 1) {
           return this.$message.error("重新选择的时候只能选择一条数据");
         } else {
           this.selectionList.forEach(e => {
-            this.dataList.forEach((item, index) => {
+            this.dataList.forEach(async (item, index) => {
               if (index == this.reData.index) {
-                selectGoodsNum({
+                form = await this.getStockInfo({
+                  tradeType: 'JXS',
                   goodsId: e.id,
-                  itemType: e.typeno,
-                  tradeType: 'GN'
-                }).then((res) => {
-                  item.storageQuantity =  res.data.data
+                  storageId: this.form.storageId,
+                  lotNo: e.batch == 1? this.form.lotNo: null
                 })
+                item.storageQuantity = form.stock;
+                item.purchaseAmount = form.purchaseAmount;
                 item.itemId = e.id;
                 item.code = e.code;
                 item.cname = e.cname;
@@ -528,6 +819,9 @@ export default {
                 item.specsOne = e.specsOne;
                 item.specsTwo = e.specsTwo;
                 item.typeno = e.typeno;
+                item.unit = e.unit;
+                item.size = e.size;
+                item.lotNo = e.batch == 1? this.form.lotNo: null;
                 item.priceCategory = e.goodsTypeName;
                 item.$cellEdit = true;
               }
@@ -535,13 +829,16 @@ export default {
           });
         }
       } else {
-        this.selectionList.forEach(e => {
-          selectGoodsNum({
-            goodsId: e.id,
-            itemType: e.typeno,
-            tradeType: 'GN'
-          }).then(res => {
-            e.storageQuantity =  res.data.data
+        if (this.goodsListSave.length > 0) { // 暂存的有数据
+          this.goodsListSave.forEach(async e => {
+            form = await this.getStockInfo({
+              tradeType: 'JXS',
+              goodsId: e.id,
+              storageId: this.form.storageId,
+              lotNo: e.batch == 1? this.form.lotNo: null
+            })
+            e.storageQuantity = form.stock;
+            e.purchaseAmount = form.purchaseAmount;
             this.dataList.push({
               itemId: e.id,
               code: e.code,
@@ -552,14 +849,49 @@ export default {
               typeno: e.typeno,
               corpId: e.corpId,
               corpName: e.corpName,
+              unit: e.unit,
+              size: e.size,
               price: 0,
               amount: 0,
-              actualQuantity: 0,
+              orderQuantity: 0,
               storageQuantity: e.storageQuantity,
+              purchaseAmount: e.purchaseAmount,
+              lotNo: e.batch == 1? this.form.lotNo: null,
               $cellEdit: true
             });
-          })
-        });
+          });
+        } else {
+          this.selectionList.forEach(async e => {
+            form = await this.getStockInfo({
+              tradeType: 'JXS',
+              goodsId: e.id,
+              storageId: this.form.storageId,
+              lotNo: e.batch == 1? this.form.lotNo: null
+            })
+            e.storageQuantity = form.stock;
+            e.purchaseAmount = form.purchaseAmount;
+            this.dataList.push({
+              itemId: e.id,
+              code: e.code,
+              cname: e.cname,
+              brandItem: e.brandItem,
+              specsOne: e.specsOne,
+              specsTwo: e.specsTwo,
+              typeno: e.typeno,
+              corpId: e.corpId,
+              corpName: e.corpName,
+              unit: e.unit,
+              size: e.size,
+              price: 0,
+              amount: 0,
+              orderQuantity: 0,
+              storageQuantity: e.storageQuantity,
+              purchaseAmount: e.purchaseAmount,
+              lotNo: e.batch == 1? this.form.lotNo: null,
+              $cellEdit: true
+            });
+          });
+        }
       }
       this.dialogVisible = false;
     },
@@ -567,6 +899,8 @@ export default {
       this.selectionList = [];
       this.treeDeptId = "";
       this.reData = null;
+      this.activeName = 'searchList';
+      this.goodsListSave = [];
     },
     nodeClick(data) {
       this.treeDeptId = data.id;
@@ -647,36 +981,90 @@ export default {
         type: "warning"
       }).then(() => {
         if (row.id) {
+          removeGoods(row.id).then(res => {
+            this.$message({
+              type: 'success',
+              message: '删除成功!'
+            })
+            this.dataList.splice(row.$index, 1);
+          })
         } else {
           this.$message({
             type: "success",
             message: "删除成功!"
           });
-          this.data.splice(row.$index, 1);
+          this.dataList.splice(row.$index, 1);
+        }
+      });
+    },
+    codeChange(row) {
+      let form = {};
+      this.goodsoptions.forEach(async e => {
+        if (e.code == row.code) {
+          if (e.batch == 0) {
+            form = await this.getStockInfo({
+              tradeType: 'JXS',
+              goodsId: e.id,
+              storageId: this.form.storageId,
+            })
+            e.storageQuantity = form.stock;
+            e.purchaseAmount = form.purchaseAmount;
+            e.arr = [];
+          } else {
+            e.storageQuantity = 0
+            e.purchaseAmount = 0;
+            e.arr = await this.getLotNo({
+              itemId: e.id,
+              storageId: this.form.storageId,
+              tradeType: 'JXS'
+            });
+          }
+          row.itemId = e.id;
+          row.storageQuantity =  e.storageQuantity;
+          row.cname = e.cname;
+          row.code = e.code;
+          row.corpId = e.corpId;
+          row.corpName = e.corpName;
+          row.brandItem = e.brandItem;
+          row.specsOne = e.specsOne;
+          row.specsTwo = e.specsTwo;
+          row.typeno = e.typeno;
+          row.unit = e.unit;
+          row.size = e.size;
+          row.arr = e.arr;
+          row.priceCategory = e.goodsTypeName;
+          row.purchaseAmount = e.purchaseAmount;
+          row.batch = e.batch;
         }
       });
     },
     cnameChange(row) {
-      this.goodsoptions.forEach(e => {
+      let form = {};
+      this.goodsoptions.forEach(async e => {
         if (e.id == row.itemId) {
-          selectGoodsNum({
+          form = await this.getStockInfo({
+            tradeType: 'JXS',
             goodsId: e.id,
-            itemType: e.typeno,
-            tradeType: 'GN'
-          }).then(res => {
-            row.storageQuantity =  res.data.data
-            row.cname = e.cname;
-            row.code = e.code;
-            row.corpId = e.corpId;
-            row.corpName = e.corpName;
-            row.brandItem = e.brandItem;
-            row.specsOne = e.specsOne;
-            row.specsTwo = e.specsTwo;
-            row.typeno = e.typeno;
-            row.priceCategory = e.goodsTypeName;
-            row.purchaseAmount = 0;
-            row.amount = 0;
+            storageId: this.form.storageId,
+            lotNo: e.batch == 1? this.form.lotNo: null
           })
+          e.storageQuantity = form.stock;
+          e.purchaseAmount = form.purchaseAmount;
+          row.cname = e.cname;
+          row.code = e.code;
+          row.corpId = e.corpId;
+          row.corpName = e.corpName;
+          row.brandItem = e.brandItem;
+          row.specsOne = e.specsOne;
+          row.specsTwo = e.specsTwo;
+          row.typeno = e.typeno;
+          row.unit = e.unit;
+          row.size = e.size;
+          row.priceCategory = e.goodsTypeName;
+          row.storageQuantity = e.storageQuantity;
+          row.purchaseAmount = e.purchaseAmount;
+          row.lotNo = e.batch == 1? this.form.lotNo: null;
+          // row.amount = 0;
         }
       });
     },
@@ -689,13 +1077,152 @@ export default {
     },
     // 商品信息价格计算
     amountChange(row) {
-      if (!row.actualQuantity) {
-        row.actualQuantity = 0;
+      if (!row.orderQuantity) {
+        row.orderQuantity = 0;
       }
       if (!row.price) {
         row.price = 0;
       }
-      row.amount = Number(row.price) * Number(row.actualQuantity)
+      row.amount = Number(row.price) * Number(row.orderQuantity)
+    },
+    // 标签页切换
+    tabHandle(data) {
+      if (data.name == 'searchList') {
+        this.goodsListShow = this.goodsList;
+        this.page.total = this.pageList.total
+      } else if (data.name == 'importStaging') {
+        this.goodsListShow = this.goodsListSave;
+        this.page.total = 0
+      }
+    },
+    removeStagList(row, index) {
+      this.goodsListSave.splice(row.$index, 1)
+    },
+    importStagList(row, index) {
+      this.goodsListSave.push(row);
+    },
+    // 生成结算
+    applySettlement(type) {
+      this.beforeBillData(true,type)
+      this.financialAccountDialog = true;
+    },
+    //生成账单 拿到主表信息
+    beforeBillData(bool,type) {
+      this.billType = type;
+      this.applyPaymentList = [];
+      this.dataList.map(e => {
+        const form = {
+          srcOrderno:this.form.orderNo,
+          srcParentId: this.form.id,
+          itemType:"采购",
+          corpsName:this.form.corpsName,
+          corpId:this.form.corpId,
+          currency: 'CNY',
+          exchangeRate: '1',
+          taxRate: '0',
+          accDate: this.form.businesDate,
+          srcType: 1,
+          // chargeMember: this.form.chargeMember,
+          parentId: this.form.id,
+          tradeType: 'JXS',
+          optionType: 'JXS',
+          amount: e.amount,
+          costType: this.feesOption.find(item => item.cname == '货款')? this.feesOption.find(item => item.cname == '货款').id: null,
+          srcFeesId: e.id,
+          cname: e.cname,
+          price: e.price,
+          quantity: e.orderQuantity,
+        }
+        this.applyPaymentList.push(form);
+      })
+    },
+    //关闭账单
+    choceFun(){
+      this.financialAccountDialog  = false
+    },
+    // 获得库存信息
+    async getStockInfo(data) {
+      //tradeType JXS
+      //goodsId
+      //storageId
+      //lotNo 批次号
+      let form = {};
+      await getDetail(data).then(res => {
+        const a = res.data.data? res.data.data: {
+          stock: 0,
+          balanceAmount: 0,
+          balanceQuantity: 0,
+        };
+        this.$set(form, 'purchaseAmount', a.balanceQuantity == 0? 0: (Number(a.balanceAmount) / Number(a.balanceQuantity)).toFixed(2));
+        this.$set(form, 'stock', a.balanceQuantity);
+      })
+      return form;
+    },
+    // 确认或者取消订单
+    dealerSubmit() {
+      let dealer;
+      if (this.form.status == 0) {
+        dealer = 1;
+      } else if (this.form.status == 3) {
+        dealer = 2;
+      }
+      this.btnLoading = true;
+      dealerSubmit({
+        id: this.form.id,
+        dealer
+      }).then(res => {
+        if (res.data.code == 200) {
+          this.$message.success('操作成功')
+          this.queryData(this.form.id)
+        } else {
+          this.$message.error(res.data.msg)
+        }
+      }).finally(() => {
+        this.btnLoading = false;
+      })
+    },
+    // 下载模板
+    downloadHandle() {
+      this.$confirm('是否下载模板文件?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        window.open(
+          `/api/blade-purchase-sales/orderitems/exportDealerOrder?${
+            this.website.tokenHeader
+          }=${getToken()}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      })
+    },
+    //文件上传时
+    uploading(event, file, fileList) {
+      this.openFullScreen(false, '文件正在解析中');
+    },
+    importTemplate(res, file) {
+      this.openFullScreen(true)
+      res.data.forEach(item => {
+      })
+      this.dataList = this.dataList.concat(res.data)
+    },
+    uploadError(err, file, fileList) {
+      this.openFullScreen(true)
+      this.$message.error(JSON.parse(err.message).msg)
+    },
+    //遮罩层
+    openFullScreen(res, text) {
+      const loading = this.$loading({
+        lock: true,
+        text: text,
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      if (res === true) loading.close();
     },
   },
 }

+ 31 - 51
src/views/dealer/purchase/index.vue

@@ -24,7 +24,10 @@
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.orderNo }}</span>
         </template>
         <template slot="corpId" slot-scope="scope">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpsName }}</span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.strCorpName }}</span>
+        </template>
+        <template slot="createUser" slot-scope="scope">
+          <span>{{ scope.row.createUserName }}</span>
         </template>
         <template slot="corpIdSearch">
           <crop-select
@@ -71,6 +74,7 @@
 import option from './config/mainList.json';
 import detailPage from "./detail";
 import { gainUser } from "@/api/basicData/customerInquiry";
+import {getPurchaseList, deleteDetails} from "@/api/dealer/purchase";
 
 export default {
   name: "index",
@@ -78,58 +82,12 @@ export default {
   data() {
     return {
       option: {},
-      dataList: [
-        {
-          id: 1,
-          orderNo: 'cg001',
-          sysNo: 'cgbh001',
-          corpId: '1',
-          corpsName: '张汉三',
-          businesDate: '2022-03-10',
-          tel: '19188887777'
-        },
-        {
-          id: 2,
-          orderNo: 'cg002',
-          sysNo: 'cgbh002',
-          corpId: '2',
-          corpsName: '李富贵',
-          businesDate: '2022-03-10',
-          tel: '18688882222'
-        },
-        {
-          id: 3,
-          orderNo: 'cg003',
-          sysNo: 'cgbh003',
-          corpId: '3',
-          corpsName: '王老五',
-          businesDate: '2022-03-10',
-          tel: '13570628888'
-        },
-        {
-          id: 4,
-          orderNo: 'cg004',
-          sysNo: 'cgbh004',
-          corpId: '4',
-          corpsName: '赵全蛋',
-          businesDate: '2022-03-10',
-          tel: '13899991234'
-        },
-        {
-          id: 5,
-          orderNo: 'cg005',
-          sysNo: 'cgbh005',
-          corpId: '5',
-          corpsName: '万大丫',
-          businesDate: '2022-03-10',
-          tel: '152890988876'
-        },
-      ],
+      dataList: [],
       form: {},
       page: {
         pageSize: 10,
         currentPage: 1,
-        total: 5,
+        total: 0,
         pageSizes: [10, 50, 100, 200, 300, 400, 500]
       },
       search: {},
@@ -176,12 +134,16 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
+      }).then(res => {
+        return deleteDetails(row.id)
       }).then(() => {
         this.dataList.splice(row.$index, 1)
         this.$message({
           type: "success",
           message: "删除成功!"
         });
+        this.page.currentPage = 1;
+        this.onLoad(this.page)
       })
     },
     //点击搜索按钮触发
@@ -203,7 +165,25 @@ export default {
       return "padding:0;height:40px;";
     },
     onLoad(page, params) {
-      // this.option.height = window.innerHeight - 240;
+      // 重置掉展开
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
+      const queryParams = Object.assign({}, params, {
+        size: page.pageSize,
+        current: page.currentPage,
+      })
+      this.loading = true;
+      getPurchaseList(queryParams).then(res => {
+        this.dataList = res.data.data.records;
+        this.page.total = res.data.data.total;
+        this.option.height = window.innerHeight - 240;
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+      }).finally(() => {
+        this.loading = false;
+      })
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(
@@ -255,7 +235,7 @@ export default {
       this.show = false;
       this.detailData = {
         id: row.id,
-        row: row
+        query: true, // 表示只是查询
       };
     },
   },

+ 1 - 1
src/views/dealer/sales/config/commodity.json

@@ -9,7 +9,7 @@
   "editBtn": false,
   "delBtn": false,
   "addBtn": false,
-  "menu": false,
+  "menu": true,
   "align": "center",
   "menuWidth": "180",
   "selection": true,

+ 31 - 9
src/views/dealer/sales/config/customerContact.json

@@ -14,7 +14,7 @@
   "summaryText": "合计",
   "sumColumnList": [
     {
-      "name": "actualQuantity",
+      "name": "orderQuantity",
       "type": "sum"
     },
     {
@@ -31,7 +31,7 @@
       "label": "产品编码",
       "prop": "code",
       "index": 1,
-      "width": 100,
+      "width": 200,
       "overHidden": true
     },
     {
@@ -71,43 +71,65 @@
     },
     {
       "label": "单位",
-      "prop": "a",
+      "prop": "unit",
       "index": 7,
       "width": 100,
       "overHidden": true
     },
     {
+      "label": "批次号",
+      "prop": "lotNo",
+      "index": 8,
+      "width": 140,
+      "overHidden": true
+    },
+    {
       "label": "库存",
       "prop": "storageQuantity",
-      "index": 8,
+      "index": 9,
       "width": 100,
       "overHidden": true
     },
+
     {
       "label": "数量",
-      "prop": "actualQuantity",
-      "index": 9,
+      "prop": "orderQuantity",
+      "index": 10,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "尺寸",
       "prop": "size",
-      "index": 10,
+      "index": 11,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "库存价格",
+      "prop": "purchaseAmount",
+      "index": 12,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "价格",
       "prop": "price",
-      "index": 11,
+      "index": 13,
       "width": 100,
       "overHidden": true
     },
     {
       "label": "小计",
       "prop": "amount",
-      "index": 12,
+      "index": 14,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "index": 15,
       "width": 100,
       "overHidden": true
     }

+ 6 - 6
src/views/dealer/sales/config/mainList.json

@@ -37,7 +37,7 @@
     },
     {
       "label": "所属公司",
-      "prop": "belongToCorpId",
+      "prop": "belongToCorpName",
       "search": false,
       "index": 3,
       "minWidth": 80,
@@ -58,7 +58,7 @@
     },
     {
       "label": "电话",
-      "prop": "tel",
+      "prop": "corpTel",
       "search": false,
       "index": 5,
       "minWidth": 80,
@@ -66,15 +66,15 @@
     },
     {
       "label": "地址",
-      "prop": "attn",
+      "prop": "arrivalAddress",
       "search": false,
       "index": 6,
       "minWidth": 80,
       "overHidden": true
     },
     {
-      "label": "经办人",
-      "prop": "e",
+      "label": "业务员",
+      "prop": "chargeMember",
       "search": true,
       "index": 7,
       "minWidth": 80,
@@ -95,7 +95,7 @@
     },
     {
       "label": "配送方式",
-      "prop": "f",
+      "prop": "distributionMode",
       "search": false,
       "index": 9,
       "minWidth": 80,

File diff suppressed because it is too large
+ 615 - 104
src/views/dealer/sales/detail.vue


+ 33 - 35
src/views/dealer/sales/index.vue

@@ -26,6 +26,12 @@
         <template slot="corpId" slot-scope="scope">
           <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpsName }}</span>
         </template>
+        <template slot="storageId" slot-scope="scope">
+          <span>{{ scope.row.storageName }}</span>
+        </template>
+        <template slot="createUser" slot-scope="scope">
+          <span>{{ scope.row.createUserName }}</span>
+        </template>
         <template slot="storageIdSearch">
           <warehouse-select
             v-model="search.storageId"
@@ -76,6 +82,7 @@
 import option from './config/mainList.json';
 import detailPage from "./detail";
 import { gainUser } from "@/api/basicData/customerInquiry";
+import {getSalesList, detail, deleteDetails} from "@/api/dealer/sales";
 
 export default {
   name: "index",
@@ -83,43 +90,12 @@ export default {
   data() {
     return {
       option: {},
-      dataList: [
-        {
-          id: 10,
-          orderNo: 'xs00001',
-          sysNo: 'xt00001',
-          corpId: '1',
-          corpsName: '张叁',
-          businesDate: '2022-03-09',
-          storageId: '测试库',
-          paymentType: '预付',
-          belongToCorpId: '测试所属公司',
-          tel: '13887762678',
-          attn: '山东省青岛市李沧区峰山路',
-          e: 'admin',
-          f: '空运',
-          createUser: 'admin'
-        },
-        {id: 11, orderNo: 'xs00002',
-          sysNo: 'xt00002',
-          corpId: '2',
-          corpsName: '李四',
-          businesDate: '2022-03-09',
-          storageId: '测试库',
-          paymentType: '到付',
-          belongToCorpId: '测试所属公司',
-          tel: '13633346789',
-          attn: '山东省青岛市市北区台东步行街',
-          e: 'admin',
-          f: '陆运',
-          createUser: '王富贵'},
-        {id: 12, orderNo: 'xs00003', sysNo: 'xt00003', corpId: '3', corpsName: '王五', businesDate: '2022-03-10'},
-      ],
+      dataList: [],
       form: {},
       page: {
         pageSize: 10,
         currentPage: 1,
-        total: 3,
+        total: 0,
         pageSizes: [10, 50, 100, 200, 300, 400, 500]
       },
       search: {},
@@ -178,12 +154,16 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
+      }).then(res => {
+        return deleteDetails(row.id)
       }).then(() => {
         this.dataList.splice(row.$index, 1)
         this.$message({
           type: "success",
           message: "删除成功!"
         });
+        this.page.currentPage = 1;
+        this.onLoad(this.page)
       })
     },
     //点击搜索按钮触发
@@ -205,7 +185,25 @@ export default {
       return "padding:0;height:40px;";
     },
     onLoad(page, params) {
-      // this.option.height = window.innerHeight - 240;
+      // 重置掉展开
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
+      const queryParams = Object.assign({}, params, {
+        size: page.pageSize,
+        current: page.currentPage,
+      })
+      this.loading = true;
+      getSalesList(queryParams).then(res => {
+        this.dataList = res.data.data.records;
+        this.page.total = res.data.data.total;
+        this.option.height = window.innerHeight - 240;
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+      }).finally(() => {
+        this.loading = false;
+      })
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(
@@ -257,7 +255,7 @@ export default {
       this.show = false;
       this.detailData = {
         id: row.id,
-        row: row
+        query: true, // 表示只是查询
       };
     },
   },

+ 8 - 0
src/views/dealer/stock/config/mainList.json

@@ -38,6 +38,14 @@
       "overHidden": true
     },
     {
+      "label": "批次号",
+      "prop": "lotNo",
+      "search": true,
+      "index": 1,
+      "width": 120,
+      "overHidden": true
+    },
+    {
       "label": "花纹",
       "prop": "brandItem",
       "search": true,

+ 350 - 0
src/views/statisticAnalysis/payment/index.vue

@@ -0,0 +1,350 @@
+<template>
+  <div>
+    <basic-container class="page-crad">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        :before-open="beforeOpen"
+        :page.sync="page"
+        :search.sync="search"
+        :cell-style="cellStyle"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        :table-loading="loading"
+        :summary-method="summaryMethod"
+        @saveColumn="saveColumn"
+        @resetColumn="resetColumn"
+        @search-criteria-switch="searchCriteriaSwitch"
+      >
+        <template slot="menuLeft">
+          <el-button type="info" size="small" @click="outExport"
+            >导出</el-button
+          >
+        </template>
+        <template slot="corpIdSearch">
+          <crop-select v-model="search.corpId" corpType="KH"></crop-select>
+        </template>
+        <template slot="businesDateSearch">
+          <el-date-picker
+            v-model="search.businesDate"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </template>
+        <template slot-scope="{ row }" slot="purchasePrice">
+          <span>{{ row.purchasePrice | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="amount">
+          <span>{{ row.amount | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="procurementCost">
+          <span>{{ row.procurementCost | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="partsCost">
+          <span>{{ row.partsCost | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="grossProfit">
+          <span>{{ row.grossProfit | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="fd">
+          <span>{{ row.fd | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="fc">
+          <span>{{ row.fc | decimalFormat }}</span>
+        </template>
+        <template slot-scope="{ row }" slot="singleTicketMargin">
+          <span>{{ row.singleTicketMargin | decimalFormat }}</span>
+        </template>
+        <template slot-scope="scope" slot="orderNo">
+          <span
+            style="color: #409EFF;cursor: pointer"
+            @click.stop="editOpen(scope.row)"
+            >{{ scope.row.orderNo }}
+          </span>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/util/auth";
+import { getList, getProfitItem } from "@/api/statisticAnalysis/salesProfit";
+import { micrometerFormat } from "@/util/validate";
+import _ from "lodash";
+export default {
+  name: "index",
+  data() {
+    return {
+      form: {},
+      search: {},
+      dataList: [],
+      loading: false,
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {
+        searchShow: true,
+        searchMenuSpan: 16,
+        align: "center",
+        searchSpan: 8,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        showSummary: true,
+        searchIcon: true,
+        searchIndex: 2,
+        menu: false,
+        column: [
+          {
+            label: "订单号",
+            prop: "billType",
+            type: "select",
+            width: 100,
+            search: true
+          },
+          {
+            label: "订单日期",
+            prop: "businesDate",
+            overHidden: true,
+            width: 100,
+            hide: true,
+            showColumn: false,
+            search: true
+          },
+          {
+            label: "客户名称",
+            prop: "corpId",
+            overHidden: true,
+            width: 100,
+            search: true,
+            formatter: row => {
+              return row.corpsName;
+            }
+          },
+          {
+            label: "收费类别",
+            prop: "orderNo",
+            overHidden: true,
+            hide: true,
+            showColumn: false,
+            search: true,
+            width: 100
+          },
+          {
+            label: "商品名称",
+            prop: "portOfLoad",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "型号",
+            prop: "portOfDestination",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "数量",
+            prop: "transport",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "销售单价",
+            prop: "procurementCost",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "金额",
+            prop: "partsCost",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "币别",
+            prop: "purchasePrice",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "汇率",
+            prop: "amount",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "结算金额",
+            prop: "grossProfit",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "发票号",
+            prop: "grossProfitRate",
+            overHidden: true,
+            width: 100
+          },
+          {
+            label: "备注",
+            prop: "fd",
+            overHidden: true,
+            width: 100
+          }
+        ]
+      }
+    };
+  },
+  filters: {
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 46;
+      } else {
+        this.option.height = this.option.height + 46;
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      if (!params.billType) {
+        done();
+        return this.$message.error("请选择类别");
+      }
+      if (params.businesDate) {
+        params.contractStartDate = params.businesDate[0];
+        params.contractEndDate = params.businesDate[1];
+      }
+      delete params.businesDate;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    onLoad(page, params = {}) {
+      // this.loading = true;
+      // if (!this.search.billType) {
+      //   this.search.billType = "XS";
+      // }
+      // this.dataList.forEach(item => {
+      //   this.$refs.crud.toggleRowExpansion(item, false);
+      // });
+      // getList(
+      //   page.currentPage,
+      //   page.pageSize,
+      //   Object.assign(params, this.search)
+      // )
+      //   .then(res => {
+      //     if (res.data.data.records) {
+      //       res.data.data.records.forEach(e => {
+      //         e.itemLoading = true;
+      //       });
+      //     }
+      //     this.dataList = res.data.data.records ? res.data.data.records : [];
+      //     this.page.total = res.data.data.total;
+      //     if (this.page.total) {
+      //       this.option.height = window.innerHeight - 210;
+      //     }
+      //   })
+      //   .finally(() => {
+      //     this.loading = false;
+      //   });
+    },
+    editOpen(row) {
+      if (row.billType == "BJ") {
+        this.$router.push({
+          path: "/exportTrade/customerInquiry/index",
+          query: {
+            id: row.id
+          }
+        });
+      } else {
+        this.$router.push({
+          path: "/exportTrade/salesContract/index",
+          query: {
+            id: row.id
+          }
+        });
+      }
+    },
+    outExport() {
+      if (!this.search.billType) {
+        return this.$message.error("请选择类别");
+      }
+      window.open(
+        `/api/blade-purchase-sales/exportOrder/exportProfit?${
+          this.website.tokenHeader
+        }=${getToken()}&billType=${this.search.billType}`
+      );
+    },
+    summaryMethod({ columns, data }) {
+      const sums = [];
+      if (columns.length > 0) {
+        columns.forEach((item, index) => {
+          sums[0] = "合计";
+          if (item.property == "purchasePrice" || item.property == "amount") {
+            let amountSum = 0;
+            let purchaseAmountSum = 0;
+            data.forEach(e => {
+              amountSum = _.add(amountSum, Number(e.amount));
+              purchaseAmountSum = _.add(
+                purchaseAmountSum,
+                Number(e.purchasePrice)
+              );
+            });
+            //入库金额总计
+            if (item.property == "purchasePrice") {
+              sums[index] = micrometerFormat(purchaseAmountSum);
+            }
+            if (item.property == "amount") {
+              sums[index] = micrometerFormat(amountSum);
+            }
+          }
+        });
+      }
+      return sums;
+    }
+  }
+};
+</script>
+
+<style scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.2vh;
+}
+.itemTable ::v-deep .el-table {
+  width: 100%;
+}
+</style>

+ 19 - 0
src/views/wel/components/quick-launch.vue

@@ -94,6 +94,16 @@
           <span>付费</span>
         </div>
       </div>
+      <div class="content" v-if="sysType == 6">
+        <div class="content-icon" @click="inPage('cg')">
+          <i class="tradingIcon icon-purchase" style="color:#75CD28"></i>
+          <span>采购</span>
+        </div>
+        <div class="content-icon" @click="inPage('xs')">
+          <i class="tradingIcon icon-sales" style="color:#409EFF"></i>
+          <span>销售</span>
+        </div>
+      </div>
     </el-card>
   </div>
 </template>
@@ -215,6 +225,15 @@ export default {
             this.$router.push("/basicData/basicFeesDesc/index");
             break;
         }
+      } else if (this.sysType == 6) {
+        switch (type) {
+          case "xs":
+            this.$router.push("/dealer/sales/index");
+            break;
+          case "cg":
+            this.$router.push("/dealer/purchase/index");
+            break;
+        }
       }
     }
   }

Some files were not shown because too many files changed in this diff