Browse Source

优化修改国内贸易、更改组件跳转

lichao 4 years ago
parent
commit
ffdb305e6e

+ 23 - 21
src/views/businessManagement/deliveryNotice/configuration/advantageProject.json

@@ -19,9 +19,24 @@
   "dialogClickModal": false,
   "column":[
     {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 1,
+      "width":100,
+      "cell": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入排序",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
       "label": "费用名称",
       "prop": "feeName",
-      "index": 1,
+      "index": 2,
       "width":100,
       "cell": false,
       "rules": [
@@ -34,7 +49,7 @@
     },{
       "label": "编号",
       "prop": "code",
-      "index": 2,
+      "index": 3,
       "width":100,
       "cell": false,
       "rules": [
@@ -47,9 +62,10 @@
     },{
       "label": "国内支付方",
       "prop": "corpId",
-      "index": 3,
-      "width":100,
-      "cell": true,
+      "index": 4,
+      "width":260,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,
@@ -60,7 +76,7 @@
     },{
       "label": "支付金额",
       "prop": "amount",
-      "index": 4,
+      "index": 5,
       "width":100,
       "cell": true,
       "rules": [
@@ -73,7 +89,7 @@
     },{
       "label": "核销金额",
       "prop": "settlmentAmount",
-      "index": 5,
+      "index": 6,
       "width":100,
       "cell": true,
       "rules": [
@@ -84,20 +100,6 @@
         }
       ]
     },{
-      "label": "排序",
-      "prop": "sort",
-      "type": "number",
-      "index": 6,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入排序",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "备注",
       "prop": "remarks",
       "index": 7,

+ 54 - 29
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -91,6 +91,13 @@
               <span style="float: left;padding-top: 2px">{{ row.code }}</span>
               <el-button type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
             </template>
+            <template slot="corpId" slot-scope="{ row }">
+              <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
+                               :configuration="configuration" @receiveList="receiveList"/>
+              <span v-else>
+                <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>
+              </span>
+            </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
                   type="text"
@@ -118,6 +125,7 @@
               @row-save="rowSaveBankOfDeposit"
               @row-update="rowUpdateBankOfDeposit"
               @row-del="rowDelBankOfDeposit"
+              :upload-after="uploadAfter"
           ></avue-crud>
         </basic-container>
       </el-form>
@@ -224,6 +232,11 @@ import {getDeptLazyTree,getDeptLazyTreeTwo, customerList} from "@/api/basicData/
 
 export default {
   name: "detailsPage",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   data() {
     return {
       configuration: {
@@ -464,11 +477,12 @@ export default {
     this.getWorkDicts("order_status").then(res => {
       this.statusOption = res.data.data
     })
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "")
+    if (this.detailData.id) {
+      let id = this.detailData.id
       this.queryData(id)
-    }else if (this.$route.query.form){
-      this.form = JSON.parse(this.$route.query.form);
+    }else if (this.detailData.form){
+      console.log(this.detailData.form)
+      this.form = JSON.parse(this.detailData.form);
       delete this.form.createTime
       delete this.form.id
       delete this.form.sysNo
@@ -487,24 +501,12 @@ export default {
         delete item.id
         delete item.pid
       })
-    } else if (this.$route.query.copyId) {
-      let id = this.$route.query.copyId.replace(/\"/g, "")
+    } else if (this.detailData.copyId) {
+      let id = this.detailData.copyId
       this.queryData(id, true)
     }
   },
   watch: {
-    '$route'(to, from) {
-      console.log(to, from);
-      if (this.$route.query.id) {
-        let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
-        detail(id).then(res => {
-          console.log(res.data.data)
-          this.form = res.data.data;
-        });
-      } else {
-        this.form = {}
-      }
-    }
   },
   methods: {
     queryData(id, isCopy = false) {
@@ -518,7 +520,17 @@ export default {
         if (this.form.companyName) {
           this.configuration.dicData = this.configuration.dicData.concat(this.form.companyName)
         }
-        console.log(this.form.corpName)
+        let feesData = []
+        this.form.deliveryFeesList.forEach(item => {
+          let a = {
+            cname: item.corpName,
+            id: item.corpId
+          }
+          feesData.push(a)
+        })
+        this.configuration.dicData = this.configuration.dicData.concat(feesData)
+        // 去重
+        this.removeRepeat()
         delete this.form.deliveryItemsList
         delete this.form.deliveryFeesList
         delete this.form.deliveryFilesList
@@ -813,6 +825,27 @@ export default {
         }
       })
     },
+    uploadAfter(res, done) {
+      if (res.originalName) {
+        this.bankOfDepositForm.fileName = this.bankOfDepositForm.fileName
+          ? this.bankOfDepositForm.fileName
+          : res.originalName;
+      }
+      done();
+    },
+    // 去重
+    removeRepeat() {
+      let obj = []
+      this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
+        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        return current
+      }, [])
+    },
+    //
+    receiveList(data){
+      this.configuration.dicData = this.configuration.dicData.concat(data)
+      this.removeRepeat()
+    },
     //修改提交触发
     editCustomer(isBack = false) {
       console.log(this.form)
@@ -832,11 +865,7 @@ export default {
             this.disabled = false
             if (isBack) {
               //成功关闭此页面回到列表页
-              this.$router.$avueRouter.closeTag();
-              this.$router.push({
-                path: '/businessManagement/deliveryNotice/index',
-                query: {}
-              });
+              this.$emit("goBack");
             } else {
               this.queryData(res.data.data.id)
             }
@@ -859,11 +888,7 @@ export default {
       }).then(() => {
         this.editCustomer(true)
       }).catch(() => {
-        this.$router.$avueRouter.closeTag();
-        this.$router.push({
-          path: '/businessManagement/deliveryNotice/index',
-          query: {}
-        });
+        this.$emit("goBack");
       })
     }
   }

+ 79 - 52
src/views/businessManagement/deliveryNotice/index.vue

@@ -1,60 +1,73 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option"
-               :data="dataList"
-               ref="crud"
-               v-model="form"
-               :page.sync="page"
-               @row-del="rowDel"
-               @row-update="rowUpdate"
-               :before-open="beforeOpen"
-               :before-close="beforeClose"
-               @row-save="rowSave"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad"
-               @tree-load="treeLoad">
-      <template slot="menuLeft" slot-scope="{size}">
-        <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
-        <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
+  <div>
+    <basic-container v-if="isShow">
+      <avue-crud :option="option"
+                 :data="dataList"
+                 ref="crud"
+                 v-model="form"
+                 :page.sync="page"
+                 @row-del="rowDel"
+                 @row-update="rowUpdate"
+                 :before-open="beforeOpen"
+                 :before-close="beforeClose"
+                 @row-save="rowSave"
+                 @search-change="searchChange"
+                 @search-reset="searchReset"
+                 @selection-change="selectionChange"
+                 @current-change="currentChange"
+                 @size-change="sizeChange"
+                 @refresh-change="refreshChange"
+                 @on-load="onLoad"
+                 @tree-load="treeLoad">
+        <template slot="menuLeft" slot-scope="{size}">
+          <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
+          <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
             type="text"
             icon="el-icon-view"
             size="small"
             @click.stop="beforeOpenPage(scope.row,scope.index)"
-        >查看
-        </el-button>
-        <el-button
+          >查看
+          </el-button>
+          <el-button
             type="text"
             icon="el-icon-edit"
             size="small"
             @click.stop="editOpen(scope.row,scope.index)"
-        >编辑
-        </el-button>
-        <el-button
+          >编辑
+          </el-button>
+          <el-button
             type="text"
             icon="el-icon-delete"
             size="small"
             @click.stop="rowDel(scope.row,scope.index)"
-        >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+          >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+
+    <detail-page
+      ref="detail"
+      @goBack="goBack"
+      :detailData="detailData"
+      v-else
+    ></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./configuration/mainList.json";
 import {customerList, typeSave, deleteDetails} from "@/api/basicData/deliveryNotice"
+import detailPage from "./detailsPageEdit";
 
 export default {
   name: "customerInformation",
+  components: {
+    detailPage
+  },
   data() {
     return {
       form: {},
@@ -71,9 +84,18 @@ export default {
       // 非多个禁用
       multiple: true,
       selection: [],
+      isShow: true,
+      detailData: {},
     }
   },
   created() {
+    if (this.$route.query.form) {
+      console.log(this.$route.query.form)
+      this.detailData = {
+        form: this.$route.query.form,
+      };
+      this.isShow = false;
+    }
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
@@ -132,31 +154,32 @@ export default {
     },
     //查看跳转页面
     beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/deliveryNotice_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      // /deliveryNotice_detailsPageEdit
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     //新增跳转页面
     beforeOpen(row, index) {
-      this.$router.push({
-        path: "/deliveryNotice_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     editOpen(row, index) {
-      this.$router.push({
-        path: "/deliveryNotice_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     // 复制新单
     copyOrder() {
       const id = this.selection[0].id;
-      this.$router.push({
-        path: "/deliveryNotice_detailsPageEdit",
-        query: {copyId: JSON.stringify(id)},
-      });
+      this.detailData = {
+        copyId: id,
+      };
+      this.isShow = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -207,6 +230,10 @@ export default {
         resolve(res.data.data.records);
       });
     },
+    goBack() {
+      this.detailData=this.$options.data().detailData
+      this.isShow = true;
+    },
   }
 }
 </script>

+ 25 - 22
src/views/businessManagement/purchaseOrder/configuration/advantageProject.json

@@ -19,9 +19,24 @@
   "dialogClickModal": false,
   "column":[
     {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 1,
+      "width":100,
+      "cell": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入排序",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
       "label": "费用名称",
       "prop": "feeName",
-      "index": 1,
+      "index": 2,
       "width":100,
       "cell": false,
       "rules": [
@@ -34,7 +49,7 @@
     },{
       "label": "编号",
       "prop": "code",
-      "index": 2,
+      "index": 3,
       "width":100,
       "cell": false,
       "rules": [
@@ -47,9 +62,10 @@
     },{
       "label": "国内支付方",
       "prop": "corpId",
-      "index": 3,
-      "width":100,
-      "cell": true,
+      "index": 4,
+      "width":260,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,
@@ -60,9 +76,10 @@
     },{
       "label": "支付金额",
       "prop": "amount",
-      "index": 4,
+      "index": 5,
       "width":100,
-      "cell": true,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,
@@ -73,7 +90,7 @@
     },{
       "label": "核销金额",
       "prop": "settlmentAmount",
-      "index": 5,
+      "index": 6,
       "width":100,
       "cell": true,
       "rules": [
@@ -84,20 +101,6 @@
         }
       ]
     },{
-      "label": "排序",
-      "prop": "sort",
-      "type": "number",
-      "index": 6,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入排序",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "备注",
       "prop": "remarks",
       "index": 7,

+ 51 - 29
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -109,6 +109,13 @@
               <span style="float: left;padding-top: 2px">{{ row.code }}</span>
               <el-button type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
             </template>
+            <template slot="corpId" slot-scope="{ row }">
+              <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
+                               :configuration="configuration" @receiveList="receiveList"/>
+              <span v-else>
+                <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>
+              </span>
+            </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
                   type="text"
@@ -136,6 +143,7 @@
               @row-save="rowSaveBankOfDeposit"
               @row-update="rowUpdateBankOfDeposit"
               @row-del="rowDelBankOfDeposit"
+              :upload-after="uploadAfter"
           ></avue-crud>
         </basic-container>
       </el-form>
@@ -376,6 +384,11 @@ import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
 
 export default {
   name: "detailsPage",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   data() {
     return {
       configuration: {
@@ -585,32 +598,18 @@ export default {
     this.getWorkDicts("payment_term").then(res => {
       this.paymentOption = res.data.data
     })
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "")
-      this.queryData(id)
-    } else if(this.$route.query.copyId) {
-      let id = this.$route.query.copyId.replace(/\"/g, "")
-      this.queryData(id, true)
+    if (this.detailData.id) {
+      this.queryData(this.detailData.id)
+    } else if(this.detailData.copyId) {
+      this.queryData(this.detailData.copyId, true)
     } else {
-      let prefix = 'GN'
+      let prefix = 'GN-CG'
       getSysNo(prefix).then(res => {
         this.$set(this.form, 'sysNo', res.data.data)
       })
     }
   },
   watch: {
-    '$route'(to, from) {
-      console.log(to, from);
-      if (this.$route.query.id) {
-        let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
-        detail(id).then(res => {
-          console.log(res.data.data)
-          this.form = res.data.data;
-        });
-      } else {
-        this.form = {}
-      }
-    }
   },
   methods: {
     // 明细查询
@@ -634,6 +633,17 @@ export default {
           this.bankOfDepositData = this.form.orderFilesList
         }
         this.configuration.dicData = this.form.corpsName
+        let feesData = []
+        this.form.orderFeesList.forEach(item => {
+          let a = {
+            cname: item.corpName,
+            id: item.corpId
+          }
+          feesData.push(a)
+        })
+        this.configuration.dicData = this.configuration.dicData.concat(feesData)
+        // 去重
+        this.removeRepeat()
         delete this.form.itemsVOList
         delete this.form.orderFeesList
         delete this.form.orderFilesList
@@ -937,6 +947,14 @@ export default {
         }
       })
     },
+    uploadAfter(res, done) {
+      if (res.originalName) {
+        this.bankOfDepositForm.fileName = this.bankOfDepositForm.fileName
+          ? this.bankOfDepositForm.fileName
+          : res.originalName;
+      }
+      done();
+    },
     // 计算费用
     changeContractAmt(row) {
       let orderQuantity = 0;
@@ -949,6 +967,18 @@ export default {
       }
       this.$set(row, "amount", Number(orderQuantity) * Number(price)).toFixed(2);
     },
+    // 去重
+    removeRepeat() {
+      let obj = []
+      this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
+        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        return current
+      }, [])
+    },
+    receiveList(data){
+      this.configuration.dicData = this.configuration.dicData.concat(data)
+      this.removeRepeat()
+    },
     //修改提交触发
     editCustomer(isBack = false) {
       console.log(this.form)
@@ -969,11 +999,7 @@ export default {
             this.disabled = false
             if (isBack) {
               //成功关闭此页面回到列表页
-              this.$router.$avueRouter.closeTag();
-              this.$router.push({
-                path: '/businessManagement/purchaseOrder/index',
-                query: {}
-              });
+              this.$emit("goBack");
             } else {
               this.queryData(res.data.data)
             }
@@ -992,11 +1018,7 @@ export default {
       }).then(() => {
         this.editCustomer(true)
       }).catch(() => {
-        this.$router.$avueRouter.closeTag();
-        this.$router.push({
-          path: '/businessManagement/purchaseOrder/index',
-          query: {}
-        });
+        this.$emit("goBack");
       })
     }
   }

+ 74 - 50
src/views/businessManagement/purchaseOrder/index.vue

@@ -1,58 +1,76 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option"
-               :data="dataList"
-               ref="crud"
-               v-model="form"
-               :page.sync="page"
-               @row-del="rowDel"
-               :before-open="beforeOpen"
-               :before-close="beforeClose"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad"
-               @tree-load="treeLoad">
-      <template slot="menuLeft" slot-scope="{size}">
-        <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
-        <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
+  <div>
+    <basic-container v-if="isShow">
+      <avue-crud :option="option"
+                 :data="dataList"
+                 ref="crud"
+                 v-model="form"
+                 :page.sync="page"
+                 @row-del="rowDel"
+                 :before-open="beforeOpen"
+                 :before-close="beforeClose"
+                 @search-change="searchChange"
+                 @search-reset="searchReset"
+                 @selection-change="selectionChange"
+                 @current-change="currentChange"
+                 @size-change="sizeChange"
+                 @refresh-change="refreshChange"
+                 @on-load="onLoad"
+                 @tree-load="treeLoad">
+        <template slot="menuLeft" slot-scope="{size}">
+          <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
+          <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
             type="text"
             icon="el-icon-view"
             size="small"
             @click.stop="beforeOpenPage(scope.row,scope.index)"
-        >查看
-        </el-button>
-        <el-button
+          >查看
+          </el-button>
+          <el-button
             type="text"
             icon="el-icon-edit"
             size="small"
             @click.stop="editOpen(scope.row,scope.index)"
-        >编辑
-        </el-button>
-        <el-button
+          >编辑
+          </el-button>
+          <el-button
             type="text"
             icon="el-icon-delete"
             size="small"
             @click.stop="rowDel(scope.row,scope.index)"
-        >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+          >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+
+    <detail-page
+      ref="detail"
+      @goBack="goBack"
+      :detailData="detailData"
+      v-else
+    ></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./configuration/mainList.json";
 import {customerList, deleteDetails} from "@/api/basicData/purchaseOrder"
+import detailPage from "./detailsPageEdit";
 
 export default {
   name: "customerInformation",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
+  components: {
+    detailPage
+  },
   data() {
     return {
       form: {},
@@ -69,6 +87,8 @@ export default {
       // 非多个禁用
       multiple: true,
       selection: [],
+      isShow: true,
+      detailData: {},
     }
   },
   created() {
@@ -110,31 +130,31 @@ export default {
     },
     //查看跳转页面
     beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/purchaseOrder_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     //新增跳转页面
     beforeOpen(row, index) {
-      this.$router.push({
-        path: "/purchaseOrder_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     editOpen(row, index) {
-      this.$router.push({
-        path: "/purchaseOrder_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     // 复制新单
     copyOrder() {
       const id = this.selection[0].id;
-      this.$router.push({
-        path: "/purchaseOrder_detailsPageEdit",
-        query: {copyId: JSON.stringify(id)},
-      });
+      this.detailData = {
+        copyId: id,
+      };
+      this.isShow = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -193,6 +213,10 @@ export default {
         resolve(res.data.data.records);
       });
     },
+    goBack() {
+      this.detailData=this.$options.data().detailData
+      this.isShow = true;
+    },
   }
 }
 </script>

+ 23 - 21
src/views/businessManagement/receipt/configuration/advantageProject.json

@@ -19,9 +19,24 @@
   "dialogClickModal": false,
   "column":[
     {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 1,
+      "width":100,
+      "cell": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入排序",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
       "label": "费用名称",
       "prop": "feeName",
-      "index": 1,
+      "index": 2,
       "width":100,
       "cell": false,
       "rules": [
@@ -34,7 +49,7 @@
     },{
       "label": "编号",
       "prop": "code",
-      "index": 2,
+      "index": 3,
       "width":100,
       "cell": false,
       "rules": [
@@ -47,9 +62,10 @@
     },{
       "label": "国内支付方",
       "prop": "corpId",
-      "index": 3,
-      "width":100,
-      "cell": true,
+      "index": 4,
+      "width":260,
+      "cell": false,
+      "slot": true,
       "rules": [
         {
           "required": false,
@@ -60,7 +76,7 @@
     },{
       "label": "支付金额",
       "prop": "amount",
-      "index": 4,
+      "index": 5,
       "width":100,
       "cell": true,
       "rules": [
@@ -73,7 +89,7 @@
     },{
       "label": "核销金额",
       "prop": "settlmentAmount",
-      "index": 5,
+      "index": 6,
       "width":100,
       "cell": true,
       "rules": [
@@ -84,20 +100,6 @@
         }
       ]
     },{
-      "label": "排序",
-      "prop": "sort",
-      "type": "number",
-      "index": 6,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入排序",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "备注",
       "prop": "remarks",
       "index": 7,

+ 52 - 30
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -91,6 +91,13 @@
               <span style="float: left;padding-top: 2px">{{ row.code }}</span>
               <el-button type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
             </template>
+            <template slot="corpId" slot-scope="{ row }">
+              <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
+                               :configuration="configuration" @receiveList="receiveList"/>
+              <span v-else>
+                <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>
+              </span>
+            </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
                   type="text"
@@ -118,6 +125,7 @@
               @row-save="rowSaveBankOfDeposit"
               @row-update="rowUpdateBankOfDeposit"
               @row-del="rowDelBankOfDeposit"
+              :upload-after="uploadAfter"
           ></avue-crud>
         </basic-container>
       </el-form>
@@ -357,6 +365,11 @@ import {getDeptLazyTree, customerList,getDeptLazyTreeTwo} from "@/api/basicData/
 
 export default {
   name: "detailsPage",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   data() {
     return {
       configuration: {
@@ -586,31 +599,17 @@ export default {
     this.getWorkDicts("procurement_method").then(res => {
       this.procurementMethodOption = res.data.data
     })
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "")
-      this.queryData(id)
-    }else if (this.$route.query.form){
-      this.form = JSON.parse(this.$route.query.form);
+    if (this.detailData.id) {
+      this.queryData(this.detailData.id)
+    }else if (this.detailData.form){
+      this.form = JSON.parse(this.detailData.form);
       this.contactsData = this.form.orderItemsList
       delete this.form.orderItemsList
-    } else if (this.$route.query.copyId) {
-      let id = this.$route.query.copyId.replace(/\"/g, "")
-      this.queryData(id, true)
+    } else if (this.detailData.copyId) {
+      this.queryData(this.detailData.copyId, true)
     }
   },
   watch: {
-    '$route'(to, from) {
-      console.log(to, from);
-      if (this.$route.query.id) {
-        let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
-        detail(id).then(res => {
-          console.log(res.data.data)
-          this.form = res.data.data;
-        });
-      } else {
-        this.form = {}
-      }
-    }
   },
   methods: {
     queryData(id, isCopy = false) {
@@ -621,6 +620,17 @@ export default {
         this.advantageProjectData = this.form.deliveryFeesList
         this.bankOfDepositData = this.form.deliveryFilesList
         this.configuration.dicData = this.form.corpName
+        let feesData = []
+        this.form.deliveryFeesList.forEach(item => {
+          let a = {
+            cname: item.corpName,
+            id: item.corpId
+          }
+          feesData.push(a)
+        })
+        this.configuration.dicData = this.configuration.dicData.concat(feesData)
+        // 去重
+        this.removeRepeat()
         if (this.form.companyName) {
           this.configuration.dicData = this.configuration.dicData.concat(this.form.companyName)
         }
@@ -922,6 +932,26 @@ export default {
         }
       })
     },
+    uploadAfter(res, done) {
+      if (res.originalName) {
+        this.bankOfDepositForm.fileName = this.bankOfDepositForm.fileName
+          ? this.bankOfDepositForm.fileName
+          : res.originalName;
+      }
+      done();
+    },
+    // 去重
+    removeRepeat() {
+      let obj = []
+      this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
+        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        return current
+      }, [])
+    },
+    receiveList(data){
+      this.configuration.dicData = this.configuration.dicData.concat(data)
+      this.removeRepeat()
+    },
     //修改提交触发
     editCustomer(isBack = false) {
       console.log(this.form)
@@ -940,11 +970,7 @@ export default {
             this.disabled = false
             if (isBack) {
               //成功关闭此页面回到列表页
-              this.$router.$avueRouter.closeTag();
-              this.$router.push({
-                path: '/businessManagement/receipt/index',
-                query: {}
-              });
+              this.$emit("goBack");
             } else {
               this.queryData(res.data.data.id)
             }
@@ -963,11 +989,7 @@ export default {
       }).then(() => {
         this.editCustomer(true)
       }).catch(() => {
-        this.$router.$avueRouter.closeTag();
-        this.$router.push({
-          path: '/businessManagement/receipt/index',
-          query: {}
-        });
+        this.$emit("goBack");
       })
     }
   }

+ 72 - 52
src/views/businessManagement/receipt/index.vue

@@ -1,60 +1,73 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option"
-               :data="dataList"
-               ref="crud"
-               v-model="form"
-               :page.sync="page"
-               @row-del="rowDel"
-               @row-update="rowUpdate"
-               :before-open="beforeOpen"
-               :before-close="beforeClose"
-               @row-save="rowSave"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad"
-               @tree-load="treeLoad">
-      <template slot="menuLeft" slot-scope="{size}">
-        <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
-        <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
+  <div>
+    <basic-container v-if="isShow">
+      <avue-crud :option="option"
+                 :data="dataList"
+                 ref="crud"
+                 v-model="form"
+                 :page.sync="page"
+                 @row-del="rowDel"
+                 @row-update="rowUpdate"
+                 :before-open="beforeOpen"
+                 :before-close="beforeClose"
+                 @row-save="rowSave"
+                 @search-change="searchChange"
+                 @search-reset="searchReset"
+                 @selection-change="selectionChange"
+                 @current-change="currentChange"
+                 @size-change="sizeChange"
+                 @refresh-change="refreshChange"
+                 @on-load="onLoad"
+                 @tree-load="treeLoad">
+        <template slot="menuLeft" slot-scope="{size}">
+          <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
+          <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
             type="text"
             icon="el-icon-view"
             size="small"
             @click.stop="beforeOpenPage(scope.row,scope.index)"
-        >查看
-        </el-button>
-        <el-button
+          >查看
+          </el-button>
+          <el-button
             type="text"
             icon="el-icon-edit"
             size="small"
             @click.stop="editOpen(scope.row,scope.index)"
-        >编辑
-        </el-button>
-        <el-button
+          >编辑
+          </el-button>
+          <el-button
             type="text"
             icon="el-icon-delete"
             size="small"
             @click.stop="rowDel(scope.row,scope.index)"
-        >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+          >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+
+    <detail-page
+      ref="detail"
+      @goBack="goBack"
+      :detailData="detailData"
+      v-else
+    ></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./configuration/mainList.json";
 import {customerList, typeSave, deleteDetails} from "@/api/basicData/receipt"
+import detailPage from "./detailsPageEdit";
 
 export default {
   name: "customerInformation",
+  components: {
+    detailPage
+  },
   data() {
     return {
       form: {},
@@ -71,6 +84,8 @@ export default {
       // 非多个禁用
       multiple: true,
       selection: [],
+      isShow: true,
+      detailData: {},
     }
   },
   created() {
@@ -133,31 +148,32 @@ export default {
     },
     //查看跳转页面
     beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/receipt_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      // /receipt_detailsPageEdit
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     //新增跳转页面
     beforeOpen(row, index) {
-      this.$router.push({
-        path: "/receipt_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     editOpen(row, index) {
-      this.$router.push({
-        path: "/receipt_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     // 复制新单
     copyOrder() {
       const id = this.selection[0].id;
-      this.$router.push({
-        path: "/receipt_detailsPageEdit",
-        query: {copyId: JSON.stringify(id)},
-      });
+      this.detailData = {
+        copyId: id,
+      };
+      this.isShow = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -221,6 +237,10 @@ export default {
         resolve(res.data.data.records);
       });
     },
+    goBack() {
+      this.detailData=this.$options.data().detailData
+      this.isShow = true;
+    },
   }
 }
 </script>

+ 20 - 19
src/views/businessManagement/salesOrder/configuration/advantageProject.json

@@ -19,9 +19,24 @@
   "dialogClickModal": false,
   "column":[
     {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 1,
+      "width":100,
+      "cell": true,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入排序",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
       "label": "费用名称",
       "prop": "feeName",
-      "index": 1,
+      "index": 2,
       "width":100,
       "cell": false,
       "rules": [
@@ -34,7 +49,7 @@
     },{
       "label": "编号",
       "prop": "code",
-      "index": 2,
+      "index": 3,
       "width":100,
       "cell": false,
       "rules": [
@@ -47,7 +62,7 @@
     },{
       "label": "国内支付方",
       "prop": "corpId",
-      "index": 3,
+      "index": 4,
       "width":260,
       "cell": false,
       "slot": true,
@@ -61,7 +76,7 @@
     },{
       "label": "支付金额",
       "prop": "amount",
-      "index": 4,
+      "index": 5,
       "width":100,
       "cell": true,
       "rules": [
@@ -74,7 +89,7 @@
     },{
       "label": "核销金额",
       "prop": "settlmentAmount",
-      "index": 5,
+      "index": 6,
       "width":100,
       "cell": true,
       "rules": [
@@ -85,20 +100,6 @@
         }
       ]
     },{
-      "label": "排序",
-      "prop": "sort",
-      "type": "number",
-      "index": 6,
-      "width":100,
-      "cell": true,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入排序",
-          "trigger": "blur"
-        }
-      ]
-    },{
       "label": "备注",
       "prop": "remarks",
       "index": 7,

+ 69 - 34
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -140,7 +140,7 @@
               <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
                                :configuration="configuration" @receiveList="receiveList"/>
               <span v-else>
-                <span v-for="item in corpNameOption" v-if="item.id == row.corpId">{{ item.cname }}</span>
+                <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>
               </span>
             </template>
             <template slot-scope="{row,index}" slot="menu">
@@ -170,6 +170,7 @@
               @row-save="rowSaveBankOfDeposit"
               @row-update="rowUpdateBankOfDeposit"
               @row-del="rowDelBankOfDeposit"
+              :upload-after="uploadAfter"
           ></avue-crud>
         </basic-container>
       </el-form>
@@ -470,6 +471,11 @@ import _ from "lodash";
 
 export default {
   name: "detailsPage",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   data() {
     return {
       disabled: false,
@@ -979,7 +985,8 @@ export default {
       },
       paymentOption: [],
       statusOption: [],
-      corpNameOption: [],
+      // 费用信息排序的最大值
+      maxFeeNum: 0,
     }
   },
   //初始化查询
@@ -991,28 +998,28 @@ export default {
       this.statusOption = res.data.data
     })
     this.$set(this.form, 'orderStatus', '录入')
-    if (this.$route.query.id) {
-      let id = this.$route.query.id.replace(/\"/g, "")
-      this.queryData(id)
+    if (this.detailData.id) {
+      // let id = this.$route.query.id.replace(/\"/g, "")
+      this.queryData(this.detailData.id)
     }
-    if (this.$route.query.copyId) {
-      let id = this.$route.query.copyId.replace(/\"/g, "")
-      this.queryData(id, true)
+    if (this.detailData.copyId) {
+      // let id = this.$route.query.copyId.replace(/\"/g, "")
+      this.queryData(this.detailData.copyId, true)
     }
   },
   watch: {
-    '$route'(to, from) {
-      console.log(to, from);
-      if (this.$route.query.id) {
-        let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
-        detail(id).then(res => {
-          console.log(res.data.data)
-          this.form = res.data.data;
-        });
-      } else {
-        this.form = {}
-      }
-    }
+    // '$route'(to, from) {
+    //   console.log(to, from);
+    //   if (this.$route.query.id) {
+    //     let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
+    //     detail(id).then(res => {
+    //       console.log(res.data.data)
+    //       this.form = res.data.data;
+    //     });
+    //   } else {
+    //     this.form = {}
+    //   }
+    // },
   },
   methods: {
     queryData(id, isCopy = false){
@@ -1035,12 +1042,25 @@ export default {
           feesData.push(a)
         })
         this.configuration.dicData = this.configuration.dicData.concat(feesData)
-        this.corpNameOption = this.configuration.dicData
+        // 去重
+        this.removeRepeat()
         delete this.form.orderItemsList
         delete this.form.orderFeesList
         delete this.form.orderFilesList
         delete this.form.corpName
         delete this.form.belongToCorpList
+        // 获取最大值
+        let num = []
+        this.advantageProjectData.forEach(item => {
+          num.push(item.sort)
+        })
+        if (num.length == 0) {
+          this.maxFeeNum = 0;
+        } else {
+          this.maxFeeNum = num.reduce((a, b) => {
+            return b > a? b: a;
+          })
+        }
         if (isCopy) {
           delete this.form.id
           this.contactsData.forEach(item => {
@@ -1117,7 +1137,7 @@ export default {
       generateShipment(data).then(res => {
         console.log(res.data.data)
         this.$router.push({
-          path: "deliveryNotice_detailsPageEdit",
+          path: "/businessManagement/deliveryNotice/index",
           query: {form: JSON.stringify(res.data.data)},
         });
       })
@@ -1133,10 +1153,18 @@ export default {
       console.log(row)
       this.choiceIndex = row.$index
     },
+    // 去重
+    removeRepeat() {
+      let obj = []
+      this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
+        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        return current
+      }, [])
+    },
     //
     receiveList(data){
-      console.log(data)
-      this.corpNameOption = this.corpNameOption.concat(data)
+      this.configuration.dicData = this.configuration.dicData.concat(data)
+      this.removeRepeat()
     },
     //点击商品明细选择触发
     commodityChoice(row) {
@@ -1180,6 +1208,8 @@ export default {
           console.log(this.tableDataCost[item])
           this.tableDataCost[item].itemId = this.tableDataCost[item].id
           this.tableDataCost[item].feeName = this.tableDataCost[item].cname
+          this.tableDataCost[item].sort = this.maxFeeNum + 1
+          this.maxFeeNum++
           delete this.tableDataCost[item].id
           this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
           this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
@@ -1423,6 +1453,14 @@ export default {
         }
       })
     },
+    uploadAfter(res, done) {
+      if (res.originalName) {
+        this.bankOfDepositForm.fileName = this.bankOfDepositForm.fileName
+          ? this.bankOfDepositForm.fileName
+          : res.originalName;
+      }
+      done();
+    },
     //修改提交触发
     editCustomer(isBack = false) {
       console.log(this.form)
@@ -1442,11 +1480,7 @@ export default {
             this.disabled = false
             if (isBack) {
               //成功关闭此页面回到列表页
-              this.$router.$avueRouter.closeTag();
-              this.$router.push({
-                path: '/businessManagement/salesOrder/index',
-                query: {}
-              });
+              this.$emit("goBack");
             } else {
               this.queryData(res.data.data.id)
             }
@@ -1494,11 +1528,12 @@ export default {
       }).then(() => {
         this.editCustomer(true)
       }).catch(() => {
-        this.$router.$avueRouter.closeTag();
-        this.$router.push({
-          path: '/businessManagement/salesOrder/index',
-          query: {}
-        });
+        // this.$router.$avueRouter.closeTag();
+        // this.$router.push({
+        //   path: '/businessManagement/salesOrder/index',
+        //   query: {}
+        // });
+        this.$emit("goBack");
       })
     }
   }

+ 77 - 54
src/views/businessManagement/salesOrder/index.vue

@@ -1,62 +1,76 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option"
-               :data="dataList"
-               ref="crud"
-               v-model="form"
-               :page.sync="page"
-               @row-del="rowDel"
-               @row-update="rowUpdate"
-               :before-open="beforeOpen"
-               :before-close="beforeClose"
-               :search.sync="search"
-               @row-save="rowSave"
-               @saveColumn="saveColumn"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad"
-               @tree-load="treeLoad">
-      <template slot="menuLeft" slot-scope="{size}">
-        <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
-        <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
-      </template>
-      <template slot-scope="scope" slot="menu">
-        <el-button
+  <div>
+    <basic-container
+      v-if="isShow">
+      <avue-crud :option="option"
+                 :data="dataList"
+                 ref="crud"
+                 v-model="form"
+                 :page.sync="page"
+                 @row-del="rowDel"
+                 @row-update="rowUpdate"
+                 :before-open="beforeOpen"
+                 :before-close="beforeClose"
+                 :search.sync="search"
+                 @row-save="rowSave"
+                 @saveColumn="saveColumn"
+                 @search-change="searchChange"
+                 @search-reset="searchReset"
+                 @selection-change="selectionChange"
+                 @current-change="currentChange"
+                 @size-change="sizeChange"
+                 @refresh-change="refreshChange"
+                 @on-load="onLoad"
+                 @tree-load="treeLoad">
+        <template slot="menuLeft" slot-scope="{size}">
+          <el-button type="success" :size="size" @click="copyOrder" :disabled="single">复制新单</el-button>
+          <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
             type="text"
             icon="el-icon-view"
             size="small"
             @click.stop="beforeOpenPage(scope.row,scope.index)"
-        >查看
-        </el-button>
-        <el-button
+          >查看
+          </el-button>
+          <el-button
             type="text"
             icon="el-icon-edit"
             size="small"
             @click.stop="editOpen(scope.row,scope.index)"
-        >编辑
-        </el-button>
-        <el-button
+          >编辑
+          </el-button>
+          <el-button
             type="text"
             icon="el-icon-delete"
             size="small"
             @click.stop="rowDel(scope.row,scope.index)"
-        >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+          >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+
+    <detail-page
+      ref="detail"
+      @goBack="goBack"
+      :detailData="detailData"
+      v-else
+    ></detail-page>
+  </div>
 </template>
 
 <script>
 import option from "./configuration/mainList.json";
 import {customerList, typeSave, deleteDetails} from "@/api/basicData/configuration"
+import detailPage from "./detailsPageEdit";
 
 export default {
   name: "customerInformation",
+  components: {
+    detailPage
+  },
   data() {
     return {
       form: {},
@@ -74,6 +88,8 @@ export default {
       // 非多个禁用
       multiple: true,
       selection: [],
+      isShow: true,
+      detailData: {},
     }
   },
   created() {
@@ -141,33 +157,36 @@ export default {
       column.addDisabled = true;
       this.$refs.crud.rowAdd();
     },
+    closeDetailPage() {
+      this.isShow = true
+    },
     //查看跳转页面
     beforeOpenPage(row, index) {
-      this.$router.push({
-        path: "/salesOrder_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     //新增跳转页面
     beforeOpen(row, index) {
-      this.$router.push({
-        path: "/salesOrder_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     editOpen(row, index) {
-      this.$router.push({
-        path: "/salesOrder_detailsPageEdit",
-        query: {id: JSON.stringify(row.id)},
-      });
+      this.detailData = {
+        id: row.id,
+      };
+      this.isShow = false;
     },
     // 复制新单
     copyOrder() {
       const id = this.selection[0].id;
-      this.$router.push({
-        path: "/salesOrder_detailsPageEdit",
-        query: {copyId: JSON.stringify(id)},
-      });
+      this.detailData = {
+        copyId: id,
+      };
+      this.isShow = false;
     },
     //点击新增时触发
     beforeClose(done) {
@@ -223,6 +242,10 @@ export default {
         resolve(res.data.data.records);
       });
     },
+    goBack() {
+      this.detailData=this.$options.data().detailData
+      this.isShow = true;
+    },
   }
 }
 </script>