Browse Source

修改bug

lichao 3 years ago
parent
commit
1267c21fb8

+ 1 - 1
src/api/officeSupplies/purchaseApply.js

@@ -46,7 +46,7 @@ export function removeGoods(data) {
 // 请核
 export function pleaseCheck(data) {
   return request({
-    url: '/api/trade-purchase/office-order/checkOrder',
+    url: '/api/trade-purchase/office-order/check-order',
     method: 'post',
     data: data
   })

+ 9 - 0
src/api/officeSupplies/requisition.js

@@ -1,4 +1,5 @@
 import request from '@/router/axios';
+
 // 列表查询
 export function getList(params) {
   return request({
@@ -42,3 +43,11 @@ export function removeGoods(data) {
     }
   })
 }
+// 请核
+export function pleaseCheck(data) {
+  return request({
+    url: '/api/trade-purchase/office-order/check-order',
+    method: 'post',
+    data: data
+  })
+}

+ 10 - 0
src/api/officeSupplies/stock.js

@@ -0,0 +1,10 @@
+import request from '@/router/axios';
+
+// 列表查询
+export function getStockList(params) {
+  return request({
+    url: '/api/trade-purchase/stock/list',
+    method: 'get',
+    params
+  })
+}

+ 16 - 0
src/api/officeSupplies/warehousing.js

@@ -42,3 +42,19 @@ export function removeGoods(data) {
     }
   })
 }
+// 确认入库
+export function confirmReceipt(data) {
+  return request({
+    url: '/api/trade-purchase/office-order/submit',
+    method: 'post',
+    data
+  })
+}
+// 确认入库
+export function cancelReceipt(data) {
+  return request({
+    url: '/api/trade-purchase/office-order/revoke',
+    method: 'post',
+    data
+  })
+}

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

@@ -366,6 +366,9 @@ export default {
         if (tag.label == "采购申请") {
           this.$store.commit('OFFICEPUR_OUT_DETAIL');
         }
+        if (tag.label == "领用") {
+          this.$store.commit('OFFICELY_OUT_DETAIL');
+        }
         this.$store.commit("DEL_TAG", tag);
         if (tag.value === this.tag.value) {
           tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个

+ 1 - 0
src/store/getters.js

@@ -47,5 +47,6 @@ const getters = {
   xsStatus: state => state.ifdetail.xsStatus,
   bjStatus: state => state.ifdetail.bjStatus,
   officePurchaseStatus: state => state.ifdetail.officePurchaseStatus,
+  officeLyStatus: state => state.ifdetail.officeLyStatus,
 }
 export default getters

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

@@ -21,6 +21,7 @@ const ifdetail = {
     xsStatus: false, //出口销售
     bjStatus: false, //出口报价
     officePurchaseStatus: false, // 办公采购
+    officeLyStatus: false, //办公领用
   },
   actions: {},
   mutations: {
@@ -188,6 +189,13 @@ const ifdetail = {
     OFFICEPUR_OUT_DETAIL(state) {
       state.officePurchaseStatus = false;
     },
+    // 办公领用
+    OFFICELY_IN_DETAIL(state) {
+      state.officeLyStatus = true;
+    },
+    OFFICELY_OUT_DETAIL(state) {
+      state.officeLyStatus = false;
+    },
     //关闭所有
     DEL_ALL_DETAIL(state) {
       for (let item in state) {

+ 8 - 0
src/views/approveData/configuration/mainList.json

@@ -45,6 +45,14 @@
         {
           "label": "付费申请",
           "value": "付费申请"
+        },
+        {
+          "label": "办公用品采购审批",
+          "value": "办公用品采购审批"
+        },
+        {
+          "label": "办公用品领用审批",
+          "value": "办公用品领用审批"
         }
       ],
       "search": true,

+ 2 - 0
src/views/approveData/index.vue

@@ -31,6 +31,8 @@
         <span v-else-if="scope.row.checkType == 'czgz'">初中部工资审批</span>
         <span v-else-if="scope.row.checkType == 'gzgz'">高中部工资审批</span>
         <span v-else-if="scope.row.checkType == 'hqgz'">后勤工资审批</span>
+        <span v-else-if="scope.row.checkType == 'ocg'">办公用品采购审批</span>
+        <span v-else-if="scope.row.checkType == 'oly'">办公用品领用审批</span>
       </template>
       <template slot="menuLeft">
         <el-button

+ 2 - 2
src/views/saleLeads/index.vue

@@ -210,10 +210,10 @@ export default {
       this.selection = list;
     },
     goBack() {
-      if (this.$route.query.id) {
+      if (this.$route.query) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
         this.$router.push({
-          path: "/dealer/sales/index"
+          path: "/saleLeads/index"
         });
       }
       this.detailData = this.$options.data().detailData;

+ 112 - 8
src/views/workManagement/purchaseApply/detail.vue

@@ -16,10 +16,26 @@
           size="small"
           class="el-button--small-yh"
           @click.stop="openEdit"
+          v-if="disabled"
         >编 辑</el-button>
         <el-button
+          v-if="checker && form.status != 3"
+          type="primary"
+          size="small"
+          class="el-button--small-yh"
+          @click.stop="openCheckDialog">
+          审批
+        </el-button>
+        <el-button
+          v-if="form.status > 0"
+          @click.native="checkScheduleDialog = true,checkId=form.id"
           type="primary"
-          :disabled="!form.id"
+          size="small"
+        >审核进度</el-button>
+        <el-button
+          type="primary"
+          v-if="!checkDisabled"
+          :disabled="!form.id || disabled"
           size="small"
           @click="pleaseCheck"
           :loading="btnLoading"
@@ -36,6 +52,7 @@
           @click="editCustomer"
           size="small"
           :loading="btnLoading"
+          :disabled="checkDisabled || disabled"
         >保存数据</el-button>
       </div>
     </div>
@@ -54,6 +71,7 @@
               filterable
               clearable
               size="small"
+              :disabled="checkDisabled || disabled"
             >
               <el-option
                 v-for="(item,index) in userList"
@@ -73,6 +91,7 @@
               placeholder=" "
               type="tree"
               :dic="dic"
+              :disabled="checkDisabled || disabled"
             ></avue-input-tree>
           </template>
         </avue-form>
@@ -93,6 +112,7 @@
               icon="el-icon-plus"
               size="small"
               @click.stop="newDetails"
+              :disabled="checkDisabled || disabled"
             >录入明细</el-button>
             <el-button
               type="info"
@@ -106,12 +126,14 @@
               icon="el-icon-edit"
               type="text"
               @click="rowCell(row, index)"
+              :disabled="checkDisabled || disabled"
             >{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
             <el-button
               size="small"
               icon="el-icon-delete"
               type="text"
               @click="rowDel(row, index)"
+              :disabled="checkDisabled || disabled"
             >删除</el-button>
           </template>
           <template slot="code" slot-scope="{ row, index }">
@@ -311,6 +333,43 @@
         >
       </span>
     </el-dialog>
+    <el-dialog
+      append-to-body
+      title="审批"
+      class="el-dialogDeep"
+      :visible.sync="checkDialog"
+      width="50%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <check
+        :checkData="checkData"
+        :checkDetail="false"
+        :idList="[]"
+        @choceCheckFun="choceCheckFun"
+      >
+      </check>
+    </el-dialog>
+    <el-dialog
+      append-to-body
+      title="审批进度"
+      class="el-dialogDeep"
+      :visible.sync="checkScheduleDialog"
+      width="40%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <check-schedule
+        :checkId="checkId"
+        :batchNo="batchNo"
+        @choceScheduleFun="choceScheduleFun"
+      >
+      </check-schedule>
+    </el-dialog>
   </div>
 </template>
 
@@ -331,6 +390,8 @@ import {getDeptTree} from "@/api/system/dept";
 import { getCurrentDate } from "@/util/date";
 import {dataDetail, typeSave, removeGoods, pleaseCheck} from "@/api/officeSupplies/purchaseApply";
 import { contrastObj, contrastList } from "@/util/contrastData";
+import check from "@/components/check/check";
+import checkSchedule from "@/components/check/checkSchedule";
 
 export default {
   name: "detail",
@@ -339,8 +400,13 @@ export default {
       type: Object
     }
   },
+  components: {
+    check,
+    checkSchedule,
+  },
   data() {
     return {
+      disabled: false,
       pageLoading: false,
       btnLoading: false,
       form: {},
@@ -462,6 +528,13 @@ export default {
       dic: [],
       oldForm: {},
       oldDataList: [],
+      checkDisabled: false, // 审核状态
+      checker: false,
+      checkId: '',
+      batchNo:'',
+      checkDialog: false,
+      checkScheduleDialog: false,
+      checkData: {},
     }
   },
   async created() {
@@ -501,9 +574,13 @@ export default {
     this.$set(this.form, 'applyTime', getCurrentDate()); // 默认当前日期
     if (this.detailData.query) {
       this.disabled = true;
-      // this.option.column.map(e => {
-      //   this.$set(e, 'disabled', true)
-      // })
+      this.option.column.map(e => {
+        this.$set(e, 'disabled', true)
+      })
+      this.queryData(this.detailData.id);
+    } else if (this.detailData.auditId) {
+      this.checker = true;
+      this.batchNo = this.detailData.check.batchNo
       this.queryData(this.detailData.id);
     }
   },
@@ -525,6 +602,12 @@ export default {
         this.oldForm = {...this.form};
         this.oldDataList = [...this.dataList];
         delete this.form.orderItemsList;
+        this.checkDisabled = this.form.status > 0? true: false;
+        if (this.form.status > 0) {
+          this.option.column.map(e => {
+            this.$set(e, 'disabled', true)
+          })
+        }
       }).finally(() => {
         this.pageLoading = false;
       })
@@ -534,7 +617,16 @@ export default {
       this.$emit("goBack");
     },
     // 编辑按钮触发
-    openEdit() {},
+    openEdit() {
+      this.disabled = false;
+      this.option.column.map(e => {
+        if (this.checkDisabled) {
+          this.$set(e, 'disabled', true)
+        } else {
+          this.$set(e, 'disabled', false)
+        }
+      })
+    },
     // 复制
     copyDoc() {
       this.$emit("copyOrder", this.form.id);
@@ -545,7 +637,7 @@ export default {
         done();
         if (valid) {
           this.btnLoading = true;
-          this.form.billType = 'CG';
+          this.form.billType = 'OCG';
           this.form.tradeType = 'OCG';
           this.$set(this.form, 'orderItemsList', this.dataList);
           typeSave(this.form).then(res => {
@@ -826,7 +918,7 @@ export default {
       if (this.verification()) {
         const data = {
           id : this.form.id,
-          checkType: 'bgyp',
+          checkType: 'ocg',
           url: '/workManagement/purchaseApply/index',
           pageStatus:"this.$store.getters.officePurchaseStatus",
           pageLabel:"采购申请",
@@ -857,9 +949,21 @@ export default {
           return false;   //取消改动数据
         })
       } else {
-        return false;
+        return true;
       }
     },
+    //打开审核
+    openCheckDialog(){
+      this.checkData  = this.detailData.check
+      this.checkDialog = true;
+    },
+    //关闭审核
+    choceCheckFun(){
+      this.checkDialog = false;
+    },
+    choceScheduleFun(){
+      this.checkScheduleDialog = false
+    },
   },
 }
 </script>

+ 13 - 1
src/views/workManagement/purchaseApply/index.vue

@@ -119,6 +119,18 @@ export default {
       this.option.searchMenuPosition = "right";
     }
   },
+  activated() {
+    if (this.$route.query.check) {
+      this.show = true
+      this.detailData = {
+        id: this.$route.query.check.billId,
+        check: this.$route.query.check,
+        auditId: this.$route.query.check.id,
+      };
+      this.show = false;
+      this.$store.commit("OFFICEPUR_IN_DETAIL");
+    }
+  },
   filters: {
     userFormat(row, userList) {
       let name;
@@ -213,7 +225,7 @@ export default {
       this.selection = list;
     },
     goBack() {
-      if (this.$route.query.id) {
+      if (this.$route.query) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
         this.$router.push({
           path: "/workManagement/purchaseApply/index"

+ 3 - 3
src/views/workManagement/requisition/config/customerContact.json

@@ -80,12 +80,12 @@
       "label": "库区",
       "prop": "storageId",
       "index": 8,
-      "width": 100,
+      "width": 200,
       "overHidden": true
     },
     {
       "label": "制单人",
-      "prop": "createUser",
+      "prop": "createUserName",
       "index": 9,
       "width": 100,
       "overHidden": true
@@ -99,7 +99,7 @@
     },
     {
       "label": "更新人",
-      "prop": "updateUser",
+      "prop": "updateUserName",
       "index": 11,
       "width": 100,
       "overHidden": true

+ 3 - 3
src/views/workManagement/requisition/config/mainList.json

@@ -21,7 +21,7 @@
   "column": [
     {
       "label": "领用人",
-      "prop": "createUser",
+      "prop": "applyUserName",
       "search": true,
       "index": 1,
       "minWidth": 80,
@@ -29,14 +29,14 @@
     },
     {
       "label": "部门",
-      "prop": "a",
+      "prop": "applyDeptName",
       "overHidden": true,
       "minWidth": 100,
       "search": false
     },
     {
       "label": "领用时间",
-      "prop": "createTime",
+      "prop": "applyTime",
       "type": "date",
       "overHidden": true,
       "minWidth": 200,

+ 241 - 28
src/views/workManagement/requisition/detail.vue

@@ -12,12 +12,35 @@
       </div>
       <div class="add-customer-btn">
         <el-button
+          v-if="disabled"
           type="primary"
           size="small"
           class="el-button--small-yh"
           @click.stop="openEdit"
         >编 辑</el-button>
         <el-button
+          v-if="checker && form.status != 3"
+          type="primary"
+          size="small"
+          class="el-button--small-yh"
+          @click.stop="openCheckDialog">
+          审批
+        </el-button>
+        <el-button
+          v-if="form.status > 0"
+          @click.native="checkScheduleDialog = true, checkId=form.id"
+          type="primary"
+          size="small"
+        >审核进度</el-button>
+        <el-button
+          type="primary"
+          v-if="!checkDisabled"
+          :disabled="!form.id || disabled"
+          size="small"
+          @click="pleaseCheck"
+          :loading="btnLoading"
+        >请核</el-button>
+        <el-button
           type="success"
           :disabled="!form.id"
           size="small"
@@ -41,31 +64,33 @@
           v-model="form"
           :option="option"
         >
-          <template slot="createUser">
+          <template slot="applyUser">
             <el-select
-              v-model="form.createUser"
+              v-model="form.applyUser"
               filterable
               clearable
               size="small"
+              :disabled="disabled || checkDisabled"
             >
               <el-option
                 v-for="(item,index) in userList"
                 :key="index"
                 :label="item.realName"
-                :value="item.realName"
+                :value="item.id"
               ></el-option>
             </el-select>
           </template>
-          <template slot="deptId">
+          <template slot="applyDept">
             <avue-input-tree
               leaf-only
               style="width: 100%;"
               size="small"
               :props="{ label: 'title' }"
-              v-model="form.deptId"
+              v-model="form.applyDept"
               placeholder=" "
               type="tree"
               :dic="dic"
+              :disabled="disabled || checkDisabled"
             ></avue-input-tree>
           </template>
         </avue-form>
@@ -86,6 +111,7 @@
               icon="el-icon-plus"
               size="small"
               @click.stop="newDetails"
+              :disabled="disabled || checkDisabled"
             >录入明细</el-button>
             <el-button
               type="info"
@@ -99,12 +125,14 @@
               icon="el-icon-edit"
               type="text"
               @click="rowCell(row, index)"
+              :disabled="disabled || checkDisabled"
             >{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
             <el-button
               size="small"
               icon="el-icon-delete"
               type="text"
               @click="rowDel(row, index)"
+              :disabled="disabled || checkDisabled"
             >删除</el-button>
           </template>
           <template slot="code" slot-scope="{ row, index }">
@@ -207,6 +235,22 @@
           <template slot="storageQuantity" slot-scope="{ row, index }">
             <span>{{ row.storageQuantity | IntegerFormat }}</span>
           </template>
+          <template slot="storageId" slot-scope="{ row, index }">
+            <el-select
+              v-if="row.$cellEdit"
+              v-model="row.storageId"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="(item, index) in storageOptions"
+                :key="index"
+                :value="item.id"
+                :label="item.cname"
+              ></el-option>
+            </el-select>
+            <span v-else>{{ row.storageName }}</span>
+          </template>
           <template slot="remarks" slot-scope="{ row, index }">
             <el-input
               v-if="row.$cellEdit"
@@ -304,6 +348,43 @@
         >
       </span>
     </el-dialog>
+    <el-dialog
+      append-to-body
+      title="审批"
+      class="el-dialogDeep"
+      :visible.sync="checkDialog"
+      width="50%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <check
+        :checkData="checkData"
+        :checkDetail="false"
+        :idList="[]"
+        @choceCheckFun="choceCheckFun"
+      >
+      </check>
+    </el-dialog>
+    <el-dialog
+      append-to-body
+      title="审批进度"
+      class="el-dialogDeep"
+      :visible.sync="checkScheduleDialog"
+      width="40%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      v-dialog-drag
+    >
+      <check-schedule
+        :checkId="checkId"
+        :batchNo="batchNo"
+        @choceScheduleFun="choceScheduleFun"
+      >
+      </check-schedule>
+    </el-dialog>
   </div>
 </template>
 
@@ -322,11 +403,26 @@ import { gainUser } from "@/api/basicData/customerInquiry";
 import {getUserInfo} from "@/api/system/user";
 import {getDeptTree} from "@/api/system/dept";
 import { getCurrentDate } from "@/util/date";
+import {dataDetail, typeSave, removeGoods, pleaseCheck} from "@/api/officeSupplies/requisition";
+import { contrastObj, contrastList } from "@/util/contrastData";
+import check from "@/components/check/check";
+import checkSchedule from "@/components/check/checkSchedule";
+import {customerList as storageList} from "@/api/basicData/basicStorageDesc";
 
 export default {
   name: "detail",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
+  components: {
+    check,
+    checkSchedule,
+  },
   data() {
     return {
+      disabled: false,
       pageLoading: false,
       btnLoading: false,
       form: {},
@@ -336,7 +432,7 @@ export default {
         column: [
           {
             label: "领用人",
-            prop: "createUser",
+            prop: "applyUser",
             rules: [
               {
                 required: true,
@@ -349,7 +445,7 @@ export default {
           },
           {
             label: "部门",
-            prop: "deptId",
+            prop: "applyDept",
             rules: [
               {
                 required: true,
@@ -362,7 +458,7 @@ export default {
           },
           {
             label: "领用时间",
-            prop: "b",
+            prop: "applyTime",
             span: 8,
             type: "date",
             format: "yyyy-MM-dd",
@@ -446,6 +542,16 @@ export default {
         total: 0
       },
       dic: [],
+      oldForm: {},
+      oldDataList: [],
+      checkDisabled: false, // 审核状态
+      checker: false,
+      checkId: '',
+      batchNo:'',
+      checkDialog: false,
+      checkScheduleDialog: false,
+      checkData: {},
+      storageOptions: [],
     }
   },
   async created() {
@@ -457,23 +563,46 @@ export default {
       this.getColumnName(93),
       goodsOption
     );
-    getGoods(1, 500).then(res => {
-      this.goodsoptions = res.data.data.records;
+    getGoods(1, 10).then(res => {
+      if (res.data.data.total > 0) {
+        this.goodsoptions = res.data.data.records;
+        if (Math.ceil(res.data.data.total / 10) > 1) {
+          for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
+            getGoods(i, 10).then(e => {
+              this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
+            });
+          }
+        }
+      }
     });
     gainUser().then(res => {
       this.userList = res.data.data;
     });
     getUserInfo().then(res => {
-      this.$set(this.form, 'createUser', res.data.data.realName);
-      this.$set(this.form, 'deptId', res.data.data.deptId);
+      this.$set(this.form, 'applyUser', res.data.data.id);
+      this.$set(this.form, 'applyDept', res.data.data.deptId);
     })
     getDeptTree().then(res => {
       this.dic = res.data.data
     })
+    storageList().then(res => {
+      this.storageOptions = res.data.data.records;
+    })
     this.getWorkDicts('unit').then(res => {
       this.unitOption = res.data.data;
     })
-    this.$set(this.form, 'b', getCurrentDate()); // 默认当前日期
+    this.$set(this.form, 'applyTime', getCurrentDate()); // 默认当前日期
+    if (this.detailData.query) {
+      this.disabled = true;
+      this.option.column.map(e => {
+        this.$set(e, 'disabled', true)
+      })
+      this.queryData(this.detailData.id);
+    } else if (this.detailData.auditId) {
+      this.checker = true;
+      this.batchNo = this.detailData.check.batchNo
+      this.queryData(this.detailData.id);
+    }
   },
   filters: {
     IntegerFormat(num) {
@@ -484,12 +613,40 @@ export default {
     }
   },
   methods: {
+    // 查询
+    queryData(id) {
+      this.pageLoading = true;
+      dataDetail(id).then(res => {
+        this.form = res.data.data;
+        this.dataList = this.form.orderItemsList? this.form.orderItemsList: [];
+        this.oldForm = {...this.form};
+        this.oldDataList = [...this.dataList];
+        delete this.form.orderItemsList;
+        this.checkDisabled = this.form.status > 0? true: false;
+        if (this.form.status > 0) {
+          this.option.column.map(e => {
+            this.$set(e, 'disabled', true)
+          })
+        }
+      }).finally(() => {
+        this.pageLoading = false;
+      })
+    },
     //返回列表
     backToList() {
       this.$emit("goBack");
     },
     // 编辑按钮触发
-    openEdit() {},
+    openEdit() {
+      this.disabled = false;
+      this.option.column.map(e => {
+        if (this.checkDisabled) {
+          this.$set(e, 'disabled', true)
+        } else {
+          this.$set(e, 'disabled', false)
+        }
+      })
+    },
     // 复制
     copyDoc() {
       this.$emit("copyOrder", this.form.id);
@@ -499,13 +656,16 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
-          // this.btnLoading = true;
-          // typeSave(this.form).then(res => {
-          //   this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
-          //   this.queryData(res.data.data.id);
-          // }).finally(() => {
-          //   this.btnLoading = false;
-          // })
+          this.btnLoading = true;
+          this.form.billType = 'OLY';
+          this.form.tradeType = 'OLY';
+          this.$set(this.form, 'orderItemsList', this.dataList);
+          typeSave(this.form).then(res => {
+            this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
+            this.queryData(res.data.data);
+          }).finally(() => {
+            this.btnLoading = false;
+          })
         } else {
           return false
         }
@@ -567,13 +727,13 @@ export default {
         type: "warning"
       }).then(() => {
         if (row.id) {
-          // removeGoods(row.id).then(res => {
-          //   this.$message({
-          //     type: 'success',
-          //     message: '删除成功!'
-          //   })
-          //   this.dataList.splice(row.$index, 1);
-          // })
+          removeGoods(row.id).then(res => {
+            this.$message({
+              type: 'success',
+              message: '删除成功!'
+            })
+            this.dataList.splice(row.$index, 1);
+          })
         } else {
           this.$message({
             type: "success",
@@ -751,6 +911,7 @@ export default {
               price: e.price,
               amount: 0,
               orderQuantity: 0,
+              storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
               $cellEdit: true
             });
           });
@@ -766,6 +927,7 @@ export default {
               amount: 0,
               orderQuantity: 0,
               price: e.price,
+              storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
               $cellEdit: true
             });
           });
@@ -773,6 +935,57 @@ export default {
       }
       this.dialogVisible = false;
     },
+    // 验证新旧值对比
+    verification() {
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.dataList, this.oldDataList)) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer();
+        }).catch(() => {
+          return false;   //取消改动数据
+        })
+      } else {
+        return true;
+      }
+    },
+    //打开审核
+    openCheckDialog(){
+      this.checkData  = this.detailData.check
+      this.checkDialog = true;
+    },
+    //关闭审核
+    choceCheckFun(){
+      this.checkDialog = false;
+    },
+    choceScheduleFun(){
+      this.checkScheduleDialog = false
+    },
+    // 请核
+    pleaseCheck() {
+      if (this.verification()) {
+        const data = {
+          id : this.form.id,
+          checkType: 'oly',
+          url: '/workManagement/requisition/index',
+          pageStatus:"this.$store.getters.officeLyStatus",
+          pageLabel:"领用",
+          checkFlag: 2,
+        }
+        this.btnLoading = true;
+        pleaseCheck(data).then(res => {
+          this.$message.success('请核成功')
+          this.queryData(this.form.id)
+        }).catch(() => {
+          this.$message.error('请核失败')
+        }).finally(() => {
+          this.btnLoading = false;
+        })
+      }
+    },
   },
 }
 </script>

+ 90 - 14
src/views/workManagement/requisition/index.vue

@@ -45,6 +45,24 @@
           >删除
           </el-button>
         </template>
+        <template slot="applyUserNameSearch">
+          <el-select
+            v-model="search.applyUser"
+            filterable
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="(item,index) in userList"
+              :key="index"
+              :label="item.realName"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </template>
+        <template slot="applyUserName" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.applyUserName }}</span>
+        </template>
       </avue-crud>
     </basic-container>
     <detail-page
@@ -59,6 +77,8 @@
 <script>
 import option from "./config/mainList.json";
 import detailPage from "./detail";
+import { gainUser } from "@/api/basicData/customerInquiry";
+import {getList, deleteList} from "@/api/officeSupplies/requisition";
 
 export default {
   name: "index",
@@ -81,10 +101,35 @@ export default {
       loading: false,
       selection: [],
       detailData: {},
+      userList: [],
     }
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(94), option);
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    gainUser().then(res => {
+      this.userList = res.data.data;
+    });
+    if (i % 3 !== 0){
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
+  activated() {
+    if (this.$route.query.check) {
+      this.show = true
+      this.detailData = {
+        id: this.$route.query.check.billId,
+        check: this.$route.query.check,
+        auditId: this.$route.query.check.id,
+      };
+      this.show = false;
+      this.$store.commit("OFFICELY_IN_DETAIL");
+    }
   },
   methods: {
     searchCriteriaSwitch(type) {
@@ -97,6 +142,7 @@ export default {
     },
     newAdd() {
       this.show = false;
+      this.$store.commit("OFFICELY_IN_DETAIL");
     },
     onLoad(page, params) {
       // 重置掉展开
@@ -106,18 +152,19 @@ export default {
       let queryParams = Object.assign({}, params, {
         size: page.pageSize,
         current: page.currentPage,
+        tradeType: 'OLY',
+      })
+      this.loading = true;
+      getList(queryParams).then(res => {
+        this.dataList = res.data.data.records;
+        this.page.total = res.data.data.total;
+        this.option.height = window.innerHeight - 240;
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+      }).finally(() => {
+        this.loading = false;
       })
-      // this.loading = true;
-      // getSalesList(queryParams).then(res => {
-      //   this.dataList = res.data.data.records;
-      //   this.page.total = res.data.data.total;
-      //   this.option.height = window.innerHeight - 240;
-      //   this.$nextTick(() => {
-      //     this.$refs.crud.doLayout()
-      //   })
-      // }).finally(() => {
-      //   this.loading = false;
-      // })
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(
@@ -162,15 +209,16 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
-    copyDoc() {},
+    copyDoc() {
+    },
     selectionChange(list) {
       this.selection = list;
     },
     goBack() {
-      if (this.$route.query.id) {
+      if (this.$route.query) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
         this.$router.push({
-          path: "/dealer/sales/index"
+          path: "/workManagement/requisition/index"
         });
       }
       this.detailData = this.$options.data().detailData;
@@ -186,6 +234,34 @@ export default {
       this.$nextTick(() => {
         this.show = false;
       });
+      this.$store.commit("OFFICELY_IN_DETAIL");
+    },
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(res => {
+        return deleteList(row.id)
+      }).then(() => {
+        this.dataList.splice(row.$index, 1)
+        this.$message({
+          type: "success",
+          message: "删除成功!"
+        });
+        this.page.currentPage = 1;
+        this.onLoad(this.page)
+      })
+    },
+    // 详情打开
+    beforeOpenPage(row, index) {
+      this.show = false;
+      this.detailData = {
+        id: row.id,
+        query: true, // 表示只是查询
+      };
+      this.$store.commit("OFFICELY_IN_DETAIL");
     },
   },
 }

+ 31 - 18
src/views/workManagement/stock/config/mainList.json

@@ -1,4 +1,5 @@
 {
+  "searchMenuSpan": 8,
   "stripe": true,
   "height": "auto",
   "searchShow": true,
@@ -18,14 +19,34 @@
   "searchSpan": 8,
   "showSummary": true,
   "summaryText": "合计",
-  "expand": true,
+  "expand": false,
   "expandWidth": 38,
   "sumColumnList": [
+    {
+      "name": "inQuantity",
+      "type": "sum",
+      "decimals": 0
+    },
+    {
+      "name": "outQuantity",
+      "type": "sum",
+      "decimals": 0
+    },
+    {
+      "name": "balanceQuantity",
+      "type": "sum",
+      "decimals": 0
+    },
+    {
+      "name": "amount",
+      "type": "sum",
+      "decimals": 2
+    }
   ],
   "column": [
     {
-      "label": "日期",
-      "prop": "date",
+      "label": "入库日期",
+      "prop": "inDate",
       "index": 1,
       "minWidth": 80,
       "overHidden": true,
@@ -54,7 +75,7 @@
     },
     {
       "label": "期初",
-      "prop": "cname",
+      "prop": "opening",
       "search": false,
       "index": 4,
       "minWidth": 80,
@@ -62,7 +83,7 @@
     },
     {
       "label": "入库",
-      "prop": "cname",
+      "prop": "inQuantity",
       "search": false,
       "index": 5,
       "minWidth": 80,
@@ -70,7 +91,7 @@
     },
     {
       "label": "出库",
-      "prop": "cname",
+      "prop": "outQuantity",
       "search": false,
       "index": 6,
       "minWidth": 80,
@@ -78,25 +99,17 @@
     },
     {
       "label": "结余",
-      "prop": "cname",
+      "prop": "balanceQuantity",
       "search": false,
       "index": 7,
       "minWidth": 80,
       "overHidden": true
     },
     {
-      "label": "数量",
-      "prop": "cname",
-      "search": false,
-      "index": 8,
-      "minWidth": 80,
-      "overHidden": true
-    },
-    {
       "label": "单价",
-      "prop": "price",
+      "prop": "unitPrice",
       "search": false,
-      "index": 9,
+      "index": 8,
       "minWidth": 80,
       "overHidden": true
     },
@@ -104,7 +117,7 @@
       "label": "金额",
       "prop": "amount",
       "search": false,
-      "index": 10,
+      "index": 9,
       "minWidth": 80,
       "overHidden": true
     }

+ 28 - 19
src/views/workManagement/stock/index.vue

@@ -22,7 +22,7 @@
       >
         <template slot="cnameSearch">
           <el-select
-            v-model="search.itemId"
+            v-model="search.goodsId"
             filterable
             clearable
             remote
@@ -45,6 +45,7 @@
 <script>
 import option from "./config/mainList.json";
 import {getList as goodsSelect} from "@/api/basicData/commodityType";
+import {getStockList} from "@/api/officeSupplies/stock";
 
 export default {
   name: "index",
@@ -69,7 +70,6 @@ export default {
   async created() {
     this.option = await this.getColumnData(this.getColumnName(105), option);
     goodsSelect(1, 10).then(res => {
-      // console.log(res.data.data.records)
       this.goodsOption = res.data.data.records;
     })
     let i = 0;
@@ -84,12 +84,12 @@ export default {
   },
   methods: {
     searchCriteriaSwitch(type) {
-      // if (type){
-      //   this.option.height =  this.option.height - 90
-      // }else {
-      //   this.option.height =  this.option.height + 90
-      // }
-      // this.$refs.crud.getTableHeight()
+      if (type){
+        this.option.height =  this.option.height - 90
+      }else {
+        this.option.height =  this.option.height + 90
+      }
+      this.$refs.crud.getTableHeight()
     },
     newAdd() {
       this.show = false;
@@ -102,18 +102,27 @@ export default {
       let queryParams = Object.assign({}, params, {
         size: page.pageSize,
         current: page.currentPage,
+        tradeType: 'BGYP',
+      })
+      if (queryParams.inDate && queryParams.inDate.length > 0) {
+        queryParams = {
+          ...queryParams,
+          beginInDate: queryParams.inDate[0],
+          endInDate: queryParams.inDate[1],
+        }
+      }
+      delete queryParams.inDate;
+      this.loading = true;
+      getStockList(queryParams).then(res => {
+        this.dataList = res.data.data.records;
+        this.page.total = res.data.data.total;
+        this.option.height = window.innerHeight - 240;
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+      }).finally(() => {
+        this.loading = false;
       })
-      // this.loading = true;
-      // getSalesList(queryParams).then(res => {
-      //   this.dataList = res.data.data.records;
-      //   this.page.total = res.data.data.total;
-      //   this.option.height = window.innerHeight - 240;
-      //   this.$nextTick(() => {
-      //     this.$refs.crud.doLayout()
-      //   })
-      // }).finally(() => {
-      //   this.loading = false;
-      // })
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(

+ 3 - 3
src/views/workManagement/warehousing/config/customerContact.json

@@ -80,12 +80,12 @@
       "label": "库区",
       "prop": "storageId",
       "index": 8,
-      "width": 100,
+      "width": 200,
       "overHidden": true
     },
     {
       "label": "制单人",
-      "prop": "createUser",
+      "prop": "createUserName",
       "index": 9,
       "width": 100,
       "overHidden": true
@@ -99,7 +99,7 @@
     },
     {
       "label": "更新人",
-      "prop": "updateUser",
+      "prop": "updateUserName",
       "index": 11,
       "width": 100,
       "overHidden": true

+ 2 - 2
src/views/workManagement/warehousing/config/mainList.json

@@ -9,7 +9,7 @@
   "delBtn": false,
   "addBtn": false,
   "align": "center",
-  "menuWidth": "70",
+  "menuWidth": "130",
   "searchIcon": true,
   "searchIndex": 2,
   "selection": true,
@@ -29,7 +29,7 @@
     },
     {
       "label": "部门",
-      "prop": "stockDept",
+      "prop": "stockDeptName",
       "overHidden": true,
       "minWidth": 100,
       "search": false

+ 106 - 7
src/views/workManagement/warehousing/detail.vue

@@ -12,12 +12,31 @@
       </div>
       <div class="add-customer-btn">
         <el-button
+          v-if="disabled"
           type="primary"
           size="small"
           class="el-button--small-yh"
           @click.stop="openEdit"
         >编 辑</el-button>
         <el-button
+          v-if="form.status < 4"
+          type="primary"
+          size="small"
+          icon="el-icon-folder-add"
+          @click="confirmReceipt"
+          :loading="btnLoading"
+          :disabled="disabled"
+        >确认入库</el-button>
+        <el-button
+          v-else
+          type="primary"
+          size="small"
+          icon="el-icon-folder-remove"
+          @click="cancelReceipt"
+          :loading="btnLoading"
+          :disabled="disabled"
+        >撤销入库</el-button>
+        <el-button
           type="success"
           :disabled="!form.id"
           size="small"
@@ -29,6 +48,7 @@
           @click="editCustomer"
           size="small"
           :loading="btnLoading"
+          :disabled="disabled || confirmDisabled"
         >保存数据</el-button>
       </div>
     </div>
@@ -47,6 +67,7 @@
               filterable
               clearable
               size="small"
+              :disabled="disabled || confirmDisabled"
             >
               <el-option
                 v-for="(item,index) in userList"
@@ -66,6 +87,7 @@
               placeholder=" "
               type="tree"
               :dic="dic"
+              :disabled="disabled || confirmDisabled"
             ></avue-input-tree>
           </template>
         </avue-form>
@@ -86,6 +108,7 @@
               icon="el-icon-plus"
               size="small"
               @click.stop="newDetails"
+              :disabled="disabled || confirmDisabled"
             >录入明细</el-button>
             <el-button
               type="info"
@@ -99,12 +122,14 @@
               icon="el-icon-edit"
               type="text"
               @click="rowCell(row, index)"
+              :disabled="disabled || confirmDisabled"
             >{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
             <el-button
               size="small"
               icon="el-icon-delete"
               type="text"
               @click="rowDel(row, index)"
+              :disabled="disabled || confirmDisabled"
             >删除</el-button>
           </template>
           <template slot="code" slot-scope="{ row, index }">
@@ -207,6 +232,22 @@
           <template slot="storageQuantity" slot-scope="{ row, index }">
             <span>{{ row.storageQuantity | IntegerFormat }}</span>
           </template>
+          <template slot="storageId" slot-scope="{ row, index }">
+            <el-select
+              v-if="row.$cellEdit"
+              v-model="row.storageId"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="(item, index) in storageOptions"
+                :key="index"
+                :value="item.id"
+                :label="item.cname"
+              ></el-option>
+            </el-select>
+            <span v-else>{{ row.storageName }}</span>
+          </template>
           <template slot="remarks" slot-scope="{ row, index }">
             <el-input
               v-if="row.$cellEdit"
@@ -322,13 +363,24 @@ import { gainUser } from "@/api/basicData/customerInquiry";
 import {getUserInfo} from "@/api/system/user";
 import {getDeptTree} from "@/api/system/dept";
 import { getCurrentDate } from "@/util/date";
-import {dataDetail, typeSave, removeGoods} from "@/api/officeSupplies/warehousing";
+import {dataDetail,
+  typeSave,
+  removeGoods,
+  confirmReceipt,
+  cancelReceipt,} from "@/api/officeSupplies/warehousing";
 import { contrastObj, contrastList } from "@/util/contrastData";
+import {customerList as storageList} from "@/api/basicData/basicStorageDesc";
 
 export default {
   name: "detail",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   data() {
     return {
+      disabled: false,
       pageLoading: false,
       btnLoading: false,
       form: {},
@@ -450,6 +502,8 @@ export default {
       dic: [],
       oldForm: {},
       oldDataList: [],
+      confirmDisabled: false, // 确认禁用
+      storageOptions: [],
     }
   },
   async created() {
@@ -479,15 +533,18 @@ export default {
     getDeptTree().then(res => {
       this.dic = res.data.data
     })
+    storageList().then(res => {
+      this.storageOptions = res.data.data.records;
+    })
     this.getWorkDicts('unit').then(res => {
       this.unitOption = res.data.data;
     })
 
     if (this.detailData.query) {
       this.disabled = true;
-      // this.option.column.map(e => {
-      //   this.$set(e, 'disabled', true)
-      // })
+      this.option.column.map(e => {
+        this.$set(e, 'disabled', true)
+      })
       this.queryData(this.detailData.id);
     }
   },
@@ -504,6 +561,7 @@ export default {
     queryData(id) {
       this.pageLoading = true;
       dataDetail(id).then(res => {
+        res.data.data.stockDept = !res.data.data.stockDept? '': res.data.data.stockDept
         this.form = res.data.data;
         this.dataList = this.form.orderItemsList? this.form.orderItemsList: [];
         this.oldForm = {...this.form};
@@ -516,6 +574,12 @@ export default {
           })
           this.$set(this.form, 'stockTime', getCurrentDate()); // 默认当前日期
         }
+        this.confirmDisabled = this.form.status == 4? true: false;
+        if (this.form.status == 4) {
+          this.option.column.map(e => {
+            this.$set(e, 'disabled', true)
+          })
+        }
       }).finally(() => {
         this.pageLoading = false;
       })
@@ -525,7 +589,16 @@ export default {
       this.$emit("goBack");
     },
     // 编辑按钮触发
-    openEdit() {},
+    openEdit() {
+      this.disabled = false;
+      this.option.column.map(e => {
+        if (this.confirmDisabled) {
+          this.$set(e, 'disabled', true)
+        } else {
+          this.$set(e, 'disabled', false)
+        }
+      })
+    },
     // 复制
     copyDoc() {
       this.$emit("copyOrder", this.form.id);
@@ -541,7 +614,7 @@ export default {
           this.$set(this.form, 'orderItemsList', this.dataList);
           typeSave(this.form).then(res => {
             this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
-            this.queryData(res.data.data.id);
+            this.queryData(res.data.data);
           }).finally(() => {
             this.btnLoading = false;
           })
@@ -790,6 +863,7 @@ export default {
               price: e.price,
               amount: 0,
               orderQuantity: 0,
+              storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
               $cellEdit: true
             });
           });
@@ -805,6 +879,7 @@ export default {
               amount: 0,
               orderQuantity: 0,
               price: e.price,
+              storageId: this.storageOptions.length > 0? this.storageOptions[0].id: null,
               $cellEdit: true
             });
           });
@@ -826,9 +901,33 @@ export default {
           return false;   //取消改动数据
         })
       } else {
-        return false;
+        return true;
+      }
+    },
+    // 确认入库
+    confirmReceipt() {
+      if (this.verification()) {
+        this.$set(this.form, 'orderItemsList', this.dataList);
+        this.btnLoading = true;
+        confirmReceipt(this.form).then(res => {
+          this.$message.success('入库成功!')
+          this.queryData(this.form.id);
+        }).finally(() => {
+          this.btnLoading = false;
+        })
       }
     },
+    // 撤销入库
+    cancelReceipt() {
+      this.$set(this.form, 'orderItemsList', this.dataList);
+      this.btnLoading = true;
+      cancelReceipt(this.form).then(res => {
+        this.$message.success('撤销成功!')
+        this.queryData(this.form.id);
+      }).finally(() => {
+        this.btnLoading = false;
+      })
+    },
   },
 }
 </script>

+ 38 - 19
src/views/workManagement/warehousing/index.vue

@@ -20,31 +20,37 @@
         @saveColumn="saveColumn"
         @resetColumn="resetColumn"
       >
-        <template slot="menuLeft">
-<!--          <el-button-->
-<!--            type="primary"-->
-<!--            icon="el-icon-plus"-->
-<!--            size="small"-->
-<!--            @click.stop="newAdd()"-->
-<!--          >创建单据</el-button>-->
-<!--          <el-button-->
-<!--            type="success"-->
-<!--            size="small"-->
-<!--            icon="el-icon-plus"-->
-<!--            @click.stop="copyDoc()"-->
-<!--            :disabled="selection.length != 1"-->
-<!--          >复制单据</el-button>-->
-        </template>
         <template slot-scope="scope" slot="menu">
           <el-button
             type="text"
+            icon="el-icon-edit"
+            size="small"
+            @click.stop="beforeOpenPage(scope.row, scope.index)"
+          >查看</el-button>
+          <el-button
+            type="text"
             icon="el-icon-delete"
             size="small"
             @click.stop="rowDel(scope.row, scope.index)"
-            :disabled="scope.row.status == 3"
+            :disabled="scope.row.status == 4"
           >删除
           </el-button>
         </template>
+        <template slot="stockUserNameSearch">
+          <el-select
+            v-model="search.stockUser"
+            filterable
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="(item,index) in userList"
+              :key="index"
+              :label="item.realName"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </template>
       </avue-crud>
     </basic-container>
     <detail-page
@@ -60,6 +66,7 @@
 import option from "./config/mainList.json";
 import detailPage from "./detail";
 import {getList, deleteList} from "@/api/officeSupplies/warehousing";
+import { gainUser } from "@/api/basicData/customerInquiry";
 
 export default {
   name: "index",
@@ -82,10 +89,14 @@ export default {
       loading: false,
       selection: [],
       detailData: {},
+      userList: [],
     }
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(97), option);
+    gainUser().then(res => {
+      this.userList = res.data.data;
+    });
     let i = 0;
     this.option.column.forEach(item => {
       if (item.search) i++
@@ -156,7 +167,7 @@ export default {
       }
     },
     //点击搜索按钮触发
-    searchChanonLoadge(params, done) {
+    searchChange(params, done) {
       this.onLoad(this.page, params);
       done();
     },
@@ -178,10 +189,10 @@ export default {
       this.selection = list;
     },
     goBack() {
-      if (this.$route.query.id) {
+      if (this.$route.query) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
         this.$router.push({
-          path: "/dealer/sales/index"
+          path: "/workManagement/warehousing/index"
         });
       }
       this.detailData = this.$options.data().detailData;
@@ -216,6 +227,14 @@ export default {
         this.onLoad(this.page)
       })
     },
+    // 详情打开
+    beforeOpenPage(row, index) {
+      this.show = false;
+      this.detailData = {
+        id: row.id,
+        query: true, // 表示只是查询
+      };
+    },
   },
 }
 </script>