Browse Source

修改bug

Qukatie 3 years ago
parent
commit
73f3696246

+ 103 - 0
src/components/goodsType/configuration/mainList.json

@@ -0,0 +1,103 @@
+{
+  "border": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "stripe": true,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "searchMenuPosition": "right",
+  "tree": true,
+  "selection": true,
+  "viewBtn": true,
+  "menuWidth": 400,
+  "column": [
+    {
+      "label": "类别名称",
+      "prop": "cname",
+      "search": true,
+      "index": 1,
+      "width": 400,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入类别名称",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "创建时间",
+      "prop": "createTimeA",
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "search": true,
+      "searchRange":true,
+      "addDisplay": false,
+      "editDisplay":false,
+      "index": 2,
+      "width": 250,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入创建时间",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "上级类型",
+      "prop": "parentId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "addDisabled": false,
+      "props": {
+        "label": "title",
+        "value": "value"
+      },
+      "rules": [{
+        "required": false,
+        "message": "请选择上级机构",
+        "trigger": "click"
+      }]
+    },
+    {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 5,
+      "width": 200,
+      "rules": [{
+        "required": true,
+        "message": "请输入排序",
+        "trigger": "blur"
+      }]
+    },
+    {
+      "label": "状态",
+      "type": "select",
+      "prop": "status",
+      "search": true,
+      "index": 4,
+      "width": 200,
+      "value":0,
+      "dicData": [{
+        "label": "正常",
+        "value": 0
+      }, {
+        "label": "关闭",
+        "value": 1
+      }],
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入状态",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 202 - 0
src/components/goodsType/index.vue

@@ -0,0 +1,202 @@
+<template>
+    <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-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          icon="el-icon-circle-plus-outline"
+          size="small"
+          @click.stop="handleAdd(scope.row, scope.index)"
+          >新增子项
+        </el-button>
+      </template>
+    </avue-crud>
+</template>
+
+<script>
+import option from "./configuration/mainList.json";
+import {
+  customerList,
+  typeSave,
+  detail,
+  deleteDetails,
+  getTreeList
+} from "@/api/basicData/commodityCategory";
+
+export default {
+  name: "customerInformation",
+  data() {
+    return {
+      form: {},
+      option: option,
+      parentId: 0,
+      dataList: [],
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      query: {}
+    };
+  },
+  created() {
+    getTreeList({ parentId: 0 }).then(res => {
+      const column = this.findObject(this.option.column, "parentId");
+      column.dicData = res.data.data;
+    });
+    this.option.height = window.innerHeight - 500;
+  },
+  methods: {
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          return deleteDetails(row.id);
+        })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        });
+    },
+    //修改时的修改按钮点击触发
+    rowUpdate(row, index, done, loading) {
+      typeSave(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //新增修改时保存触发
+    rowSave(row, done, loading) {
+      typeSave(row).then(res => {
+        this.page.currentPage = 1;
+        this.onLoad(this.page, { parentId: 0 });
+        done();
+      });
+    },
+    //新增子项触发
+    handleAdd(row) {
+      this.parentId = row.id;
+      const column = this.findObject(this.option.column, "parentId");
+      this.$set(this.form, "parentId", row.id);
+      column.addDisabled = true;
+      this.$refs.crud.rowAdd();
+    },
+    //新增子项和新增触发查询所有
+    beforeOpen(done, type) {
+      if (["add", "edit"].includes(type)) {
+      }
+      if (["edit", "view"].includes(type)) {
+        detail(this.form.id).then(res => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    //点击新增时触发
+    beforeClose(done) {
+      this.parentId = "";
+      const column = this.findObject(this.option.column, "parentId");
+      column.value = "";
+      column.addDisabled = false;
+      done();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    searchReset() {
+      console.log("1");
+    },
+    selectionChange() {
+      console.log("1");
+    },
+    currentChange() {
+      console.log("1");
+    },
+    sizeChange() {
+      console.log("1");
+    },
+    refreshChange() {
+      console.log("1");
+    },
+    onLoad(page, params = {}) {
+      const { createTimeA } = this.query;
+      let values = {
+        ...params,
+        size: this.page.pageSize,
+        current: this.page.currentPage
+      };
+      if (createTimeA) {
+        values = {
+          ...params,
+          createTime: createTimeA[0] + " 00:00:00",
+          endTime: createTimeA[1] + " 23:59:59",
+          size: this.page.pageSize,
+          current: this.page.currentPage,
+          ...this.query
+        };
+        values.createTimeA = null;
+      }
+      values.parentId = 0;
+      customerList(values).then(res => {
+        this.dataList = res.data.data.records;
+        this.page.total = res.data.data.total;
+      });
+    },
+    //树桩列点击展开触发
+    treeLoad(tree, treeNode, resolve) {
+      const parentId = tree.id;
+      customerList({ parentId: parentId, size: 10000 }).then(res => {
+        resolve(res.data.data.records);
+      });
+    }
+  }
+};
+</script>
+
+<style scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.8vh;
+}
+</style>

+ 6 - 0
src/page/index/tags.vue

@@ -348,6 +348,12 @@ export default {
         if(tag.label == "出库管理"){
           this.$store.commit("OUT_CKGL_STATUS");
         }
+        if(tag.label == "销售单"){
+          this.$store.commit("OUT_PJXS_STATUS");
+        }
+        if(tag.label == "采购单"){
+          this.$store.commit("OUT_PJCG_STATUS");
+        }
         this.$store.commit("DEL_TAG", tag);
         if (tag.value === this.tag.value) {
           tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个

+ 3 - 1
src/store/getters.js

@@ -52,6 +52,8 @@ const getters = {
   handOverStatus: state => state.ifdetail.handOverStatus,
   reimbursementStatus: state => state.ifdetail.reimbursementStatus,
   dealerSaleStatus: state => state.ifdetail.dealerSaleStatus,
-  ckglStatus:state => state.ifdetail.ckglStatus
+  ckglStatus:state => state.ifdetail.ckglStatus,
+  pjxsStatus:state => state.ifdetail.pjxsStatus,
+  pjcgStatus:state => state.ifdetail.pjcgStatus
 }
 export default getters

+ 20 - 0
src/store/modules/ifdetail.js

@@ -27,6 +27,8 @@ const ifdetail = {
     dealerSaleStatus: false, //经销商销售
     xsjhStatus: false,
     ckglStatus: false, //出口报价
+    pjxsStatus:false,
+    pjcgStatus:false
   },
   actions: {},
   mutations: {
@@ -88,6 +90,12 @@ const ifdetail = {
     IN_CKGL_STATUS(state) {
       state.ckglStatus = true;
     },
+    IN_PJXS_STATUS(state) {
+      state.pjxsStatus = true;
+    },
+    IN_PJCG_STATUS(state) {
+      state.pjcgStatus = true;
+    },
     //退出详情页
     OUT_BJ_STATUS(state) {
       state.bjStatus = false;
@@ -95,6 +103,12 @@ const ifdetail = {
     OUT_CKGL_STATUS(state) {
       state.ckglStatus = false;
     },
+    OUT_PJXS_STATUS(state) {
+      state.pjxsStatus = false;
+    },
+    OUT_PJCG_STATUS(state) {
+      state.pjcgStatus = false;
+    },
     //出口状态
     // 进入详情页
     REC_IN_DETAIL(state) {
@@ -274,6 +288,12 @@ const ifdetail = {
       if(tag.label=='出库管理'){
         state.ckglStatus = true;
       }
+      if(tag.label=='销售单'){
+        state.pjxsStatus = true;
+      }
+      if(tag.label=='采购单'){
+        state.pjcgStatus = true;
+      }
       if (tag.label == '付费申请') {
         state.pqStatus = true;
       }

+ 24 - 4
src/views/client/detailsInfo.vue

@@ -93,8 +93,13 @@
                         <template slot="corpIdSearch">
                             <crop-select v-model="search.corpId" corpType="KH"></crop-select>
                         </template>
+                        <template slot-scope="{ row, index }" slot="orderNo">
+                            <span style="color: #409EFF;cursor: pointer" @click.stop="editOrder(row)">{{ row.orderNo
+                            }}
+                            </span>
+                        </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="editCustomer">{{ row.corpsName
                             }}
                             </span>
                         </template>
@@ -163,7 +168,7 @@
 <script>
 import { optionList, sellOption, capitalOption } from "./js/optionList";
 import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods } from "@/api/basicData/salesOrder";
-import { getDetails,getSellList } from "@/api/basicData/client";
+import { getDetails, getSellList } from "@/api/basicData/client";
 import { validatenull } from "@/util/validate";
 export default {
     name: "index",
@@ -417,8 +422,23 @@ export default {
                     this.loading = false;
                 });
         },
-        editCustomer(){
-            this.$emit('editOpen',this.form,1)
+        editCustomer() {
+            this.$emit('editOpen', this.form, 2)
+        },
+        editOrder(row) {
+            if (this.$store.getters.pjxsStatus) {
+                return this.$alert("销售单已存在,请保存销售单再进行操作", "温馨提示", {
+                    confirmButtonText: "确定",
+                    type: "warning",
+                    callback: action => {
+                        console.log(action);
+                    }
+                });
+            }
+            this.$router.push({
+                path: '/salesOrder/index',
+                query: { orderId: row.id },
+            });
         },
         async saveColumn() {
             const inSave = await this.saveColumnData(

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

@@ -17,8 +17,7 @@
         <avue-form ref="form" class="trading-form" v-model="form" :option="option">
           <template slot="corpsTypeId">
             <div style="display:flex;">
-              <avue-input-tree v-model="form.corpsTypeId" placeholder="请选择客户分类" :dic="corpTypeList"
-                :props="props">
+              <avue-input-tree v-model="form.corpsTypeId" placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
               </avue-input-tree>
               <i class="el-icon-setting" style="font-size:18px;line-height: 32px;margin-left:4px"
                 @click="corpTypeVisible = true"></i>
@@ -79,7 +78,7 @@
       </trade-card>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload v-loading="loadingBtn" typeUpload="CD"
-        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="corpsFiles" display
+        deleteUrl="/api/blade-client/corpsfiles/remove" :data="corpsFiles" display
         :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
       <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
         append-to-body @closed="corpTypeClosed">
@@ -364,8 +363,13 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          if (this.corpsFiles.length > 0) {
+            this.corpsFiles.forEach((e, index) => {
+              e.sort = Number(index) + 1
+            });
+          }
           this.loadingBtn = true;
-          submit({ ...this.form, code: this.form.cname, corpType: "KH", corpsAddrList: this.data })
+          submit({ ...this.form, code: this.form.cname, corpType: "KH", corpsAddrList: this.data, corpsFiles: this.corpsFiles })
             .then(res => {
               this.$message.success("保存成功");
               this.form = res.data.data;

+ 7 - 2
src/views/client/index.vue

@@ -119,8 +119,8 @@
     </basic-container>
     <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
     <details-info v-if="!showInfo" @goBack="goBack()" @editOpen="editOpen" :detailData="detailData" />
-    <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog"
-      width="80%" append-to-body @closed="corpTypeClosed">
+    <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
+      append-to-body @closed="corpTypeClosed">
       <span>
         <corp-type></corp-type>
         <!-- <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
@@ -290,6 +290,9 @@ export default {
     this.option.height = window.innerHeight - 330;
     this.getAllWorkDicts()
   },
+  activated() {
+    this.$refs.crud.refreshTable();
+  },
   methods: {
     filterNode(value, data) {
       console.log(value, data)
@@ -383,6 +386,7 @@ export default {
       // this.form4 = this.$options.data().form4
     },
     viewInfo(row) {
+      this.show = true;
       this.detailData = {
         id: row.id,
         status: status
@@ -390,6 +394,7 @@ export default {
       this.showInfo = false;
     },
     editOpen(row, status) {
+      this.showInfo = true;
       this.detailData = {
         id: row.id,
         status: status

+ 5 - 0
src/views/client/js/optionList.js

@@ -72,6 +72,11 @@ export const option = {
       label: "状态",
       prop: "status",
       type: 'select',
+      props: {
+        label: "dictValue",
+        value: "dictKey"
+      },
+      dicData:[],
       hide: true,
       search: true,
       showColumn: false,

+ 2 - 1
src/views/exportTrade/customerInquiry/components/goodsInfo.vue

@@ -1160,7 +1160,8 @@ export default {
             const itemProp = row.itemProp ? row.itemProp : ''
             const partsDescribe = row.partsDescribe ? row.partsDescribe : ''
             const productRemark =
-                ename + " " + itemDescription + "\n" +
+                ename + "\n" + 
+                itemDescription + "\n" +
                 itemProp + "\n" +
                 partsDescribe
             return productRemark

+ 29 - 18
src/views/product/detailsPage.vue

@@ -65,11 +65,12 @@
       </trade-card>
       <containerTitle title="主图附件"></containerTitle>
       <c-upload :data="filesList" display deleteUrl="/api/blade-client/goodsfiles/delete" :enumerationValue="160" />
-      <el-dialog title="添加产品分类" v-dialogDrag :visible.sync="goodsTypeVisible" class="avue-dialog avue-dialog--top"
-        width="30%" append-to-body @closed="goodsTypeClosed">
+      <el-dialog title="设置产品分类" v-dialogDrag :visible.sync="goodsTypeVisible" class="avue-dialog"
+        width="80%" append-to-body @closed="goodsTypeClosed">
         <span>
-          <avue-form :key="reload" ref="goodsType" v-model="form2" :option="option2" style="margin-top:20px">
-          </avue-form>
+          <!-- <avue-form :key="reload" ref="goodsType" v-model="form2" :option="option2" style="margin-top:20px">
+          </avue-form> -->
+          <goods-type></goods-type>
         </span>
         <div class="avue-dialog__footer">
           <el-button @click="goodsTypeVisible = false" size="mini">取 消</el-button>
@@ -96,6 +97,7 @@
 <script>
 import { getGoodstype, getDetails, goodsTypesubmit, getStoragetype, submit, itemRemove, disabled, getStoragelist, storagesubmit } from "@/api/basicData/product";
 import { optionList } from "./js/optionList";
+import goodsType from '@/components/goodsType/index'
 export default {
   name: "index",
   data() {
@@ -284,6 +286,9 @@ export default {
       optionList: {}
     };
   },
+  components: {
+    goodsType
+  },
   props: {
     detailData: {
       type: Object
@@ -324,7 +329,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("确定删除数据?", {
@@ -368,21 +377,23 @@ 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;
-        }
-      });
+      // this.$refs["storage"].validate((valid, done) => {
+      //   done();
+      //   if (valid) {
+      //     storagesubmit({ ...this.form3, status: 0 }).then(res => {
+      //       this.getAllWorkDicts()
+      //     })
+      //     this.storageVisible = false
+      //   } else {
+      //     return false;
+      //   }
+      // });
+      this.getAllWorkDicts()
+      this.goodsTypeVisible = false
     },
     goodsTypeClosed() {
-      this.reload = Math.random();
-      this.form2 = this.$options.data().form2
+      // this.reload = Math.random();
+      // this.form2 = this.$options.data().form2
     },
     storageClosed() {
       this.reload2 = Math.random();

+ 29 - 22
src/views/product/index.vue

@@ -5,7 +5,7 @@
         <el-col :span="4">
           <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:82vh;">
             <template slot="addBtn">
-              <i class="el-icon-plus" @click="goodsTypeVisible = true"
+              <i class="el-icon-setting" @click="goodsTypeVisible = true"
                 style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"></i>
             </template>
           </avue-tree>
@@ -18,7 +18,7 @@
             <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 type="primary" size="mini" @click="excelBox = true">导入
               </el-button>
             </template>
             <template slot-scope="{ row, index }" slot="cname">
@@ -56,11 +56,12 @@
       </el-row>
     </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">
+    <el-dialog title="设置产品分类" v-dialogDrag :visible.sync="goodsTypeVisible" class="avue-dialog" width="80%"
+      append-to-body @closed="goodsTypeClosed">
       <span>
-        <avue-form :key="reload" ref="goodsType" v-model="form2" :option="option2" style="margin-top:20px">
-        </avue-form>
+        <goods-type></goods-type>
+        <!-- <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>
@@ -87,6 +88,7 @@ import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
 import { getList, remove, getAllgoods, getGoodstype, goodsTypesubmit } from "@/api/basicData/product";
 import { getToken } from "@/util/auth";
+import goodsType from '@/components/goodsType/index'
 export default {
   name: "index",
   data() {
@@ -177,13 +179,17 @@ export default {
     };
   },
   components: {
-    detailsPage
+    detailsPage,
+    goodsType
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(217), option);
     this.option.height = window.innerHeight - 210;
     this.getAllWorkDicts()
   },
+  activated() {
+    this.$refs.crud.refreshTable();
+  },
   methods: {
     getAllWorkDicts() {
       // getCorpsAll().then(res => {
@@ -219,8 +225,7 @@ export default {
     },
     derivation() {
       window.open(
-        `/api/blade-client/goodsDescParts/export-descParts-info?${
-          this.website.tokenHeader
+        `/api/blade-client/goodsDescParts/export-descParts-info?${this.website.tokenHeader
         }=${getToken()}`
       );
     },
@@ -245,21 +250,23 @@ export default {
       this.show = false;
     },
     saveGoodstype() {
-      this.$refs["goodsType"].validate((valid, done) => {
-        done();
-        if (valid) {
-          goodsTypesubmit({ ...this.form2, status: 0 }).then(res => {
-            this.getAllWorkDicts()
-          })
-          this.goodsTypeVisible = false
-        } else {
-          return false;
-        }
-      });
+      // this.$refs["goodsType"].validate((valid, done) => {
+      //   done();
+      //   if (valid) {
+      //     goodsTypesubmit({ ...this.form2, status: 0 }).then(res => {
+      //       this.getAllWorkDicts()
+      //     })
+      //     this.goodsTypeVisible = false
+      //   } else {
+      //     return false;
+      //   }
+      // });
+      this.getAllWorkDicts()
+      this.goodsTypeVisible = false
     },
     goodsTypeClosed() {
-      this.reload = Math.random();
-      this.form2 = this.$options.data().form2
+      // this.reload = Math.random();
+      // this.form2 = this.$options.data().form2
     },
     nodeClick(data) {
       this.search.goodsTypeId = data.value

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

@@ -63,6 +63,9 @@ export default {
             // if (!this.form.corpId) {
             //     return this.$message.error("请选择供应商名称");
             // }
+            if(!this.form.id){
+                return this.$message.error("请保存数据");
+            }
             this.data.push({ $cellEdit: true })
         },
         rowCell(row, index) {

+ 7 - 4
src/views/purchaseOrder/detailsPage.vue

@@ -16,7 +16,7 @@
           </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">
@@ -405,7 +405,6 @@ export default {
       return "padding:0;height:40px;";
     },
     cnameChange(row) {
-      console.log(row)
       if (row.cname) {
         this.goodsoptions.forEach(e => {
           if (e.cname == row.cname) {
@@ -414,14 +413,18 @@ export default {
             row.price = e.standardPrice
             row.storageInQuantity = 1
             row.amount = e.standardPrice
-            row.purchaseAmount = e.purchasePrice
+            row.purchasePrice = e.purchasePrice
             row.storageAmount = e.purchasePrice
           }
         })
       } else {
+        row.itemId = null
         row.unit = null
         row.price = null
-        row.purchaseAmount = null
+        row.storageInQuantity = null
+        row.amount = null
+        row.purchasePrice = null
+        row.storageAmount = null
       }
       this.countChange(row)
     },

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

@@ -155,6 +155,17 @@ export default {
     this.option.height = window.innerHeight - 210;
     this.getAllWorkDicts()
   },
+  activated() {
+    this.$refs.crud.refreshTable();
+    if (!this.$store.getters.pjcgStatus&&!this.show) {
+      this.show = true;
+    }
+    if (this.$route.query.orderId) {
+      setTimeout(() => {
+        this.editOpen({ id: this.$route.query.orderId }, 1);
+      }, 100);
+    }
+  },
   methods: {
     getAllWorkDicts() {
       gainUser().then(res => {
@@ -190,6 +201,7 @@ export default {
     },
     newAdd() {
       this.show = false;
+      this.$store.commit("IN_PJCG_STATUS");
     },
     onLoad(page, params = {}) {
       let data = this.deepClone(Object.assign(params, this.search));
@@ -220,6 +232,7 @@ export default {
         status: status
       };
       this.show = false;
+      this.$store.commit("IN_PJCG_STATUS");
     },
     currentChange(val) {
       this.page.currentPage = val;
@@ -276,6 +289,7 @@ export default {
       this.detailData = this.$options.data().detailData;
       this.show = true;
       this.onLoad(this.page, this.search);
+      this.$store.commit("OUT_PJCG_STATUS");
     },
   }
 }

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

@@ -63,6 +63,9 @@ export default {
             // if (!this.form.corpId) {
             //     return this.$message.error("请选择客户名称");
             // }
+            if(!this.form.id){
+                return this.$message.error("请保存数据");
+            }
             this.data.push({ $cellEdit: true })
         },
         rowCell(row, index) {

+ 13 - 9
src/views/salesOrder/detailsPage.vue

@@ -16,13 +16,13 @@
           </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 type="primary" size="small" v-if="form.confirmStatus == 1" @click="revokeOrder">
             撤销
           </el-button>
         </div>
@@ -52,7 +52,8 @@
           <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 v-for="item in goodsoptions" :key="item.itemId" :label="item.cname" :value="item.cname"
+                :disabled="item.status == 1">
               </el-option>
             </el-select>
             <span v-else>{{ row.cname }}</span>
@@ -406,7 +407,6 @@ export default {
       return "padding:0;height:40px;";
     },
     cnameChange(row) {
-      console.log(row)
       if (row.cname) {
         this.goodsoptions.forEach(e => {
           if (e.cname == row.cname) {
@@ -415,14 +415,18 @@ export default {
             row.price = e.standardPrice
             row.storageInQuantity = 1
             row.amount = e.standardPrice
-            row.purchaseAmount = e.purchasePrice
+            row.purchasePrice = e.purchasePrice
             row.storageAmount = e.purchasePrice
           }
         })
       } else {
+        row.itemId = null
         row.unit = null
         row.price = null
-        row.purchaseAmount = null
+        row.storageInQuantity = null
+        row.amount = null
+        row.purchasePrice = null
+        row.storageAmount = null
       }
       this.countChange(row)
     },
@@ -515,7 +519,7 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
-          if(this.data.length==0){
+          if (this.data.length == 0) {
             return this.$message.error('请添加一条商品信息');
           }
           this.loadingBtn = true;
@@ -580,7 +584,7 @@ export default {
         }
       });
     },
-    revoke() {
+    revokeOrder() {
       this.$confirm('此操作将会撤销单子, 是否继续?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -593,7 +597,7 @@ export default {
             this.form = res.data.data;
             this.data = res.data.data.orderItemsList;
             this.settlementList = res.data.data.settlementList
-            this.openEdit()
+            // this.openEdit()
           })
           .finally(() => {
             this.loadingBtn = false;

+ 24 - 4
src/views/salesOrder/index.vue

@@ -27,7 +27,7 @@
             <i class="tradingIcon icon-add" />
           </el-tooltip> -->
           <el-tooltip class="item" effect="dark" content="删除" placement="top">
-            <i class="tradingIcon icon-del" v-if="row.confirmStatus == 0" @click.stop="rowDel(row, index)"/>
+            <i class="tradingIcon icon-del" v-if="row.confirmStatus == 0" @click.stop="rowDel(row, index)" />
           </el-tooltip>
           <!-- <el-tooltip class="item" effect="dark" content="编辑" placement="top">
             <i class="tradingIcon icon-edit" />
@@ -57,7 +57,7 @@
 <script>
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
-import { getList, getCorpsAll, gainUser,getCorpType,getAllgoods,orderRemove } from "@/api/basicData/salesOrder";
+import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods, orderRemove } from "@/api/basicData/salesOrder";
 export default {
   name: "index",
   data() {
@@ -155,16 +155,27 @@ export default {
     this.option.height = window.innerHeight - 210;
     this.getAllWorkDicts()
   },
+  activated() {
+    this.$refs.crud.refreshTable();
+    if (!this.$store.getters.pjxsStatus && !this.show) {
+      this.show = true;
+    }
+    if (this.$route.query.orderId) {
+      setTimeout(() => {
+        this.editOpen({ id: this.$route.query.orderId }, 1);
+      }, 100);
+    }
+  },
   methods: {
     getAllWorkDicts() {
       gainUser().then(res => {
         this.findObject(this.option.column, "createUser").dicData = res.data.data;
       })
       getCorpType({ corpType: 'KH' }).then(res => {
-        this.findObject(this.option.column, "corpType").dicData= res.data.data
+        this.findObject(this.option.column, "corpType").dicData = res.data.data
       });
       getAllgoods().then(res => {
-        this.findObject(this.option.column, "cname").dicData= res.data.data
+        this.findObject(this.option.column, "cname").dicData = res.data.data
       });
       this.$refs.crud.init();
     },
@@ -190,6 +201,7 @@ export default {
     },
     newAdd() {
       this.show = false;
+      this.$store.commit("IN_PJXS_STATUS");
     },
     onLoad(page, params = {}) {
       let data = this.deepClone(Object.assign(params, this.search));
@@ -220,6 +232,7 @@ export default {
         status: status
       };
       this.show = false;
+      this.$store.commit("IN_PJXS_STATUS");
     },
     currentChange(val) {
       this.page.currentPage = val;
@@ -273,9 +286,16 @@ export default {
     },
     //返回列表
     goBack() {
+      if (this.$route.query.orderId) {
+        this.$router.$avueRouter.closeTag(this.$route.fullPath);
+        this.$router.push({
+          path: "/salesOrder/index"
+        });
+      }
       this.detailData = this.$options.data().detailData;
       this.show = true;
       this.onLoad(this.page, this.search);
+      this.$store.commit("OUT_PJXS_STATUS");
     },
   }
 }

+ 31 - 4
src/views/supplier/detailsInfo.vue

@@ -93,8 +93,13 @@
                         <template slot="corpIdSearch">
                             <crop-select v-model="search.corpId" corpType="GYS"></crop-select>
                         </template>
+                        <template slot-scope="{ row, index }" slot="orderNo">
+                            <span style="color: #409EFF;cursor: pointer" @click.stop="editOrder(row)">{{ row.orderNo
+                            }}
+                            </span>
+                        </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="editCustomer">{{ row.corpsName
                             }}
                             </span>
                         </template>
@@ -163,7 +168,7 @@
 <script>
 import { optionList, sellOption, capitalOption } from "./js/optionList";
 import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods } from "@/api/basicData/salesOrder";
-import { getDetails,getSellList } from "@/api/basicData/client";
+import { getDetails, getSellList } from "@/api/basicData/client";
 import { validatenull } from "@/util/validate";
 export default {
     name: "index",
@@ -294,6 +299,13 @@ export default {
         }
         this.getAllWorkDicts()
     },
+    activated() {
+        if (this.$route.query.orderId) {
+            setTimeout(() => {
+                this.editOpen({ id: this.$route.query.orderId }, 1);
+            }, 100);
+        }
+    },
     methods: {
         getAllWorkDicts() {
             gainUser().then(res => {
@@ -417,8 +429,23 @@ export default {
                     this.loading = false;
                 });
         },
-        editCustomer(){
-            this.$emit('editOpen',this.form,1)
+        editOrder(row) {
+            if (this.$store.getters.pjcgStatus) {
+            return this.$alert("采购单已存在,请保存采购单再进行操作", "温馨提示", {
+                confirmButtonText: "确定",
+                type: "warning",
+                callback: action => {
+                    console.log(action);
+                }
+            });
+        }
+            this.$router.push({
+                path: '/purchaseOrder/index',
+                query: { orderId: row.id },
+            });
+        },
+        editCustomer() {
+            this.$emit('editOpen', this.form, 2)
         },
         async saveColumn() {
             const inSave = await this.saveColumnData(

+ 20 - 16
src/views/supplier/detailsPage.vue

@@ -17,8 +17,7 @@
         <avue-form ref="form" class="trading-form" v-model="form" :option="option">
           <template slot="corpsTypeId">
             <div style="display:flex;">
-              <avue-input-tree v-model="form.corpsTypeId" placeholder="请选择供应商分类" :dic="corpTypeList"
-                :props="props">
+              <avue-input-tree v-model="form.corpsTypeId" placeholder="请选择供应商分类" :dic="corpTypeList" :props="props">
               </avue-input-tree>
               <i class="el-icon-setting" style="font-size:18px;line-height: 32px;margin-left:4px"
                 @click="corpTypeVisible = true"></i>
@@ -79,25 +78,25 @@
       </trade-card>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload v-loading="loadingBtn" typeUpload="CD"
-        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="corpsFiles" display
+        deleteUrl="/api/blade-client/corpsfiles/remove" :data="corpsFiles" display
         :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
-        <el-dialog title="设置供应商分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog"
-      width="80%" append-to-body @closed="corpTypeClosed">
-      <span>
-        <supplier-type></supplier-type>
-      </span>
-      <div class="avue-dialog__footer">
-        <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
-        <el-button @click="addCorpType" type="primary" size="mini">确 定</el-button>
-      </div>
-    </el-dialog>
+      <el-dialog title="设置供应商分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
+        append-to-body @closed="corpTypeClosed">
+        <span>
+          <supplier-type></supplier-type>
+        </span>
+        <div class="avue-dialog__footer">
+          <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
+          <el-button @click="addCorpType" type="primary" size="mini">确 定</el-button>
+        </div>
+      </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
 import { option2, option3 } from "./js/optionList";
-import { getDetails, addCorpType, getCorpType, submit, customerList,itemDel } from "@/api/basicData/client";
+import { getDetails, addCorpType, getCorpType, submit, customerList, itemDel } from "@/api/basicData/client";
 import supplierType from '@/components/supplierType/index'
 export default {
   name: "index",
@@ -236,7 +235,7 @@ export default {
       this.getWorkDicts("abbreviation").then(res => {
         this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
       });
-      this.findObject(this.option2.column, "addr").dicData =JSON.parse(localStorage.getItem('areaTypeTree'))
+      this.findObject(this.option2.column, "addr").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
       this.$refs.crud.init();
     },
     cellStyle() {
@@ -348,8 +347,13 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          if (this.corpsFiles.length > 0) {
+            this.corpsFiles.forEach((e, index) => {
+              e.sort = Number(index) + 1
+            });
+          }
           this.loadingBtn = true;
-          submit({ ...this.form, code: this.form.cname, corpType: "GYS", corpsAddrList: this.data.concat(this.data2) })
+          submit({ ...this.form, code: this.form.cname, corpType: "GYS", corpsAddrList: this.data, corpsFiles: this.corpsFiles })
             .then(res => {
               this.$message.success("保存成功");
               this.form = res.data.data;

+ 5 - 0
src/views/supplier/index.vue

@@ -287,6 +287,9 @@ export default {
     this.option.height = window.innerHeight - 330;
     this.getAllWorkDicts()
   },
+  activated() {
+    this.$refs.crud.refreshTable();
+  },
   methods: {
     filterNode(value, data) {
       console.log(value, data)
@@ -380,6 +383,7 @@ export default {
       // this.form4 = this.$options.data().form4
     },
     viewInfo(row) {
+      this.show = true;
       this.detailData = {
         id: row.id,
         status: status
@@ -387,6 +391,7 @@ export default {
       this.showInfo = false;
     },
     editOpen(row, status) {
+      this.showInfo = true;
       this.detailData = {
         id: row.id,
         status: status