Browse Source

修改bug

Qukatie 3 years ago
parent
commit
e9a9299f6b

+ 1 - 1
src/api/basicData/basicStorageType.js

@@ -11,7 +11,7 @@ export function customerList(data) {
 //客户类别列表修改和新增
 export function typeSave(data) {
     return request({
-        url: '/api/blade-client/storagetype/submit',
+        url: '/api/blade-client/storagedesc/submitType',
         method: 'post',
         data: data
     })

+ 11 - 0
src/api/basicData/client.js

@@ -68,4 +68,15 @@ export function customerList(data) {
       method: 'get',
       params: data
   })
+}
+export const getSellList = (current, size, params) => {
+  return request({
+    url: '/api/trade-finance/settlement/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
 }

+ 8 - 0
src/api/basicData/product.js

@@ -82,4 +82,12 @@ export function getAllgoods() {
         method: 'post',
         data: data
     })
+}
+//客户类别列表修改和新增
+export function storagesubmit(data) {
+    return request({
+        url: '/api/blade-client/storagedesc/submitType',
+        method: 'post',
+        data: data
+    })
 }

+ 30 - 2
src/api/basicData/salesOrder.js

@@ -31,13 +31,34 @@ export function gainUser(query) {
     params: query
   })
 }
-export function submit(data) {
+export function save(data) {
+  return request({
+    url: '/api/blade-purchase-sales/appParts/quickBilling',
+    method: 'post',
+    data:data
+  })
+}
+export function fixSave(data) {
   return request({
     url: '/api/blade-purchase-sales/dealerOrder/submitApp',
     method: 'post',
     data:data
   })
 }
+export function submit(data) {
+  return request({
+    url: '/api/blade-purchase-sales/appParts/confirm',
+    method: 'post',
+    data:data
+  })
+}
+export function revoke(data) {
+  return request({
+    url: '/api/blade-purchase-sales/appParts/revoke',
+    method: 'post',
+    data:data
+  })
+}
 export const getDetails = (data) => {
   return request({
     url: '/api/blade-purchase-sales/appParts/detail',
@@ -77,4 +98,11 @@ export function getAllgoods() {
     url: '/api/blade-client/goodsdesc/descListAll',
     method: 'get',
   })
-}
+}
+export function collectPayment(data) {
+  return request({
+    url: '/api/blade-purchase-sales/appParts/collectPayment',
+    method: 'post',
+    data:data
+  })
+}

+ 117 - 0
src/components/dictbiz-dialog/main.vue

@@ -0,0 +1,117 @@
+<template>
+    <div>
+        <el-dialog :title="title" v-dialogDrag :visible.sync="visible" class="avue-dialog avue-dialog--top"
+            width="500px" append-to-body @closed="closed">
+            <span>
+                <avue-form ref="form" :key="reload" v-model="form" :option="option"></avue-form>
+            </span>
+            <div class="avue-dialog__footer">
+                <el-button @click="visible = false">取 消</el-button>
+                <el-button @click="save" type="primary">确 定</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+  
+<script>
+import {
+    add
+} from '@/api/system/dictbiz'
+export default {
+    data() {
+        return {
+            visible: false,
+            form: {},
+            option: {
+                menuBtn: false,
+                column: [
+                    {
+                        label: '字典名称',
+                        prop: 'dictValue',
+                        rules: [
+                            {
+                                required: true,
+                                message: "",
+                                trigger: "blur"
+                            }
+                        ],
+                        span: 24
+                    },
+                    {
+                        label: '字典键值',
+                        prop: 'dictKey',
+                        rules: [
+                            {
+                                required: true,
+                                message: "",
+                                trigger: "blur"
+                            }
+                        ],
+                        span: 24
+                    },
+                    {
+                        label: '字典排序',
+                        prop: 'sort',
+                        rules: [
+                            {
+                                required: true,
+                                message: "",
+                                trigger: "blur"
+                            }
+                        ],
+                        span: 24
+                    }
+                ]
+            }
+        };
+    },
+    props: {
+        title: {
+            type: String,
+            default: '添加字典'
+        },
+        code: {
+            type: String,
+            default: '添加字典'
+        },
+        parentId: {
+            type: String,
+            default: '0'
+        }
+    },
+    created() { },
+    methods: {
+        open() {
+            this.visible = true
+        },
+        closed() {
+            this.reload = Math.random();
+            this.form = this.$options.data().form
+            this.$emit('closed')
+        },
+        save() {
+            this.$refs["form"].validate((valid, done) => {
+                done();
+                if (valid) {
+                    let data = {
+                        ...this.form,
+                        code: this.code,
+                        isSealed: 0,
+                        parentId: this.parentId
+                    }
+                    add(data).then(res => {
+                        this.visible = false
+                    })
+                } else {
+                    return false;
+                }
+            });
+        }
+    }
+};
+</script>
+  
+<style scoped lang="scss">
+
+</style>
+  

+ 6 - 0
src/enums/column-name.js

@@ -958,6 +958,12 @@ const columnName = [{
 },{
   code: 231,
   name: '内贸-客户利润统计'
+},{
+  code: 232,
+  name: '供应商(Y)-资金往来'
+},{
+  code: 233,
+  name: '配件系统-付费明细'
 }
 ]
 export const getColumnName = (key) => {

+ 3 - 0
src/main.js

@@ -57,6 +57,8 @@ import warehousKH from '@/components/warehousKH/main';
 import eCropSelect from '@/components/e-crop-select/main';
 //配件客户组件
 import ypjCorp from '@/components/ypj-corp/main';
+//配件字典组件
+import dictbizDialog from '@/components/dictbiz-dialog/main';
 // 标题跳转组件
 import eCropJump from '@/components/e-crop-jump/index';
 //枚举列设置名称管理
@@ -95,6 +97,7 @@ Vue.component('changeApprove', changeApprove)
 Vue.component('warehousKh', warehousKH)
 Vue.component('eCropSelect', eCropSelect)
 Vue.component('ypjCorp', ypjCorp)
+Vue.component('dictbizDialog', dictbizDialog)
 Vue.component('eCropJump', eCropJump)
 import portInfo from "@/components/port-info/index";
 Vue.component('portInfo', portInfo);

+ 13 - 0
src/router/views/index.js

@@ -1922,6 +1922,19 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/salesOrder/index')
   }]
 }, {
+  path: '/purchaseOrder/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/purchaseOrder/index',
+    name: '采购单',
+    meta: {
+      i18n: '/purchaseOrder/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/purchaseOrder/index')
+  }]
+}, {
   path: '/product/index',
   component: Layout,
   hidden: true,

+ 34 - 19
src/views/client/detailsInfo.vue

@@ -116,6 +116,12 @@
                             <el-button size="mini">收款
                             </el-button>
                         </template>
+                        <template slot="settlementDateSearch">
+                            <el-date-picker v-model="search2.settlementDate" 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']" :picker-options="pickerOptions">
+                            </el-date-picker>
+                        </template>
                     </avue-crud>
                 </el-tab-pane>
                 <el-tab-pane label="客户信息" name="third">
@@ -157,7 +163,7 @@
 <script>
 import { optionList, sellOption, capitalOption } from "./js/optionList";
 import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods } from "@/api/basicData/salesOrder";
-import { getDetails } from "@/api/basicData/client";
+import { getDetails,getSellList } from "@/api/basicData/client";
 import { validatenull } from "@/util/validate";
 export default {
     name: "index",
@@ -179,10 +185,10 @@ export default {
                 pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
             },
             page2: {
-                pageSize: 10,
+                pageSize: 20,
                 currentPage: 1,
                 total: 0,
-                pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+                pageSizes: [20]
             },
             activeName: "first",
             search: {},
@@ -299,6 +305,9 @@ export default {
             getAllgoods().then(res => {
                 this.findObject(this.sellOption.column, "cname").dicData = res.data.data
             });
+            this.getWorkDicts("account").then(res => {
+                this.findObject(this.capitalOption.column, "account").dicData = res.data.data;
+            });
         },
         cellStyle() {
             return "padding:0;height:40px;";
@@ -351,6 +360,28 @@ export default {
                     this.loading = false;
                 });
         },
+        onLoad2(page, params = {}) {
+            let data = this.deepClone(Object.assign(params, this.search2));
+            if (data.settlementDate) {
+                data.settlementStartDate = data.settlementDate[0];
+                data.settlementEndDate = data.settlementDate[1];
+            }
+            delete data.settlementDate
+            data.corpId = this.detailData.id;
+            this.loading = true;
+            getSellList(
+                page.currentPage,
+                page.pageSize,
+                data
+            )
+                .then(res => {
+                    this.capitalList = res.data.data.records ? res.data.data.records : [];
+                    this.page2.total = res.data.data.total;
+                })
+                .finally(() => {
+                    this.loading = false;
+                });
+        },
         searchCriteriaSwitch2(type) {
             if (type) {
                 this.capitalOption.height = this.capitalOption.height - 46;
@@ -375,22 +406,6 @@ export default {
             this.page2.currentPage = 1;
             this.page2.pageSize = val;
         },
-        onLoad2(page, params = {}) {
-            let data = this.deepClone(Object.assign(params, this.search2));
-            // this.loading = true;
-            //   getList(
-            //     page.currentPage,
-            //     page.pageSize,
-            //     data
-            //   )
-            //     .then(res => {
-            //       this.sellList = res.data.data.records ? res.data.data.records : [];
-            //       this.page.total = res.data.data.total;
-            //     })
-            //     .finally(() => {
-            //       this.loading = false;
-            //     });
-        },
         getDetail(id) {
             this.loading = true
             getDetails({ id: id })

+ 4 - 1
src/views/client/detailsPage.vue

@@ -65,7 +65,7 @@
       </trade-card>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload v-loading="loadingBtn" typeUpload="CD"
-        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="orderFilesList" display
+        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="corpsFiles" display
         :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
       <el-dialog title="添加客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog avue-dialog--top"
         width="30%" append-to-body @closed="corpTypeClosed">
@@ -191,6 +191,7 @@ export default {
           }
         ]
       },
+      corpsFiles:[]
     };
   },
   props: {
@@ -239,6 +240,7 @@ export default {
           this.form = res.data.data;
           this.data1 = res.data.data.corpsAddrList.filter(e => e.type == 0);
           this.data2 = res.data.data.corpsAddrList.filter(e => e.type == 1);
+          this.corpsFiles=res.data.data.corpsFiles
         })
         .finally(() => {
           this.loadingBtn = false;
@@ -349,6 +351,7 @@ export default {
               this.form = res.data.data;
               this.data1 = res.data.data.corpsAddrList.filter(e => e.type == 0);
               this.data2 = res.data.data.corpsAddrList.filter(e => e.type == 1);
+              this.corpsFiles=res.data.data.corpsFiles
             })
             .finally(() => {
               this.loadingBtn = false;

+ 41 - 39
src/views/client/js/optionList.js

@@ -152,9 +152,9 @@ export const option2 = {
         value: "dictValue"
       },
       // dicUrl: "/api/blade-system/dict-biz/dictionary?code=abbreviation",
-      dicData:[],
+      dicData: [],
       cell: true,
-      minWidth:200,
+      minWidth: 200,
       span: 24,
     },
     {
@@ -167,30 +167,30 @@ export const option2 = {
         label: 'name',
         value: 'name'
       },
-      filterable:true,
+      filterable: true,
       cell: true,
-      minWidth:250,
+      minWidth: 250,
       span: 24,
     },
     {
       label: "详细地址",
       prop: "detailedAddress",
       cell: true,
-      minWidth:350,
+      minWidth: 350,
       span: 24,
     },
     {
       label: "邮编",
       prop: "postalCode",
       cell: true,
-      minWidth:150,
+      minWidth: 150,
       span: 24,
     },
     {
       label: "备注",
       prop: "remarks",
       cell: true,
-      minWidth:300,
+      minWidth: 300,
       span: 24,
     }
   ]
@@ -210,19 +210,19 @@ export const option3 = {
     {
       label: "目的地",
       prop: "destination",
-      minWidth:150,
+      minWidth: 150,
       cell: true,
     },
     {
       label: "物流公司",
       prop: "logisticsCompany",
-      minWidth:200,
+      minWidth: 200,
       cell: true,
     },
     {
       label: "电话",
       prop: "tel",
-      minWidth:150,
+      minWidth: 150,
       cell: true,
     },
     {
@@ -235,26 +235,26 @@ export const option3 = {
         label: 'name',
         value: 'name'
       },
-      minWidth:250,
-      filterable:true,
+      minWidth: 250,
+      filterable: true,
       cell: true
     },
     {
       label: "详细地址",
       prop: "detailedAddress",
-      minWidth:350,
+      minWidth: 350,
       cell: true,
     },
     {
       label: "邮编",
       prop: "postalCode",
-      minWidth:150,
+      minWidth: 150,
       cell: true,
     },
     {
       label: "备注",
       prop: "remarks",
-      minWidth:300,
+      minWidth: 300,
       cell: true,
     }
   ]
@@ -417,7 +417,7 @@ export const sellOption = {
       type: "select",
       dicData: [],
       search: true,
-      filterable:true,
+      filterable: true,
       props: {
         label: "cname",
         value: "cname"
@@ -429,7 +429,7 @@ export const sellOption = {
       prop: "corpType",
       type: "tree",
       dicData: [],
-      filterable:true,
+      filterable: true,
       props: {
         label: "title",
         value: "id"
@@ -443,7 +443,7 @@ export const sellOption = {
       label: "制单人",
       prop: "createUser",
       type: "select",
-      filterable:true,
+      filterable: true,
       props: {
         label: "name",
         value: "id"
@@ -474,51 +474,53 @@ export const capitalOption = {
   column: [
     {
       label: "单号",
-      prop: "a",
+      prop: "sysNo",
       search: true,
       overHidden: true
     },
     {
       label: "收款日期",
-      prop: "b",
+      prop: "settlementDate",
       search: true,
       overHidden: true
     },
     {
       label: "类型",
-      prop: "c",
+      prop: "billType",
+      type: "select",
+      dicData: [
+        {
+          label: "收款",
+          value: "D"
+        },
+        {
+          label: "付款",
+          value: "C"
+        }
+      ],
       search: true,
       overHidden: true
     },
     {
       label: "收款金额",
-      prop: "d",
-      search: true,
+      prop: "amount",
       overHidden: true
     },
     {
       label: "收款账户",
-      prop: "e",
-      search: true,
-      overHidden: true
-    },
-    {
-      label: "制单人",
-      prop: "f",
+      prop: "account",
+      type: "select",
+      props: {
+        label: "dictValue",
+        value: "dictValue"
+      },
+      dicData: [],
       search: true,
       overHidden: true
     },
     {
       label: "备注",
-      prop: "g",
-      overHidden: true
-    },
-    {
-      label: "是否打印",
-      prop: "h",
-      hide: true,
-      search: true,
-      showColumn: false,
+      prop: "remark",
       overHidden: true
     }
   ]

+ 95 - 2
src/views/product/detailsPage.vue

@@ -26,11 +26,18 @@
               <avue-cascader :emit-path="false" check-strictly :show-all-levels="false" v-model="form.goodsTypeId"
                 placeholder="请选择产品分类" :dic="goodsTypeList" :props="props">
               </avue-cascader>
-              <!-- <el-button icon="el-icon-plus" size="mini" @click="corpTypeVisible = true"></el-button> -->
               <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
                 @click="goodsTypeVisible = true"></i>
             </div>
           </template>
+          <template slot="unit">
+            <div style="display:flex;">
+              <avue-select v-model="form.unit" filterable placeholder="请选择单位" :dic="unitList" :props="props2">
+              </avue-select>
+              <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
+                @click="$refs.dictbiz.open()"></i>
+            </div>
+          </template>
           <template slot="whether">
             <el-switch v-model="form.whether" active-text="是" inactive-text="否" active-value="1" inactive-value="0" />
           </template>
@@ -43,6 +50,10 @@
             <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
               :disabled="detailData.status == 1" circle></el-button>
           </template>
+          <template slot="storageIdHeader" slot-scope="{column}">
+            <span style="color: #409EFF;cursor: pointer" @click.stop="storageVisible = true">仓库
+            </span>
+          </template>
           <template slot="menu" slot-scope="{ row, index }">
             <el-button size="small" type="text" @click="rowCell(row, index)">{{
                 row.$cellEdit ? "保存" : "修改"
@@ -65,12 +76,25 @@
           <el-button @click="saveGoodstype" type="primary" size="mini">确 定</el-button>
         </div>
       </el-dialog>
+      <el-dialog title="添加仓库" v-dialogDrag :visible.sync="storageVisible" class="avue-dialog avue-dialog--top"
+        width="30%" append-to-body @closed="storageClosed">
+        <span>
+          <avue-form :key="reload2" ref="storage" v-model="form3" :option="option3" style="margin-top:20px">
+          </avue-form>
+        </span>
+        <div class="avue-dialog__footer">
+          <el-button @click="storageVisible = false" size="mini">取 消</el-button>
+          <el-button @click="savestorage" type="primary" size="mini">确 定</el-button>
+        </div>
+      </el-dialog>
+      <dictbiz-dialog ref="dictbiz" title="添加单位" code="unit" parentId="1585962784498225154" @closed="getAllWorkDicts">
+      </dictbiz-dialog>
     </div>
   </div>
 </template>
 
 <script>
-import { getGoodstype, getDetails, goodsTypesubmit, getStoragetype, submit, itemRemove, disabled,getStoragelist } from "@/api/basicData/product";
+import { getGoodstype, getDetails, goodsTypesubmit, getStoragetype, submit, itemRemove, disabled, getStoragelist, storagesubmit } from "@/api/basicData/product";
 import { optionList } from "./js/optionList";
 export default {
   name: "index",
@@ -78,8 +102,10 @@ export default {
     return {
       loadingBtn: false,
       goodsTypeVisible: false,
+      storageVisible: false,
       form: {},
       form2: {},
+      form3: {},
       data: [],
       option: {
         menuBtn: false,
@@ -203,12 +229,58 @@ export default {
           }
         ]
       },
+      option3: {
+        menuBtn: false,
+        labelWidth: 80,
+        column: [
+          {
+            label: "仓库名称",
+            prop: "cname",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 24,
+          },
+          {
+            label: "仓库编码",
+            prop: "code",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 24,
+          },
+          {
+            label: "上级类型",
+            prop: "parentId",
+            dicData: [],
+            type: "tree",
+            props: {
+              label: 'cname',
+              value: 'id'
+            },
+            span: 24,
+          }
+        ]
+      },
       filesList: [],
       props: {
         label: 'title',
         value: 'value'
       },
+      props2: {
+        label: 'dictValue',
+        value: 'dictValue'
+      },
       goodsTypeList: [],
+      unitList: [],
       optionList: {}
     };
   },
@@ -238,6 +310,10 @@ export default {
       });
       getStoragelist().then(res => {
         this.findObject(this.optionList.column, "storageId").dicData = res.data;
+        this.findObject(this.option3.column, "parentId").dicData = res.data;
+      });
+      this.getWorkDicts("unit").then(res => {
+        this.unitList = res.data.data;
       });
       // this.$refs.crud.init();
     },
@@ -291,10 +367,27 @@ export default {
         }
       });
     },
+    savestorage() {
+      this.$refs["storage"].validate((valid, done) => {
+        done();
+        if (valid) {
+          storagesubmit({ ...this.form3, status: 0 }).then(res => {
+            this.getAllWorkDicts()
+          })
+          this.storageVisible = false
+        } else {
+          return false;
+        }
+      });
+    },
     goodsTypeClosed() {
       this.reload = Math.random();
       this.form2 = this.$options.data().form2
     },
+    storageClosed() {
+      this.reload2 = Math.random();
+      this.form3 = this.$options.data().form3
+    },
     getDetail(id) {
       this.loadingBtn = true
       getDetails({ goodsId: id })

+ 72 - 15
src/views/product/index.vue

@@ -5,7 +5,8 @@
         <el-col :span="4">
           <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;">
             <template slot="addBtn">
-              <i class="el-icon-plus" @click="goodsTypeVisible= true" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"></i>
+              <i class="el-icon-plus" @click="goodsTypeVisible = true"
+                style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"></i>
             </template>
           </avue-tree>
         </el-col>
@@ -17,6 +18,8 @@
             <template slot="menuLeft">
               <el-button type="primary" size="mini" @click.stop="newAdd()">新建产品
               </el-button>
+              <el-button type="primary" size="mini"  @click="excelBox = true">导入
+              </el-button>
             </template>
             <template slot-scope="{ row, index }" slot="cname">
               <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.cname }}
@@ -54,28 +57,41 @@
     </basic-container>
     <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
     <el-dialog title="添加产品分类" v-dialogDrag :visible.sync="goodsTypeVisible" class="avue-dialog avue-dialog--top"
-        width="30%" append-to-body @closed="goodsTypeClosed">
-        <span>
-          <avue-form :key="reload" ref="goodsType" v-model="form2" :option="option2" style="margin-top:20px">
-          </avue-form>
-        </span>
-        <div class="avue-dialog__footer">
-          <el-button @click="goodsTypeVisible = false" size="mini">取 消</el-button>
-          <el-button @click="saveGoodstype" type="primary" size="mini">确 定</el-button>
-        </div>
-      </el-dialog>
+      width="30%" append-to-body @closed="goodsTypeClosed">
+      <span>
+        <avue-form :key="reload" ref="goodsType" v-model="form2" :option="option2" style="margin-top:20px">
+        </avue-form>
+      </span>
+      <div class="avue-dialog__footer">
+        <el-button @click="goodsTypeVisible = false" size="mini">取 消</el-button>
+        <el-button @click="saveGoodstype" type="primary" size="mini">确 定</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="添加产品" append-to-body :visible.sync="excelBox" :close-on-click-modal="false" width="555px">
+      <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+        <template slot="excelTemplate">
+          <el-button type="primary" @click="derivation">
+            点击下载<i class="el-icon-download el-icon--right"></i>
+          </el-button>
+        </template>
+      </avue-form>
+      <p style="text-align: center;color: #DC0505">
+        温馨提示 第一次导入时请先下载模板
+      </p>
+    </el-dialog>
   </div>
 </template>
   
 <script>
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
-import { getList, remove, getAllgoods,getGoodstype,goodsTypesubmit } from "@/api/basicData/product";
+import { getList, remove, getAllgoods, getGoodstype, goodsTypesubmit } from "@/api/basicData/product";
+import { getToken } from "@/util/auth";
 export default {
   name: "index",
   data() {
     return {
-      goodsTypeVisible:false,
+      goodsTypeVisible: false,
       src: '',
       show: true,
       loading: false,
@@ -131,6 +147,33 @@ export default {
           value: "value",
         }
       },
+      excelBox: false,
+      excelForm: {},
+      excelOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "模板下载",
+            prop: "excelTemplate",
+            formslot: true,
+            span: 24
+          },
+          {
+            label: "模板上传",
+            prop: "excelFile",
+            type: "upload",
+            drag: true,
+            loadText: "模板上传中,请稍等",
+            span: 24,
+            propsHttp: {
+              res: "data"
+            },
+            tip: "请上传 .xls,.xlsx 标准格式文件",
+            action: "/api/blade-client/goodsDescParts/import-descParts-info"
+          }
+        ]
+      }
     };
   },
   components: {
@@ -161,7 +204,7 @@ export default {
         this.findObject(this.option.column, "cname").dicData = res.data.data
       });
       getGoodstype().then(res => {
-        this.treeData= res.data.data;
+        this.treeData = res.data.data;
         this.findObject(this.option2.column, "parentId").dicData = res.data.data;
       });
       this.$refs.crud.init();
@@ -174,6 +217,18 @@ export default {
       }
       this.$refs.crud.getTableHeight();
     },
+    derivation() {
+      window.open(
+        `/api/blade-client/goodsDescParts/export-descParts-info?${
+          this.website.tokenHeader
+        }=${getToken()}`
+      );
+    },
+    uploadAfter(res, done, loading, column) {
+      this.excelBox = false;
+      this.refreshChange();
+      done();
+    },
     cellStyle() {
       return "padding:0;height:40px;";
     },
@@ -298,9 +353,11 @@ export default {
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }
-::v-deep .el-input-group__append{
+
+::v-deep .el-input-group__append {
   padding: 0 0px !important;
 }
+
 .stat-td {
   text-align: center;
   position: relative;

+ 152 - 0
src/views/purchaseOrder/components/feeInfo.vue

@@ -0,0 +1,152 @@
+<template>
+    <trade-card title="付款信息">
+        <avue-crud ref="crud" :data="data" :option="feeOption" @saveColumn="saveColumn" @resetColumn="resetColumn"
+            :cell-style="cellStyle">
+            <template slot="headerSerial">
+                <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
+                    :disabled="detailData.status == 1" circle></el-button>
+            </template>
+            <template slot="menu" slot-scope="{ row, index }">
+                <el-button size="small" type="text" v-if="!row.id" @click="rowCell(row, index)">保存</el-button>
+            </template>
+            <template slot="accountHeader" slot-scope="{column}">
+                <span style="color: #409EFF;cursor: pointer" @click.stop="$refs.dictbiz.open()">付款账户
+                </span>
+            </template>
+        </avue-crud>
+        <dictbiz-dialog ref="dictbiz" title="添加账户" code="account" parentId="1587970253894307841"
+            @closed="getAllWorkDicts"></dictbiz-dialog>
+    </trade-card>
+</template>
+  
+<script>
+import { feeOption } from "../js/optionList";
+import { collectPayment } from "@/api/basicData/salesOrder";
+export default {
+    data() {
+        return {
+            feeOption: {}
+        };
+    },
+    props: {
+        data: {
+            type: Array
+        },
+        detailData: {
+            type: Object
+        },
+        form: {
+            type: Object
+        }
+    },
+    async created() {
+        this.feeOption = await this.getColumnData(
+            this.getColumnName(233),
+            feeOption
+        );
+        this.getAllWorkDicts()
+    },
+    methods: {
+        refreshTable() {
+            this.$refs.crud.refreshTable();
+        },
+        getAllWorkDicts() {
+            this.getWorkDicts("account").then(res => {
+                this.findObject(this.feeOption.column, "account").dicData = res.data.data;
+            });
+            this.$refs.crud.init();
+        },
+        cellStyle() {
+            return "padding:0;height:40px;";
+        },
+        addRow() {
+            // if (!this.form.corpId) {
+            //     return this.$message.error("请选择供应商名称");
+            // }
+            this.data.push({ $cellEdit: true })
+        },
+        rowCell(row, index) {
+            collectPayment({ ...this.form, orderItemsList: [], settlementList: [], currentAmount: row.amount, account: row.account }).then(res => {
+                this.$emit('getPay', res.data.data)
+                this.$message.success("保存成功");
+            })
+
+        },
+        rowDel(row, index) {
+            this.$confirm("确定删除数据?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                if (row.id) {
+                    //   remove(row.id).then(res => {
+                    //     this.$message({
+                    //       type: "success",
+                    //       message: "删除成功!"
+                    //     });
+                    //     this.data.splice(index, 1);
+                    //   });
+                } else {
+                    this.$message({
+                        type: "success",
+                        message: "删除成功!"
+                    });
+                    this.data.splice(index, 1);
+                }
+            });
+        },
+        async saveColumn() {
+            const inSave = await this.saveColumnData(
+                this.getColumnName(233),
+                this.feeOption
+            );
+            if (inSave) {
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                });
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        },
+        async resetColumn() {
+            this.feeOption = feeOption;
+            const inSave = await this.delColumnData(
+                this.getColumnName(233),
+                feeOption
+            );
+            if (inSave) {
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                });
+                this.getAllWorkDicts()
+                this.$message.success("重置成功");
+                //关闭窗口
+                setTimeout(() => {
+                    this.$refs.crud.$refs.dialogColumn.columnBox = false;
+                }, 1000);
+            }
+        }
+    }
+};
+</script>
+  
+<style scoped>
+::v-deep .select-component {
+    display: flex;
+}
+
+.page-crad ::v-deep .basic-container__card {
+    height: 94.2vh;
+}
+
+.itemTable ::v-deep .el-table {
+    width: 738px;
+}
+
+::v-deep .el-input-group__append,
+.el-input-group__prepend {
+    padding: 0 5px;
+}
+</style>
+  

+ 693 - 0
src/views/purchaseOrder/detailsPage.vue

@@ -0,0 +1,693 @@
+<template>
+  <div>
+    <div class="borderless">
+      <div class="customer-head">
+        <div class="customer-back">
+          <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+            @click="backToList">返回列表
+          </el-button>
+        </div>
+        <div class="add-customer-btn">
+          <el-button type="primary" size="small" v-if="detailData.status == 1 && form.confirmStatus == 0"
+            class="el-button--small-yh " @click.stop="openEdit">编辑
+          </el-button>
+          <el-button type="primary" size="small" v-if="!form.id && detailData.status != 1" @click="editCustomer">
+            保存数据
+          </el-button>
+          <el-button type="primary" size="small" v-if="form.id && detailData.status != 1 && form.confirmStatus == 0"
+            @click="fixSave">
+            修改数据
+          </el-button>
+          <el-button type="primary" size="small" v-if="form.id && detailData.status != 1 && form.confirmStatus == 0"
+            @click="submit">
+            提交
+          </el-button>
+          <el-button type="primary" size="small" v-if="form.confirmStatus == 1" @click="revoke">
+            撤销
+          </el-button>
+        </div>
+      </div>
+      <!-- <containerTitle title="基础资料" style="margin-top: 60px"></containerTitle> -->
+      <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
+        <avue-form ref="form" class="trading-form" v-model="form" :option="option">
+          <template slot="corpId">
+            <crop-select v-model="form.corpId" corpType="GYS" :disabled="detailData.status == 1"
+              @getCorpData="getCorpData"></crop-select>
+          </template>
+        </avue-form>
+      </trade-card>
+      <trade-card title="商品信息" v-loading="loadingBtn">
+        <avue-form ref="form" class="trading-form" v-model="form" :option="option2">
+          <template slot="thisUsedProfit">
+            <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1" @change="amountChange"
+              placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
+          </template>
+        </avue-form>
+        <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
+          @resetColumn="resetColumn" :cell-style="cellStyle">
+          <template slot="headerSerial">
+            <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
+              :disabled="detailData.status == 1" circle></el-button>
+          </template>
+          <template slot="cname" slot-scope="{ row, index }">
+            <el-select v-if="row.$cellEdit" v-model="row.cname" placeholder="请选择" size="small" filterable
+              @change="cnameChange(row, index)">
+              <el-option v-for="item in goodsoptions" :key="item.itemId" :label="item.cname" :value="item.cname">
+              </el-option>
+            </el-select>
+            <span v-else>{{ row.cname }}</span>
+          </template>
+          <template slot="unitHeader" slot-scope="{column}">
+                <span style="color: #409EFF;cursor: pointer" @click.stop="$refs.dictbiz.open()">单位
+                </span>
+            </template>
+          <template slot="storageInQuantity" slot-scope="{ row, index }">
+            <el-input-number v-if="row.$cellEdit" v-model="row.storageInQuantity" @change="countChange(row)"
+              placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
+            <span v-else>{{ row.storageInQuantity }}</span>
+          </template>
+          <template slot="price" slot-scope="{ row, index }">
+            <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" placeholder="请输入"
+              size="small" :controls="false" style="width:100%;"></el-input-number>
+            <span v-else>{{ row.price }}</span>
+          </template>
+          <template slot="purchaseAmount" slot-scope="{ row, index }">
+            <el-input-number v-if="row.$cellEdit" v-model="row.purchaseAmount" @change="countChange(row)"
+              placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
+            <span v-else>{{ row.purchaseAmount }}</span>
+          </template>
+          <template slot="menu" slot-scope="{ row, index }">
+            <el-button size="small" type="text" :disabled="detailData.status == 1" @click="rowCell(row, index)">{{
+                row.$cellEdit ? "保存" : "修改"
+            }}</el-button>
+            <el-button size="small" type="text" :disabled="detailData.status == 1" @click="rowDel(row, index)">删除
+            </el-button>
+          </template>
+        </avue-crud>
+      </trade-card>
+      <fee-info ref="feeInfo" :data="settlementList" :form="form" :detailData="detailData" @getPay="getPay"
+        v-loading="loadingBtn">
+      </fee-info>
+      <containerTitle title="上传附件"></containerTitle>
+      <c-upload v-loading="loadingBtn" typeUpload="CD"
+        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="orderFilesList" display
+        :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
+      <el-dialog :title="addressTitle" v-dialogDrag :visible.sync="addressVisible" class="avue-dialog avue-dialog--top"
+        width="50%" append-to-body>
+        <span>
+          <el-tabs v-model="activeName">
+            <el-tab-pane label="供应商地址" name="first">
+              <avue-form class="trading-form" v-model="form2" :option="optiontabs1"></avue-form>
+            </el-tab-pane>
+            <el-tab-pane label="物流地址" name="second">
+              <avue-form class="trading-form" v-model="form3" :option="optiontabs2"></avue-form>
+            </el-tab-pane>
+          </el-tabs>
+        </span>
+        <div class="avue-dialog__footer">
+          <el-button @click="addressVisible = false">取 消</el-button>
+          <el-button @click="addressVisible = false" type="primary">确 定</el-button>
+        </div>
+      </el-dialog>
+      <dictbiz-dialog ref="dictbiz" title="添加单位" code="unit" parentId="1585962784498225154" @closed="getAllWorkDicts"></dictbiz-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import { optionList } from "./js/optionList";
+import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment } from "@/api/basicData/salesOrder";
+import feeInfo from "./components/feeInfo.vue";
+import { multiply, sum, subtract } from "@/util/calculate";
+export default {
+  name: "index",
+  data() {
+    return {
+      activeName: 'first',
+      loadingBtn: false,
+      addressTitle: null,
+      addressVisible: false,
+      form: {},
+      form2: {
+      },
+      form3: {
+
+      },
+      data: [],
+      option: {
+        menuBtn: false,
+        labelWidth: 90,
+        disabled: false,
+        column: [
+          {
+            label: "供应商名称",
+            prop: "corpId",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8,
+          },
+          {
+            label: "送货地址",
+            prop: "arrivalAddress",
+            type: 'select',
+            dicData: [],
+            props: {
+              label: 'detailedAddress',
+              value: 'detailedAddress'
+            },
+            allowCreate: true,
+            filterable: true,
+            span: 16,
+          },
+          {
+            label: "采购日期",
+            prop: "businesDate",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            span: 8,
+          },
+          {
+            label: "计划付款日期",
+            prop: "advanceCollectionDate",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            span: 8,
+          },
+          {
+            label: "收货日期",
+            prop: "requiredDeliveryDate",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            span: 8,
+          },
+          {
+            label: "备注",
+            prop: "orderRemark",
+            placeholder: "打印时显示",
+            type: "textarea",
+            minRows: 3,
+            span: 24,
+          }
+        ]
+      },
+      option2: {
+        menuBtn: false,
+        labelWidth: 80,
+        disabled: false,
+        column: [
+          {
+            label: "税率",
+            prop: "exchangeRate",
+            type: "select",
+            props: {
+              label: "dictValue",
+              value: "dictKey"
+            },
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=tax_rate",
+            span: 4,
+          },
+          {
+            label: "采购总数量",
+            prop: "storageQuantity",
+            disabled: true,
+            span: 4,
+          },
+          {
+            label: "成本",
+            prop: "costAmount",
+            disabled: true,
+            span: 4,
+          },
+          {
+            label: "毛利",
+            prop: "grossProfit",
+            disabled: true,
+            span: 4,
+          },
+          {
+            label: "订单金额",
+            prop: "purchaseAmount",
+            disabled: true,
+            span: 4,
+          },
+          {
+            label: "优惠金额",
+            prop: "thisUsedProfit",
+            span: 4,
+          },
+          {
+            label: "合同金额",
+            prop: "orderAmount",
+            disabled: true,
+            span: 8,
+          },
+          {
+            label: "应付金额",
+            prop: "balanceAmount",
+            disabled: true,
+            span: 8,
+          },
+          {
+            label: "已付金额",
+            prop: "settlmentAmount",
+            disabled: true,
+            span: 8,
+          }
+        ]
+      },
+      optiontabs1: {
+        menuBtn: false,
+        labelWidth: 90,
+        column: [
+          {
+            label: "简称",
+            prop: "a",
+            type: "select",
+            span: 24,
+          },
+          {
+            label: "地址",
+            prop: "b",
+            type: "select",
+            span: 24,
+          },
+          {
+            label: "详细地址",
+            prop: "c",
+            span: 24,
+          },
+          {
+            label: "邮编",
+            prop: "d",
+            span: 24,
+          },
+          {
+            label: "备注",
+            prop: "e",
+            type: 'textarea',
+            minRows: 3,
+            span: 24,
+          },
+          {
+            label: "地址智能识别",
+            prop: "ad",
+            placeholder: "例:上海市徐汇区枫林街道斜土路100号",
+            type: "textarea",
+            minRows: 3,
+            span: 24,
+          }
+        ]
+      },
+      optiontabs2: {
+        menuBtn: false,
+        labelWidth: 80,
+        column: [
+          {
+            label: "目的地",
+            prop: "a",
+            type: "select",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 24,
+          },
+          {
+            label: "物流公司",
+            prop: "b",
+            span: 24,
+          },
+          {
+            label: "电话",
+            prop: "c",
+            span: 24,
+          },
+          {
+            label: "地址",
+            prop: "d",
+            span: 24,
+          },
+          {
+            label: "详细地址",
+            prop: "e",
+            span: 24,
+          },
+          {
+            label: "邮编",
+            prop: "f",
+            span: 24,
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            type: "textarea",
+            minRows: 3,
+            span: 24,
+          },
+          {
+            label: "地址智能识别",
+            prop: "g",
+            type: "textarea",
+            minRows: 3,
+            span: 24,
+          }
+        ]
+      },
+      optionList: {},
+      goodsoptions: [],
+      settlementList: [],
+    };
+  },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
+  components: {
+    feeInfo,
+  },
+  async created() {
+    this.optionList = await this.getColumnData(
+      this.getColumnName(214),
+      optionList
+    );
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
+    }
+    if (this.detailData.status == 1) {
+      this.option.disabled = true;
+      this.option2.disabled = true;
+    }
+    this.getAllWorkDicts()
+    getAllgoods().then(res => {
+      this.goodsoptions = res.data.data
+    });
+  },
+  methods: {
+    getAllWorkDicts() {
+      this.getWorkDicts("unit").then(res => {
+        this.findObject(this.optionList.column, "unit").dicData = res.data.data;
+      });
+      this.$refs.crud.init();
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    cnameChange(row) {
+      console.log(row)
+      if (row.cname) {
+        this.goodsoptions.forEach(e => {
+          if (e.cname == row.cname) {
+            row.itemId = e.id
+            row.unit = e.unit
+            row.price = e.standardPrice
+            row.storageInQuantity = 1
+            row.amount = e.standardPrice
+            row.purchaseAmount = e.purchasePrice
+            row.storageAmount = e.purchasePrice
+          }
+        })
+      } else {
+        row.unit = null
+        row.price = null
+        row.purchaseAmount = null
+      }
+      this.countChange(row)
+    },
+    amountChange() {
+      let val = 0
+      this.data.forEach(e => {
+        val = sum(val, e.amount)
+        this.form.purchaseAmount = val
+        this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
+      })
+    },
+    countChange(row) {
+      row.amount = multiply(row.price, row.storageInQuantity)
+      row.storageAmount = multiply(row.purchaseAmount, row.storageInQuantity)
+      let val = 0
+      this.data.forEach(e => {
+        val = sum(val, e.amount)
+        this.form.purchaseAmount = val
+        this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
+      })
+    },
+    getDetail(id) {
+      this.loadingBtn = true
+      getDetails({ id: id })
+        .then(res => {
+          this.form = res.data.data;
+          this.data = res.data.data.orderItemsList;
+          this.settlementList = res.data.data.settlementList
+          this.getAddress(res.data.data)
+        })
+        .finally(() => {
+          this.loadingBtn = false;
+        });
+    },
+    getCorpData(row) {
+      if (row) {
+        this.form.corpsName = row.cname
+        getCorpDetails({ id: row.id }).then(res => {
+          this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
+        })
+      } else {
+        this.form.corpsName = null
+        this.findObject(this.option.column, "arrivalAddress").dicData = []
+      }
+    },
+    getAddress(row) {
+      getCorpDetails({ id: row.corpId }).then(res => {
+        this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList;
+      })
+    },
+    addRow() {
+      this.data.push({ $cellEdit: true })
+    },
+    rowCell(row, index) {
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    rowDel(row, index) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        if (row.id) {
+          remove(row.id).then(res => {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.data.splice(index, 1);
+          });
+        } else {
+          this.$message({
+            type: "success",
+            message: "删除成功!"
+          });
+          this.data.splice(index, 1);
+        }
+      });
+    },
+    getPay(row) {
+      this.getDetail(row.id);
+    },
+    //修改提交触发
+    editCustomer() {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          this.loadingBtn = true;
+          save({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
+            .then(res => {
+              this.$message.success("保存成功");
+              this.form = res.data.data;
+              this.data = res.data.data.orderItemsList;
+              this.settlementList = res.data.data.settlementList
+            })
+            .finally(() => {
+              this.loadingBtn = false;
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    fixSave() {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          this.loadingBtn = true;
+          fixSave({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
+            .then(res => {
+              this.$message.success("修改成功");
+              this.form = res.data.data;
+              this.data = res.data.data.orderItemsList;
+              this.settlementList = res.data.data.settlementList
+            })
+            .finally(() => {
+              this.loadingBtn = false;
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    submit() {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          this.loadingBtn = true;
+          submit({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
+            .then(res => {
+              this.$message.success("提交成功");
+              this.form = res.data.data;
+              this.data = res.data.data.orderItemsList;
+              this.settlementList = res.data.data.settlementList
+              this.$emit("goBack");
+            })
+            .finally(() => {
+              this.loadingBtn = false;
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    revoke() {
+      this.$confirm('此操作将会撤销单子, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loadingBtn = true;
+        revoke({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
+          .then(res => {
+            this.$message.success("撤销成功");
+            this.form = res.data.data;
+            this.data = res.data.data.orderItemsList;
+            this.settlementList = res.data.data.settlementList
+            this.openEdit()
+          })
+          .finally(() => {
+            this.loadingBtn = false;
+          });
+      }).catch(() => {
+      });
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(214),
+        this.optionList
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.optionList = optionList;
+      const inSave = await this.delColumnData(
+        this.getColumnName(214),
+        optionList
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.getAllWorkDicts()
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    openEdit() {
+      this.detailData.status = 2
+      this.option = this.$options.data().option;
+      this.option2 = this.$options.data().option2;
+      this.$refs.crud.refreshTable();
+      this.$refs.feeInfo.refreshTable();
+    },
+    //返回列表
+    backToList() {
+      this.$emit("goBack");
+    }
+  },
+  watch: {
+    // data: function (rows) {
+    //   let val = 0
+    //   rows.forEach(e => {
+    //     val = sum(val, e.amount)
+    //     this.form.purchaseAmount = val
+    //     this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
+    //   })
+    // }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.trading-form ::v-deep .el-form-item {
+  margin-bottom: 8px !important;
+}
+
+::v-deep .el-dialog__body {
+  padding: 0px 20px 15px 20px;
+}
+
+::v-deep .el-form-item__error {
+  display: none !important;
+}
+
+.img-form ::v-deep .el-form-item {
+  height: 150px;
+  line-height: 150px;
+  margin-bottom: 8px !important;
+}
+
+.img-form ::v-deep .avue-upload__icon {
+  font-size: 20px;
+  width: 150px;
+  height: 150px;
+  line-height: 150px;
+}
+
+::v-deep .el-table .cell {
+  padding: 0 2px !important;
+}
+
+::v-deep .avue-crud .el-table .el-form-item__label {
+  left: -1px;
+}
+
+.addressTabs {
+  display: flex;
+  justify-content: center;
+
+  span {
+    width: 100px;
+    font-size: 18px;
+    font-weight: 600;
+    text-align: center;
+  }
+}
+</style>

+ 320 - 0
src/views/purchaseOrder/index.vue

@@ -0,0 +1,320 @@
+<template>
+  <div>
+    <basic-container v-show="show" class="page-crad">
+      <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
+        @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
+        @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
+        <template slot="menuLeft">
+          <el-button type="primary" size="mini" @click.stop="newAdd()">新建采购单
+          </el-button>
+        </template>
+        <template slot="corpIdSearch">
+          <crop-select v-model="search.corpId" corpType="GYS"></crop-select>
+        </template>
+        <template slot-scope="{ row, index }" slot="corpId">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.corpsName }}
+          </span>
+        </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']"
+            :picker-options="pickerOptions">
+          </el-date-picker>
+        </template>
+        <template slot-scope="{ row, index }" slot="menu">
+          <!-- <el-tooltip class="item" effect="dark" content="新建采购订单" placement="top">
+            <i class="tradingIcon icon-add" />
+          </el-tooltip>
+          <el-tooltip class="item" effect="dark" content="删除" placement="top">
+            <i class="tradingIcon icon-del" />
+          </el-tooltip>
+          <el-tooltip class="item" effect="dark" content="编辑" placement="top">
+            <i class="tradingIcon icon-edit" />
+          </el-tooltip>
+          <el-tooltip class="item" effect="dark" content="付款" placement="top">
+            <i class="tradingIcon icon-proceeds" />
+          </el-tooltip>
+          <el-tooltip class="item" effect="dark" content="发货" placement="top">
+            <i class="tradingIcon icon-deliver" />
+          </el-tooltip>
+          <el-tooltip class="item" effect="dark" content="对账" placement="top">
+            <i class="tradingIcon icon-reconciliation" />
+          </el-tooltip> -->
+          <!-- <el-button type="text" size="small" @click.stop="editOpen(row, 2)">
+            查看
+          </el-button>
+          <el-button type="text" size="small" @click.stop="rowDel(row, index)">
+            删除
+          </el-button> -->
+        </template>
+      </avue-crud>
+    </basic-container>
+    <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
+  </div>
+</template>
+  
+<script>
+import detailsPage from "./detailsPage";
+import { option } from "./js/optionList";
+import { getList, getCorpsAll, gainUser,getCorpType,getAllgoods } from "@/api/basicData/salesOrder";
+export default {
+  name: "index",
+  data() {
+    return {
+      src: '',
+      show: true,
+      loading: false,
+      search: {},
+      detailData: {},
+      dataList: [],
+      selectionList: [],
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {},
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: '当天',
+            onClick(picker) {
+              const date = new Date();
+              const start = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
+              const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
+              picker.$emit('pick', [start, end]);
+            }
+          },
+          {
+            text: '昨天',
+            onClick(picker) {
+              const date = new Date();
+              const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 0, 0, 0);
+              const end = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 23, 59, 59);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '当月',
+            onClick(picker) {
+              const date = new Date();
+              const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
+              const end = new Date(date.getFullYear(), date.getMonth() + 1, 0, 23, 59, 59);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '当季',
+            onClick(picker) {
+              const date = new Date();
+              const start = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3, 1, 0, 0, 0);
+              const end = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3 + 3, 0, 23, 59, 59);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '当年',
+            onClick(picker) {
+              const date = new Date();
+              const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
+              const end = new Date(date.getFullYear() + 1, 0, 0, 23, 59, 59);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一周',
+            onClick(picker) {
+              const date = new Date();
+              const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7, 0, 0, 0);
+              const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近二周',
+            onClick(picker) {
+              const date = new Date();
+              const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 2, 0, 0, 0);
+              const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三周',
+            onClick(picker) {
+              const date = new Date();
+              const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 3, 0, 0, 0);
+              const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+      },
+    };
+  },
+  components: {
+    detailsPage
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(213), option);
+    this.option.height = window.innerHeight - 210;
+    this.getAllWorkDicts()
+  },
+  methods: {
+    getAllWorkDicts() {
+      gainUser().then(res => {
+        this.findObject(this.option.column, "createUser").dicData = res.data.data;
+      })
+      getCorpType({ corpType: 'GYS' }).then(res => {
+        this.findObject(this.option.column, "corpType").dicData= res.data.data
+      });
+      getAllgoods().then(res => {
+        this.findObject(this.option.column, "cname").dicData= res.data.data
+      });
+      this.$refs.crud.init();
+    },
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 138;
+      } else {
+        this.option.height = this.option.height + 138;
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    newAdd() {
+      this.show = false;
+    },
+    onLoad(page, params = {}) {
+      let data = this.deepClone(Object.assign(params, this.search));
+      data.billType = 'CG';
+      data.tradeType = 'YPJ';
+      if (data.businesDate) {
+        data.orderStartDate = data.businesDate[0];
+        data.orderEndDate = data.businesDate[1];
+      }
+      delete data.businesDate
+      this.loading = true;
+      getList(
+        page.currentPage,
+        page.pageSize,
+        data
+      )
+        .then(res => {
+          this.dataList = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    editOpen(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    rowDel(row, index, done) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        // remove(row.id).then(res => {
+        //   if (res.data.code == 200) {
+        //     this.$message({
+        //       type: "success",
+        //       message: "删除成功!"
+        //     });
+        //     this.onLoad(this.page, this.search);
+        //   }
+        // });
+      });
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(213),
+        this.option
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(this.getColumnName(213), option);
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.getAllWorkDicts()
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //返回列表
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+      this.onLoad(this.page, this.search);
+    },
+  }
+}
+</script>
+  
+<style  lang="scss"  scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.2vh;
+}
+
+.stat-td {
+  text-align: center;
+  position: relative;
+}
+
+.stat-img {
+  width: 95%;
+  height: 100px;
+}
+
+.stat-tip {
+  position: absolute;
+  left: 15px;
+  top: 5px;
+
+  .money {
+    color: #fff;
+    font-size: 28px;
+    text-align: left;
+    font-weight: 600;
+  }
+
+  .title {
+    color: #fff;
+    font-size: 14px;
+    text-align: left;
+    margin-top: 5px;
+    margin-bottom: 0px;
+  }
+}
+</style>
+  

+ 271 - 0
src/views/purchaseOrder/js/optionList.js

@@ -0,0 +1,271 @@
+import { number } from "echarts"
+
+export const option = {
+  searchShow: true,
+  searchMenuSpan: 8,
+  align: "center",
+  searchSpan: 8,
+  tip: false,
+  border: true,
+  index: true,
+  addBtn: false,
+  viewBtn: false,
+  editBtn: false,
+  delBtn: false,
+  menu: false,
+  menuWidth: 150,
+  searchIcon: true,
+  searchIndex: 2,
+  column: [
+    {
+      label: "单号",
+      prop: "sysNo",
+      overHidden: true,
+      search: true,
+      index: 1
+    },
+    {
+      label: "供应商名称",
+      prop: "corpId",
+      type: 'select',
+      dicData: [],
+      search: true,
+      overHidden: true,
+      index: 2
+    },
+    {
+      label: "电话",
+      prop: "tel",
+      type: 'select',
+      dicData: [],
+      search: true,
+      overHidden: true,
+      index: 3
+    },
+    {
+      label: "日期",
+      prop: "businesDate",
+      search: true,
+      overHidden: true,
+      index: 4
+    },
+    {
+      label: "合同金额",
+      prop: "debitAmount",
+      overHidden: true,
+      index: 5
+    },
+    {
+      label: "已送货",
+      prop: "deliveringAmount",
+      overHidden: true,
+      search: true,
+      index: 6
+    },
+    {
+      label: "未付款",
+      prop: "balanceAmount",
+      overHidden: true,
+      search: true,
+      index: 7
+    },
+    {
+      label: "已付款",
+      prop: "settlmentAmount",
+      overHidden: true,
+      search: true,
+      index: 8
+    },
+    {
+      label: "付款状态",
+      prop: "status",
+      type: 'select',
+      index: 9
+    },
+    {
+      label: "送货状态",
+      prop: "status",
+      type: 'select',
+      search: true,
+      index: 10
+    },
+    {
+      label: "产品",
+      prop: "cname",
+      type: "select",
+      dicData: [],
+      search: true,
+      filterable:true,
+      props: {
+        label: "cname",
+        value: "cname"
+      },
+      index: 11
+    },
+    {
+      label: "供应商分类",
+      prop: "corpType",
+      type: "tree",
+      dicData: [],
+      filterable:true,
+      props: {
+        label: "title",
+        value: "id"
+      },
+      hide: true,
+      search: true,
+      showColumn: false,
+      index: 12
+    },
+    {
+      label: "制单人",
+      prop: "createUser",
+      type: "select",
+      filterable:true,
+      props: {
+        label: "name",
+        value: "id"
+      },
+      dicData: [],
+      hide: true,
+      search: true,
+      showColumn: false,
+      index: 14
+    }
+  ]
+}
+export const optionList = {
+  align: "center",
+  addBtn: false,
+  refreshBtn: false,
+  editBtn: false,
+  delBtn: false,
+  border: true,
+  menuWidth: 120,
+  stripe: true,
+  index: true,
+  indexSlot: true,
+  showSummary: true,
+  summaryText: "合计",
+  sumColumnList: [
+    {
+      name: "amount",
+      type: "sum"
+    },
+    {
+      name: "storageAmount",
+      type: "sum"
+    }
+  ],
+  column: [
+    {
+      label: "产品",
+      prop: "cname",
+      width:'250px',
+      overHidden: true
+    },
+    {
+      label: "图片",
+      prop: "img",
+      overHidden: true
+    },
+    {
+      label: "数量",
+      prop: "storageInQuantity",
+      overHidden: true
+    },
+    {
+      label: "单位",
+      prop: "unit",
+      type: "select",
+      props: {
+        label: "dictValue",
+        value: "dictValue"
+      },
+      dicData:[],
+      cell: true,
+      overHidden: true
+    },
+    {
+      label: "单价",
+      prop: "price",
+      overHidden: true
+    },
+    {
+      label: "金额",
+      prop: "amount",
+      overHidden: true
+    },
+    {
+      label: "送货数量",
+      prop: "actualQuantity",
+      type: 'number',
+      controls: false,
+      cell: true,
+      overHidden: true
+    },
+    {
+      label: "备注",
+      prop: "remarks",
+      cell: true,
+      overHidden: true
+    },
+    {
+      label: "进价",
+      prop: "purchasePrice",
+      overHidden: true
+    }
+  ]
+}
+
+export const feeOption = {
+  align: "center",
+  addBtn: false,
+  refreshBtn: false,
+  editBtn: false,
+  delBtn: false,
+  border: true,
+  menuWidth: 120,
+  stripe: true,
+  index: true,
+  indexSlot: true,
+  column: [
+    {
+      label: "付款单号",
+      prop: "sysNo",
+      overHidden: true
+    },
+    {
+      label: "付款日期",
+      prop: "settlementDate",
+      type: "datetime",
+      format: "yyyy-MM-dd HH:mm:ss",
+      valueFormat: "yyyy-MM-dd HH:mm:ss",
+      overHidden: true
+    },
+    {
+      label: "付款金额",
+      prop: "amount",
+      cell: true,
+      overHidden: true
+    },
+    {
+      label: "付款账户",
+      prop: "account",
+      type: "select",
+      props: {
+        label: "dictValue",
+        value: "dictValue"
+      },
+      dicData:[],
+      cell: true,
+      overHidden: true
+    },
+    {
+      label: "备注",
+      prop: "remark",
+      cell: true,
+      overHidden: true
+    }
+  ]
+}

+ 51 - 0
src/views/salesOrder/components/feeInfo.vue

@@ -6,12 +6,22 @@
                 <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
                     :disabled="detailData.status == 1" circle></el-button>
             </template>
+            <template slot="menu" slot-scope="{ row, index }">
+                <el-button size="small" type="text" v-if="!row.id" @click="rowCell(row, index)">保存</el-button>
+            </template>
+            <template slot="accountHeader" slot-scope="{column}">
+                <span style="color: #409EFF;cursor: pointer" @click.stop="$refs.dictbiz.open()">收款账户
+          </span>
+            </template>
         </avue-crud>
+        <dictbiz-dialog ref="dictbiz" title="添加账户" code="account" parentId="1587970253894307841"
+            @closed="getAllWorkDicts"></dictbiz-dialog>
     </trade-card>
 </template>
   
 <script>
 import { feeOption } from "../js/optionList";
+import { collectPayment } from "@/api/basicData/salesOrder";
 export default {
     data() {
         return {
@@ -34,8 +44,18 @@ export default {
             this.getColumnName(224),
             feeOption
         );
+        this.getAllWorkDicts()
     },
     methods: {
+        refreshTable() {
+            this.$refs.crud.refreshTable();
+        },
+        getAllWorkDicts() {
+            this.getWorkDicts("account").then(res => {
+                this.findObject(this.feeOption.column, "account").dicData = res.data.data;
+            });
+            this.$refs.crud.init();
+        },
         cellStyle() {
             return "padding:0;height:40px;";
         },
@@ -45,6 +65,36 @@ export default {
             // }
             this.data.push({ $cellEdit: true })
         },
+        rowCell(row, index) {
+            collectPayment({ ...this.form, orderItemsList: [], settlementList: [], currentAmount: row.amount, account: row.account }).then(res => {
+                this.$emit('getPay', res.data.data)
+                this.$message.success("保存成功");
+            })
+
+        },
+        rowDel(row, index) {
+            this.$confirm("确定删除数据?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                if (row.id) {
+                    //   remove(row.id).then(res => {
+                    //     this.$message({
+                    //       type: "success",
+                    //       message: "删除成功!"
+                    //     });
+                    //     this.data.splice(index, 1);
+                    //   });
+                } else {
+                    this.$message({
+                        type: "success",
+                        message: "删除成功!"
+                    });
+                    this.data.splice(index, 1);
+                }
+            });
+        },
         async saveColumn() {
             const inSave = await this.saveColumnData(
                 this.getColumnName(224),
@@ -69,6 +119,7 @@ export default {
                 this.$nextTick(() => {
                     this.$refs.crud.doLayout();
                 });
+                this.getAllWorkDicts()
                 this.$message.success("重置成功");
                 //关闭窗口
                 setTimeout(() => {

+ 165 - 31
src/views/salesOrder/detailsPage.vue

@@ -8,28 +8,39 @@
           </el-button>
         </div>
         <div class="add-customer-btn">
-          <el-button type="primary" size="small" @click="editCustomer">
+          <el-button type="primary" size="small" v-if="detailData.status == 1 && form.confirmStatus == 0"
+            class="el-button--small-yh " @click.stop="openEdit">编辑
+          </el-button>
+          <el-button type="primary" size="small" v-if="!form.id && detailData.status != 1" @click="editCustomer">
             保存数据
           </el-button>
+          <el-button type="primary" size="small" v-if="form.id && detailData.status != 1 && form.confirmStatus == 0"
+            @click="fixSave">
+            修改数据
+          </el-button>
+          <el-button type="primary" size="small" v-if="form.id && detailData.status != 1 && form.confirmStatus == 0"
+            @click="submit">
+            提交
+          </el-button>
+          <el-button type="primary" size="small" v-if="form.confirmStatus == 1" @click="revoke">
+            撤销
+          </el-button>
         </div>
       </div>
       <!-- <containerTitle title="基础资料" style="margin-top: 60px"></containerTitle> -->
       <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
         <avue-form ref="form" class="trading-form" v-model="form" :option="option">
-          <!-- <template slot="corpId">
-            <ypj-corp v-model="form.corpId" :disabled="detailData.status == 1" @getCorpData="getCorpData"
-              :dataInfo="true"></ypj-corp>
-          </template> -->
           <template slot="corpId">
-            <crop-select v-model="form.corpId" corpType="KH" @getCorpData="getCorpData"></crop-select>
+            <crop-select v-model="form.corpId" corpType="KH" :disabled="detailData.status == 1"
+              @getCorpData="getCorpData"></crop-select>
           </template>
         </avue-form>
       </trade-card>
       <trade-card title="商品信息" v-loading="loadingBtn">
         <avue-form ref="form" class="trading-form" v-model="form" :option="option2">
           <template slot="thisUsedProfit">
-            <el-input-number v-model="form.thisUsedProfit" @change="amountChange" placeholder="请输入" size="small"
-              :controls="false" style="width:100%;"></el-input-number>
+            <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1" @change="amountChange"
+              placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number>
           </template>
         </avue-form>
         <avue-crud ref="crud" :option="optionList" :data="data" :table-loading="loading" @saveColumn="saveColumn"
@@ -39,12 +50,15 @@
               :disabled="detailData.status == 1" circle></el-button>
           </template>
           <template slot="cname" slot-scope="{ row, index }">
-            <span style="display:flex">
-              <el-select v-model="row.cname" placeholder="请选择" size="small" filterable
-                @change="cnameChange(row, index)">
-                <el-option v-for="item in goodsoptions" :key="item.itemId" :label="item.cname" :value="item.cname">
-                </el-option>
-              </el-select>
+            <el-select v-if="row.$cellEdit" v-model="row.cname" placeholder="请选择" size="small" filterable
+              @change="cnameChange(row, index)">
+              <el-option v-for="item in goodsoptions" :key="item.itemId" :label="item.cname" :value="item.cname">
+              </el-option>
+            </el-select>
+            <span v-else>{{ row.cname }}</span>
+          </template>
+          <template slot="unitHeader" slot-scope="{column}">
+            <span style="color: #409EFF;cursor: pointer" @click.stop="$refs.dictbiz.open()">单位
             </span>
           </template>
           <template slot="storageInQuantity" slot-scope="{ row, index }">
@@ -63,15 +77,17 @@
             <span v-else>{{ row.purchaseAmount }}</span>
           </template>
           <template slot="menu" slot-scope="{ row, index }">
-            <el-button size="small" type="text" @click="rowCell(row, index)">{{
+            <el-button size="small" type="text" :disabled="detailData.status == 1" @click="rowCell(row, index)">{{
                 row.$cellEdit ? "保存" : "修改"
             }}</el-button>
-            <el-button size="small" type="text" @click="rowDel(row, index)">删除
+            <el-button size="small" type="text" :disabled="detailData.status == 1" @click="rowDel(row, index)">删除
             </el-button>
           </template>
         </avue-crud>
       </trade-card>
-      <fee-info :data="settlementList" :form="form" :detailData="detailData" v-loading="loadingBtn"></fee-info>
+      <fee-info ref="feeInfo" :data="settlementList" :form="form" :detailData="detailData" @getPay="getPay"
+        v-loading="loadingBtn">
+      </fee-info>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload v-loading="loadingBtn" typeUpload="CD"
         deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="orderFilesList" display
@@ -93,13 +109,15 @@
           <el-button @click="addressVisible = false" type="primary">确 定</el-button>
         </div>
       </el-dialog>
+      <dictbiz-dialog ref="dictbiz" title="添加单位" code="unit" parentId="1585962784498225154" @closed="getAllWorkDicts">
+      </dictbiz-dialog>
     </div>
   </div>
 </template>
 
 <script>
 import { optionList } from "./js/optionList";
-import { getDetails, submit, getCorpDetails, remove, getAllgoods } from "@/api/basicData/salesOrder";
+import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment } from "@/api/basicData/salesOrder";
 import feeInfo from "./components/feeInfo.vue";
 import { multiply, sum, subtract } from "@/util/calculate";
 export default {
@@ -120,6 +138,7 @@ export default {
       option: {
         menuBtn: false,
         labelWidth: 90,
+        disabled: false,
         column: [
           {
             label: "客户名称",
@@ -182,7 +201,8 @@ export default {
       },
       option2: {
         menuBtn: false,
-        labelWidth: 70,
+        labelWidth: 80,
+        disabled: false,
         column: [
           {
             label: "税率",
@@ -196,6 +216,24 @@ export default {
             span: 4,
           },
           {
+            label: "销售总数量",
+            prop: "storageQuantity",
+            disabled: true,
+            span: 4,
+          },
+          {
+            label: "成本",
+            prop: "costAmount",
+            disabled: true,
+            span: 4,
+          },
+          {
+            label: "毛利",
+            prop: "grossProfit",
+            disabled: true,
+            span: 4,
+          },
+          {
             label: "订单金额",
             prop: "purchaseAmount",
             disabled: true,
@@ -210,8 +248,19 @@ export default {
             label: "合同金额",
             prop: "orderAmount",
             disabled: true,
-            offset: 8,
-            span: 4,
+            span: 8,
+          },
+          {
+            label: "应收金额",
+            prop: "balanceAmount",
+            disabled: true,
+            span: 8,
+          },
+          {
+            label: "已收金额",
+            prop: "settlmentAmount",
+            disabled: true,
+            span: 8,
           }
         ]
       },
@@ -339,6 +388,7 @@ export default {
     }
     if (this.detailData.status == 1) {
       this.option.disabled = true;
+      this.option2.disabled = true;
     }
     this.getAllWorkDicts()
     getAllgoods().then(res => {
@@ -360,6 +410,7 @@ export default {
       if (row.cname) {
         this.goodsoptions.forEach(e => {
           if (e.cname == row.cname) {
+            row.itemId = e.id
             row.unit = e.unit
             row.price = e.standardPrice
             row.storageInQuantity = 1
@@ -373,6 +424,7 @@ export default {
         row.price = null
         row.purchaseAmount = null
       }
+      this.countChange(row)
     },
     amountChange() {
       let val = 0
@@ -385,6 +437,12 @@ export default {
     countChange(row) {
       row.amount = multiply(row.price, row.storageInQuantity)
       row.storageAmount = multiply(row.purchaseAmount, row.storageInQuantity)
+      let val = 0
+      this.data.forEach(e => {
+        val = sum(val, e.amount)
+        this.form.purchaseAmount = val
+        this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
+      })
     },
     getDetail(id) {
       this.loadingBtn = true
@@ -419,7 +477,11 @@ export default {
       this.data.push({ $cellEdit: true })
     },
     rowCell(row, index) {
-      this.$refs.crud.rowCell(row, index)
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
     },
     rowDel(row, index) {
       this.$confirm("确定删除数据?", {
@@ -444,13 +506,16 @@ export default {
         }
       });
     },
+    getPay(row) {
+      this.getDetail(row.id);
+    },
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
           this.loadingBtn = true;
-          submit({ ...this.form, billType: 'XS', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
+          save({ ...this.form, billType: 'XS', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
             .then(res => {
               this.$message.success("保存成功");
               this.form = res.data.data;
@@ -465,6 +530,68 @@ export default {
         }
       });
     },
+    fixSave() {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          this.loadingBtn = true;
+          fixSave({ ...this.form, billType: 'XS', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
+            .then(res => {
+              this.$message.success("修改成功");
+              this.form = res.data.data;
+              this.data = res.data.data.orderItemsList;
+              this.settlementList = res.data.data.settlementList
+            })
+            .finally(() => {
+              this.loadingBtn = false;
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    submit() {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          this.loadingBtn = true;
+          submit({ ...this.form, billType: 'XS', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
+            .then(res => {
+              this.$message.success("提交成功");
+              this.form = res.data.data;
+              this.data = res.data.data.orderItemsList;
+              this.settlementList = res.data.data.settlementList
+              this.$emit("goBack");
+            })
+            .finally(() => {
+              this.loadingBtn = false;
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    revoke() {
+      this.$confirm('此操作将会撤销单子, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loadingBtn = true;
+        revoke({ ...this.form, billType: 'XS', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
+          .then(res => {
+            this.$message.success("撤销成功");
+            this.form = res.data.data;
+            this.data = res.data.data.orderItemsList;
+            this.settlementList = res.data.data.settlementList
+            this.openEdit()
+          })
+          .finally(() => {
+            this.loadingBtn = false;
+          });
+      }).catch(() => {
+      });
+    },
     async saveColumn() {
       const inSave = await this.saveColumnData(
         this.getColumnName(212),
@@ -494,20 +621,27 @@ export default {
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }
     },
+    openEdit() {
+      this.detailData.status = 2
+      this.option = this.$options.data().option;
+      this.option2 = this.$options.data().option2;
+      this.$refs.crud.refreshTable();
+      this.$refs.feeInfo.refreshTable();
+    },
     //返回列表
     backToList() {
       this.$emit("goBack");
     }
   },
   watch: {
-    data: function (rows) {
-      let val = 0
-      rows.forEach(e => {
-        val = sum(val, e.amount)
-        this.form.purchaseAmount = val
-        this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
-      })
-    }
+    // data: function (rows) {
+    //   let val = 0
+    //   rows.forEach(e => {
+    //     val = sum(val, e.amount)
+    //     this.form.purchaseAmount = val
+    //     this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit)
+    //   })
+    // }
   }
 };
 </script>

+ 1 - 1
src/views/salesOrder/index.vue

@@ -13,7 +13,7 @@
           <crop-select v-model="search.corpId" corpType="KH"></crop-select>
         </template>
         <template slot-scope="{ row, index }" slot="corpId">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.corpsName }}
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.corpsName }}
           </span>
         </template>
         <template slot="businesDateSearch">

+ 17 - 26
src/views/salesOrder/js/optionList.js

@@ -19,7 +19,7 @@ export const option = {
   column: [
     {
       label: "单号",
-      prop: "orderNo",
+      prop: "sysNo",
       overHidden: true,
       search: true,
       index: 1
@@ -170,7 +170,7 @@ export const optionList = {
       overHidden: true
     },
     {
-      label: "数量",
+      label: "数量",
       prop: "storageInQuantity",
       overHidden: true
     },
@@ -211,22 +211,8 @@ export const optionList = {
       overHidden: true
     },
     {
-      label: "供应商",
-      prop: "corpId",
-      cell: true,
-      overHidden: true
-    },
-    {
       label: "进价",
-      prop: "purchaseAmount",
-      overHidden: true
-    },
-    {
-      label: "采购数量",
-      prop: "purchaseQuantity",
-      type: 'number',
-      controls: false,
-      cell: true,
+      prop: "purchasePrice",
       overHidden: true
     }
   ]
@@ -246,33 +232,38 @@ export const feeOption = {
   column: [
     {
       label: "收款单号",
-      prop: "e",
+      prop: "sysNo",
       overHidden: true
     },
     {
       label: "收款日期",
-      prop: "a",
-      type: "date",
-      format: "yyyy-MM-dd",
-      valueFormat: "yyyy-MM-dd",
-      cell: true,
+      prop: "settlementDate",
+      type: "datetime",
+      format: "yyyy-MM-dd HH:mm:ss",
+      valueFormat: "yyyy-MM-dd HH:mm:ss",
       overHidden: true
     },
     {
       label: "收款金额",
-      prop: "b",
+      prop: "amount",
       cell: true,
       overHidden: true
     },
     {
       label: "收款账户",
-      prop: "c",
+      prop: "account",
+      type: "select",
+      props: {
+        label: "dictValue",
+        value: "dictValue"
+      },
+      dicData:[],
       cell: true,
       overHidden: true
     },
     {
       label: "备注",
-      prop: "d",
+      prop: "remark",
       cell: true,
       overHidden: true
     }

+ 40 - 25
src/views/supplier/detailsInfo.vue

@@ -76,14 +76,14 @@
         <containerTitle title="明细信息"></containerTitle>
         <basic-container v-loading="loading">
             <el-tabs v-model="activeName">
-                <el-tab-pane label="销售记录" name="first">
+                <el-tab-pane label="采购记录" name="first">
                     <avue-crud ref="crud" :option="sellOption" :data="sellList" :page.sync="page" :search.sync="search"
                         @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
                         @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading"
                         @saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle"
                         @search-criteria-switch="searchCriteriaSwitch">
                         <template slot="menuLeft">
-                            <!-- <el-button type="primary" size="mini">新建销售
+                            <!-- <el-button type="primary" size="mini">新建采购
                             </el-button> -->
                             <el-button size="mini">付款
                             </el-button>
@@ -116,6 +116,12 @@
                             <el-button size="mini">付款
                             </el-button>
                         </template>
+                        <template slot="settlementDateSearch">
+                            <el-date-picker v-model="search2.settlementDate" 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']" :picker-options="pickerOptions">
+                            </el-date-picker>
+                        </template>
                     </avue-crud>
                 </el-tab-pane>
                 <el-tab-pane label="供应商信息" name="third">
@@ -157,7 +163,7 @@
 <script>
 import { optionList, sellOption, capitalOption } from "./js/optionList";
 import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods } from "@/api/basicData/salesOrder";
-import { getDetails } from "@/api/basicData/client";
+import { getDetails,getSellList } from "@/api/basicData/client";
 import { validatenull } from "@/util/validate";
 export default {
     name: "index",
@@ -179,10 +185,10 @@ export default {
                 pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
             },
             page2: {
-                pageSize: 10,
+                pageSize: 20,
                 currentPage: 1,
                 total: 0,
-                pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+                pageSizes: [20]
             },
             activeName: "first",
             search: {},
@@ -279,7 +285,7 @@ export default {
             sellOption
         );
         this.capitalOption = await this.getColumnData(
-            this.getColumnName(223),
+            this.getColumnName(232),
             capitalOption
         );
         // this.sellOption.height = window.innerHeight - 330;
@@ -299,6 +305,9 @@ export default {
             getAllgoods().then(res => {
                 this.findObject(this.sellOption.column, "cname").dicData = res.data.data
             });
+            this.getWorkDicts("account").then(res => {
+                this.findObject(this.capitalOption.column, "account").dicData = res.data.data;
+            });
         },
         cellStyle() {
             return "padding:0;height:40px;";
@@ -329,7 +338,7 @@ export default {
         },
         onLoad(page, params = {}) {
             let data = this.deepClone(Object.assign(params, this.search));
-            data.billType = 'XS';
+            data.billType = 'CG';
             data.tradeType = 'YPJ';
             if (data.businesDate) {
                 data.orderStartDate = data.businesDate[0];
@@ -351,6 +360,28 @@ export default {
                     this.loading = false;
                 });
         },
+        onLoad2(page, params = {}) {
+            let data = this.deepClone(Object.assign(params, this.search2));
+            if (data.settlementDate) {
+                data.settlementStartDate = data.settlementDate[0];
+                data.settlementEndDate = data.settlementDate[1];
+            }
+            delete data.settlementDate
+            data.corpId = this.detailData.id;
+            this.loading = true;
+            getSellList(
+                page.currentPage,
+                page.pageSize,
+                data
+            )
+                .then(res => {
+                    this.capitalList = res.data.data.records ? res.data.data.records : [];
+                    this.page2.total = res.data.data.total;
+                })
+                .finally(() => {
+                    this.loading = false;
+                });
+        },
         searchCriteriaSwitch2(type) {
             if (type) {
                 this.capitalOption.height = this.capitalOption.height - 46;
@@ -375,22 +406,6 @@ export default {
             this.page2.currentPage = 1;
             this.page2.pageSize = val;
         },
-        onLoad2(page, params = {}) {
-            let data = this.deepClone(Object.assign(params, this.search2));
-            // this.loading = true;
-            //   getList(
-            //     page.currentPage,
-            //     page.pageSize,
-            //     data
-            //   )
-            //     .then(res => {
-            //       this.sellList = res.data.data.records ? res.data.data.records : [];
-            //       this.page.total = res.data.data.total;
-            //     })
-            //     .finally(() => {
-            //       this.loading = false;
-            //     });
-        },
         getDetail(id) {
             this.loading = true
             getDetails({ id: id })
@@ -433,7 +448,7 @@ export default {
         },
         async saveColumn2() {
             const inSave = await this.saveColumnData(
-                this.getColumnName(223),
+                this.getColumnName(232),
                 this.capitalOption
             );
             if (inSave) {
@@ -448,7 +463,7 @@ export default {
         async resetColumn2() {
             this.capitalOption = capitalOption;
             const inSave = await this.delColumnData(
-                this.getColumnName(223),
+                this.getColumnName(232),
                 capitalOption
             );
             if (inSave) {

+ 10 - 6
src/views/supplier/detailsPage.vue

@@ -17,8 +17,8 @@
         <avue-form ref="form" class="trading-form" v-model="form" :option="option">
           <template slot="corpsTypeId">
             <div style="display:flex;">
-              <avue-input-tree default-expand-all v-model="form.corpsTypeId"
-                placeholder="请选择供应商分类" :dic="corpTypeList" :props="props">
+              <avue-input-tree default-expand-all v-model="form.corpsTypeId" placeholder="请选择供应商分类" :dic="corpTypeList"
+                :props="props">
               </avue-input-tree>
               <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
                 @click="corpTypeVisible = true"></i>
@@ -65,7 +65,7 @@
       </trade-card>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload v-loading="loadingBtn" typeUpload="CD"
-        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="orderFilesList" display
+        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="corpsFiles" display
         :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
       <el-dialog title="添加供应商分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog avue-dialog--top"
         width="30%" append-to-body @closed="corpTypeClosed">
@@ -191,6 +191,7 @@ export default {
           }
         ]
       },
+      corpsFiles: []
     };
   },
   props: {
@@ -215,9 +216,10 @@ export default {
       customerList({ corpType: "GYS" }).then(res => {
         this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
       });
-      this.getWorkDicts("abbreviation").then(res => {
-        this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
-      });
+      // this.getWorkDicts("abbreviation").then(res => {
+      //   this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
+      // });
+      this.$refs.crud.init();
     },
     cellStyle() {
       return "padding:0;height:40px;";
@@ -236,6 +238,7 @@ export default {
           this.form = res.data.data;
           this.data1 = res.data.data.corpsAddrList.filter(e => e.type == 0);
           this.data2 = res.data.data.corpsAddrList.filter(e => e.type == 1);
+          this.corpsFiles = res.data.data.corpsFiles
         })
         .finally(() => {
           this.loadingBtn = false;
@@ -346,6 +349,7 @@ export default {
               this.form = res.data.data;
               this.data1 = res.data.data.corpsAddrList.filter(e => e.type == 0);
               this.data2 = res.data.data.corpsAddrList.filter(e => e.type == 1);
+              this.corpsFiles = res.data.data.corpsFiles
             })
             .finally(() => {
               this.loadingBtn = false;

+ 1 - 1
src/views/supplier/index.vue

@@ -94,7 +94,7 @@
               <el-tooltip class="item" effect="dark" content="编辑" placement="top">
                 <i class="tradingIcon icon-edit" @click.stop="editOpen(row, 2)" />
               </el-tooltip>
-              <el-tooltip class="item" effect="dark" content="款" placement="top">
+              <el-tooltip class="item" effect="dark" content="款" placement="top">
                 <i class="tradingIcon icon-proceeds" />
               </el-tooltip>
               <el-tooltip class="item" effect="dark" content="发货" placement="top">

+ 42 - 39
src/views/supplier/js/optionList.js

@@ -151,9 +151,10 @@ export const option2 = {
         label: "dictValue",
         value: "dictValue"
       },
-      dicData:[],
+      // dicUrl: "/api/blade-system/dict-biz/dictionary?code=abbreviation",
+      dicData: [],
       cell: true,
-      minWidth:200,
+      minWidth: 200,
       span: 24,
     },
     {
@@ -166,30 +167,30 @@ export const option2 = {
         label: 'name',
         value: 'name'
       },
-      filterable:true,
+      filterable: true,
       cell: true,
-      minWidth:250,
+      minWidth: 250,
       span: 24,
     },
     {
       label: "详细地址",
       prop: "detailedAddress",
       cell: true,
-      minWidth:350,
+      minWidth: 350,
       span: 24,
     },
     {
       label: "邮编",
       prop: "postalCode",
       cell: true,
-      minWidth:150,
+      minWidth: 150,
       span: 24,
     },
     {
       label: "备注",
       prop: "remarks",
       cell: true,
-      minWidth:300,
+      minWidth: 300,
       span: 24,
     }
   ]
@@ -209,19 +210,19 @@ export const option3 = {
     {
       label: "目的地",
       prop: "destination",
-      minWidth:150,
+      minWidth: 150,
       cell: true,
     },
     {
       label: "物流公司",
       prop: "logisticsCompany",
-      minWidth:200,
+      minWidth: 200,
       cell: true,
     },
     {
       label: "电话",
       prop: "tel",
-      minWidth:150,
+      minWidth: 150,
       cell: true,
     },
     {
@@ -234,26 +235,26 @@ export const option3 = {
         label: 'name',
         value: 'name'
       },
-      minWidth:250,
-      filterable:true,
+      minWidth: 250,
+      filterable: true,
       cell: true
     },
     {
       label: "详细地址",
       prop: "detailedAddress",
-      minWidth:350,
+      minWidth: 350,
       cell: true,
     },
     {
       label: "邮编",
       prop: "postalCode",
-      minWidth:150,
+      minWidth: 150,
       cell: true,
     },
     {
       label: "备注",
       prop: "remarks",
-      minWidth:300,
+      minWidth: 300,
       cell: true,
     }
   ]
@@ -416,7 +417,7 @@ export const sellOption = {
       type: "select",
       dicData: [],
       search: true,
-      filterable:true,
+      filterable: true,
       props: {
         label: "cname",
         value: "cname"
@@ -428,7 +429,7 @@ export const sellOption = {
       prop: "corpType",
       type: "tree",
       dicData: [],
-      filterable:true,
+      filterable: true,
       props: {
         label: "title",
         value: "id"
@@ -442,7 +443,7 @@ export const sellOption = {
       label: "制单人",
       prop: "createUser",
       type: "select",
-      filterable:true,
+      filterable: true,
       props: {
         label: "name",
         value: "id"
@@ -473,51 +474,53 @@ export const capitalOption = {
   column: [
     {
       label: "单号",
-      prop: "a",
+      prop: "sysNo",
       search: true,
       overHidden: true
     },
     {
       label: "付款日期",
-      prop: "b",
+      prop: "settlementDate",
       search: true,
       overHidden: true
     },
     {
       label: "类型",
-      prop: "c",
+      prop: "billType",
+      type: "select",
+      dicData: [
+        {
+          label: "付款",
+          value: "D"
+        },
+        {
+          label: "付款",
+          value: "C"
+        }
+      ],
       search: true,
       overHidden: true
     },
     {
       label: "付款金额",
-      prop: "d",
-      search: true,
+      prop: "amount",
       overHidden: true
     },
     {
       label: "付款账户",
-      prop: "e",
-      search: true,
-      overHidden: true
-    },
-    {
-      label: "制单人",
-      prop: "f",
+      prop: "account",
+      type: "select",
+      props: {
+        label: "dictValue",
+        value: "dictValue"
+      },
+      dicData: [],
       search: true,
       overHidden: true
     },
     {
       label: "备注",
-      prop: "g",
-      overHidden: true
-    },
-    {
-      label: "是否打印",
-      prop: "h",
-      hide: true,
-      search: true,
-      showColumn: false,
+      prop: "remark",
       overHidden: true
     }
   ]