瀏覽代碼

Merge branch 'dev' into 'historical_route'

Dev

See merge request new-business/drp-web!476
黄梓星 1 年之前
父節點
當前提交
54fcf3ec9a
共有 39 個文件被更改,包括 3216 次插入480 次删除
  1. 12 3
      src/api/business/purchase/apply.js
  2. 9 0
      src/api/business/purchase/purchase-order.js
  3. 8 0
      src/api/canteen/basic.js
  4. 21 0
      src/api/purchase/transferOrder.js
  5. 8 0
      src/api/purchase/workSpace.js
  6. 11 2
      src/api/requisition/basic.js
  7. 121 0
      src/components/Refers/sigleTreeRefer.vue
  8. 80 63
      src/components/file-preview/index.vue
  9. 1 1
      src/components/popover-select-v2/index.vue
  10. 16 7
      src/components/popover-select/components/MATERIAL_PARAM.js
  11. 85 3
      src/components/popover-select/index.vue
  12. 2 2
      src/layout/components/Navbar.vue
  13. 2 2
      src/layout/index.vue
  14. 2 0
      src/store/modules/user.js
  15. 27 4
      src/views/canteen/menuScreen.vue
  16. 37 26
      src/views/material/basicFile/details.vue
  17. 59 0
      src/views/material/changeApply/add/column.js
  18. 84 0
      src/views/material/changeApply/add/index.vue
  19. 7 3
      src/views/material/requisition/add.vue
  20. 31 3
      src/views/material/requisition/index.vue
  21. 1 1
      src/views/purchase/DemandSummary/index.vue
  22. 25 12
      src/views/purchase/PurchaseDemandList/index.vue
  23. 5 0
      src/views/purchase/apply/columns.js
  24. 1 1
      src/views/purchase/apply/delete/index.vue
  25. 21 4
      src/views/purchase/apply/index.vue
  26. 1 1
      src/views/purchase/apply/submit/index.vue
  27. 1 1
      src/views/purchase/deliveryAddress/add.vue
  28. 0 23
      src/views/purchase/purchase-order/add/column copy.js
  29. 785 122
      src/views/purchase/purchase-order/add/column.js
  30. 1055 0
      src/views/purchase/purchase-order/add/columnCopy.js
  31. 176 83
      src/views/purchase/purchase-order/add/index.vue
  32. 169 79
      src/views/purchase/purchase-order/edit/index.vue
  33. 4 1
      src/views/purchase/purchase-order/edit/initColumn.js
  34. 33 6
      src/views/purchase/purchase-order/index.vue
  35. 4 2
      src/views/purchase/purchase-order/see/index.vue
  36. 7 13
      src/views/purchase/transferOrder/add.vue
  37. 88 3
      src/views/purchase/transferOrder/index.vue
  38. 209 7
      src/views/purchase/workSpace/index.vue
  39. 8 2
      vue.config.js

+ 12 - 3
src/api/business/purchase/apply.js

@@ -26,16 +26,17 @@ export function SAVE(data) {
 
 export function SUBMIT(data) {
   return request({
-    url: `/pu/priceApply/submit/${data}`,
+    url: `/pu/priceApply/submit`,
     method: "POST",
-    data: data,
+    data: {submitIds:data},
   });
 }
 
 export function REMOVE(data) {
   return request({
-    url: `/pu/priceApply/${data}`,
+    url: `/pu/priceApply/del`,
     method: "delete",
+    data: {submitIds:data},
   });
 }
 
@@ -57,3 +58,11 @@ export function failDownload(data) {
     responseType: 'blob'
   })
 }
+//收回
+export function oaBack(data) {
+  return request({
+    url: `/oaflow/rollback`,
+    method: "POST",
+    data: data,
+  });
+}

+ 9 - 0
src/api/business/purchase/purchase-order.js

@@ -180,6 +180,14 @@ const downloadFailData = (data) =>{
   });
 }
 
+//收回
+export function oaBack(data) {
+  return request({
+    url: `/oaflow/rollback`,
+    method: "POST",
+    data: data,
+  });
+}
 
 
 export default {
@@ -203,4 +211,5 @@ export default {
   orderExport,
   orderImport,
   downloadFailData,
+  oaBack
 }

+ 8 - 0
src/api/canteen/basic.js

@@ -47,4 +47,12 @@ export function delFood(ids) {
     method: 'DELETE',
     // data: data
   })
+}
+// 打卡人数数据
+export function dakaPeople(params) {
+  return request({
+    url: `/data-service-center/accessControl/getPeople`,
+    method: 'get',
+    params: params
+  })
 }

+ 21 - 0
src/api/purchase/transferOrder.js

@@ -68,4 +68,25 @@ export function listStAllotItem(pid) {
     url: `/pu/allot/material/byPid/${pid}`,
     method: 'get',
   })
+}
+
+//导入
+export function importData(data) {
+  return request({
+    url: `/pu/allot/importData`,
+    method: 'post',
+    data: data,
+    headers: {
+      'Content-Type': 'multipart/form-data'
+    }
+  })
+}
+
+//收回
+export function oaBack(data) {
+  return request({
+    url: `/oaflow/rollback`,
+    method: "POST",
+    data: data,
+  });
 }

+ 8 - 0
src/api/purchase/workSpace.js

@@ -23,4 +23,12 @@ export function rebacktWork(data) {
     method: 'post',
     data: data
   })
+}
+// 单据概述
+export function getWorkDetailList(data) {
+  return request({
+    url: `oaflow/detail?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    method: 'post',
+    data: data
+  })
 }

+ 11 - 2
src/api/requisition/basic.js

@@ -38,9 +38,9 @@ export function editReq(data) {
 // 物料申请单-修改提交
 export function betchSubmit(data) {
   return request({
-    url: `/system/apply/material/submit/${data}`,
+    url: `/system/apply/material/submit`,
     method: 'post',
-    // data: data
+    data: data,
   })
 }
 
@@ -159,3 +159,12 @@ export function toOA(userName, fdId) {
     method: 'get',
   })
 }
+
+//收回
+export function oaBack(data) {
+  return request({
+    url: `/oaflow/rollback`,
+    method: "POST",
+    data: data,
+  });
+}

+ 121 - 0
src/components/Refers/sigleTreeRefer.vue

@@ -0,0 +1,121 @@
+<template>
+  <div>
+    <el-dialog :title="reciveForm.title" width="500px" :close-on-click-modal="false" :append-to-body="true" v-dialogDrag
+      class="userDialog" :visible.sync="visible">
+      <el-container style="height: 500px">
+        <el-container>
+          <el-main>
+            <el-row :gutter="24" class="content">
+              <el-col :span="24">
+                <el-input placeholder="输入关键字进行过滤" size="small" v-model="filterText" style="margin-bottom: 16px">
+                </el-input>
+
+                <el-tree class="filter-tree" :data="threedata" :props="defaultProps" accordion node-key="id"
+                  highlight-current @node-click="clickTree" :filter-node-method="filterNode" ref="tree">
+                  <span slot-scope="{ node, data }">
+                    {{ data.code }}{{ data.name }}
+                  </span>
+                </el-tree>
+              </el-col>
+            </el-row>
+          </el-main>
+        </el-container>
+      </el-container>
+      <span slot="footer">
+        <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+        <el-button size="small" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getRefer } from '@/api/purchase/basic'
+export default {
+  data() {
+    return {
+      loading: false,
+      visible: false,
+      filterText: "",
+      threedata: [],
+      defaultProps: {
+        children: "children",
+        label: "name",
+      },
+      // 判断是否为最末级节点
+      // isLast: false,
+      // 选中的节点
+      choosePoint: {},
+      // 接收的参数
+      reciveForm: {},
+    };
+  },
+  props: {},
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+  methods: {
+    init(val) {
+      this.visible = true;
+      this.filterText = ''
+      this.reciveForm = val
+      this.$nextTick(() => {
+        this.refreshList();
+      });
+    },
+    // 获取数据列表
+    refreshList(data) {
+      this.loading = true;
+      let params = this.reciveForm
+      getRefer(params).then((res) => {
+        console.log("res", res);
+        if (res.code === 200) {
+          this.threedata = res.rows
+        }
+        this.loading = false;
+      });
+    },
+    clickTree(data) {
+      console.log("树形节点信息:", data);
+      this.choosePoint = data;
+      // console.log('查看打勾的',this.$refs.tree.getCheckedNodes())
+      // this.choosePoint = this.$refs.tree.getCheckedNodes()
+    },
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.name.indexOf(value) !== -1;
+    },
+    doSubmit() {
+      console.log("子组件选择的数据", this.choosePoint);
+      this.$emit("doSubmit", this.choosePoint);
+      this.visible = false;
+    },
+    loadNode(node, resolve) {
+      console.log("node, resolve", node, resolve);
+      // if (!node.data.length)
+      //   resolve(node.data.childrens.sort((a, b) => a.code - b.code));
+      // else resolve(this.threedata);
+    },
+  },
+};
+</script>
+<style lang="scss">
+.userDialog {
+  .el-dialog__body {
+    padding: 10px 0px 0px 10px;
+    color: #606266;
+    font-size: 14px;
+    word-break: break-all;
+  }
+
+  .el-main {
+    padding: 20px 20px 5px 20px;
+
+    .el-pagination {
+      margin-top: 5px;
+    }
+  }
+}
+</style>

+ 80 - 63
src/components/file-preview/index.vue

@@ -33,9 +33,18 @@
             <el-button
               :size="size"
               type="text"
-              icon="el-icon-download"
               @click="useDownload(item)"
-            ></el-button>
+            >
+               <el-link
+                 icon="el-icon-download"
+                 :href="`${baseUrl}${fileId}`"
+                 :underline="false"
+                 target="_blank"
+                 @click="useDownload(item)"
+               />
+            </el-button>
+
+
           </span>
         </div>
       </div>
@@ -45,73 +54,81 @@
 </template>
 
 <script>
-export default {
-  name: "FilePreview",
-  props: {
-    // 值
-    value: [String, Object, Array],
-    // 组件大小
-    size: {
-      type: String,
-      dafault: () => {
-        return "mini";
+  export default {
+    name: "FilePreview",
+    props: {
+      // 值
+      value: [String, Object, Array],
+      // 组件大小
+      size: {
+        type: String,
+        dafault: () => {
+          return "mini";
+        },
       },
     },
-  },
-  data() {
-    return {
-      separator: ";",
-      visible: false,
-      fileList: [],
-    };
-  },
-  computed: {},
-  watch: {
-    value: {
-      handler(val) {
-        if (val) {
-          let temp = 1;
-          // 首先将值转为数组
-          const list = Array.isArray(val)
-            ? val
-            : this.value.split(this.separator);
-          this.fileList = list.map((item) => {
-            item = JSON.parse(item);
-            return {
-              ...item,
-              uid: item.uid || new Date().getTime() + temp++,
-            };
-          });
-        } else {
-          this.fileList = [];
-          return [];
-        }
+    data() {
+      return {
+        baseUrl: "https://sy.derom.com/document-center/fastdfs/download?id=",
+        fileId: "",
+        separator: ";",
+        visible: false,
+        fileList: [],
+      };
+    },
+    computed: {},
+    watch: {
+      value: {
+        handler(val) {
+          if (val) {
+            let temp = 1;
+            // 首先将值转为数组
+            const list = Array.isArray(val)
+              ? val
+              : this.value.split(this.separator);
+            this.fileList = list.map((item) => {
+              item = JSON.parse(item);
+              return {
+                ...item,
+                uid: item.uid || new Date().getTime() + temp++,
+              };
+            });
+          } else {
+            this.fileList = [];
+            return [];
+          }
+        },
+        deep: true,
+        immediate: true,
       },
-      deep: true,
-      immediate: true,
     },
-  },
-  methods: {
-    //
-    useDownload(prop) {
-      const { url, name } = prop;
-      this.download("/pu/contract/download/resource", { resource: url }, name);
+    methods: {
+      //
+      useDownload(prop) {
+        const {url, name, id} = prop;
+        // this.download("/pu/contract/download/resource", {resource: url}, name);
+        this.fileId = id
+        // this.download("https://sy.derom.com/document-center/fastdfs/download", {id});
+      },
+      //
+      useView(prop) {
+        this.$notify.info({title: "暂不支持查看"});
+      },
+    },
+    created() {
     },
-    //
-    useView(prop) {
-      this.$notify.info({ title: "暂不支持查看" });
+    mounted() {
     },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
+    destroyed() {
+    },
+  };
 </script>
 <style scoped>
-.file-preview_content > div {
-  margin-bottom: 10px;
-}
-.file-preview_content > div:last-of-type {
-  margin-bottom: 0;
-}
+  .file-preview_content > div {
+    margin-bottom: 10px;
+  }
+
+  .file-preview_content > div:last-of-type {
+    margin-bottom: 0;
+  }
 </style>

+ 1 - 1
src/components/popover-select-v2/index.vue

@@ -170,7 +170,7 @@ export default {
     // auto
     async useAutocomplete(prop, cb) {
       if (prop) {
-        this.page.pageSize = 1000000;
+        this.page.pageSize = 10;
         this.model.search = prop;
         await this.fetchList(this.model, this.page);
         await cb(this.data);

+ 16 - 7
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -24,7 +24,7 @@ export default [
     attr: {
       type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.registrationNo;
+        return prop.materialMedcine != null ? prop.materialMedcine.registrationNo : null;
       },
     },
   },
@@ -42,7 +42,7 @@ export default [
     attr: {
       type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.isDrug == "0" ? "Y" : "N";
+        return prop.isDrug == "0" ? "Y" : "N";
       },
     },
   },
@@ -51,7 +51,7 @@ export default [
     attr: {
       type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.isDrug;
+        return prop.materialMedcine != null ? prop.materialMedcine.isDrug : null;
       },
     },
   },
@@ -72,7 +72,7 @@ export default [
     attr: {
       type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.dosageFrom;
+        return prop.materialMedcine != null ? prop.materialMedcine.dosageFrom : null;
       },
     },
   },
@@ -81,7 +81,7 @@ export default [
     attr: {
       type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.dosageFromName;
+        return prop.materialMedcine != null ? prop.materialMedcine.dosageFromName : null;
       },
     },
   },
@@ -90,7 +90,7 @@ export default [
     attr: {
       type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.curingType;
+        return prop.materialMedcine != null ? prop.materialMedcine.curingType : null;
       },
     },
   },
@@ -99,7 +99,16 @@ export default [
     attr: {
       type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.medicalInstruments;
+        return prop.materialMedcine != null ? prop.materialMedcine.medicalInstruments : null;
+      },
+    },
+  },
+  {
+    item: { key: "ratifyBatchNo", title: "批准文号", width: "auto" },
+    attr: {
+      type:'ComputedInput',
+      formatter: (prop) => {
+        return prop.materialMedcine != null ? prop.materialMedcine.ratifyBatchNo : null;
       },
     },
   },

+ 85 - 3
src/components/popover-select/index.vue

@@ -146,6 +146,22 @@ export default {
         });
         if (code === 200) {
           this.data = rows;
+          // 处理新增字段无法映射
+          let that = this;
+
+          this.TableColumnTemp.forEach(({item,attr}) =>{
+
+            that.data = that.data.map(d =>{
+
+              if(!attr.is && attr.formatter){
+                d[item.key] = attr.formatter(d);
+              }
+
+              return d;
+
+            })
+
+          })
           this.page.total = total;
         }
       } catch (err) {
@@ -180,11 +196,18 @@ export default {
     },
     // confirm
     useConfirm(prop) {
+      
       const { multiple } = this.$props;
+
+      this.selectData = [...prop];
+      console.log(this.selectData,'this.selectData');
+   
       this.useUpdate(multiple ? prop : prop[0]);
+
       this.emitChange(this.selectData);
       this.lastSelectData = deepCopy(this.selectData);
       this.hide();
+      
     },
     // delete
     useDelete(prop) {
@@ -232,6 +255,22 @@ export default {
         this.innerValue = "";
       }
     },
+    async useAutocomplete(prop, cb) {
+      if (prop) {
+        this.page.pageSize = 10;
+
+        this.model = {
+          ...this.model,
+          search:prop,
+          type:this.type,
+        }
+        // 
+        await this.fetchList(this.model, this.page);
+        await cb(this.data);
+      } else {
+        cb([]);
+      }
+    },
   },
   created() {
 
@@ -242,7 +281,40 @@ export default {
 </script>
 <template>
   <div class="popover-select">
-    <el-input
+    <el-autocomplete
+      clearable
+      v-bind="$attrs"
+      v-model="innerValue"
+      :value-key="valueKey"
+      :fetch-suggestions="useAutocomplete"
+      @select="useConfirm([$event])"
+      style="width: 100%"
+    >
+      <i class="el-icon-search" slot="suffix" @click="open"> </i>
+      <template slot-scope="{ item }">
+        <p
+          style="
+            text-overflow: ellipsis;
+            overflow: hidden;
+            line-height: 15px;
+            margin: 5px 0;
+          "
+        >
+          {{ item.name }}
+        </p>
+        <p
+          style="
+            font-size: 12px;
+            color: #b4b4b4;
+            line-height: 15px;
+            margin: 5px 0;
+          "
+        >
+          {{ item.code }}
+        </p>
+      </template>
+    </el-autocomplete>
+    <!-- <el-input
       v-model="innerValue"
       :size="size"
       :disabled="disabled"
@@ -257,7 +329,7 @@ export default {
         icon="el-icon-search"
         @click="open"
       ></el-button>
-    </el-input>
+    </el-input> -->
     <el-dialog
       :title="`${title}(${multiple ? '多选' : '单选'})`"
       :width="width"
@@ -383,4 +455,14 @@ export default {
     </div>
   </div>
 </template>
-<style scoped></style>
+<style scoped>
+.popover-select .el-autocomplete {
+  width: inherit;
+}
+.popover-select .el-autocomplete .el-icon-search {
+  cursor: pointer;
+}
+::v-deep .el-table--mini .el-table__cell {
+  height: 50px;
+}
+</style>

+ 2 - 2
src/layout/components/Navbar.vue

@@ -25,7 +25,7 @@
 
       </template>
 
-      <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
+      <!-- <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
         <div class="avatar-wrapper">
           <img :src="avatar" class="user-avatar">
           <i class="el-icon-caret-bottom" />
@@ -41,7 +41,7 @@
             <span>退出登录</span>
           </el-dropdown-item>
         </el-dropdown-menu>
-      </el-dropdown>
+      </el-dropdown> -->
     </div>
   </div>
 </template>

+ 2 - 2
src/layout/index.vue

@@ -10,11 +10,11 @@
         class="drawer-bg"
         @click="handleClickOutside"
       />
-      <sidebar v-if="dev" class="sidebar-container" />
+      <sidebar v-if="dev || this.$store.state.user.name == 'drp'" class="sidebar-container" />
       <div
         :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }"
         class="main-container"
-        :style="`margin-left:${dev ? '54':'0'}px`"
+        :style="`margin-left:${(dev || this.$store.state.user.name == 'drp') ? '54':'0'}px`"
       >
         <div :class="{ 'fixed-header': fixedHeader }">
           <!-- <navbar /> -->

+ 2 - 0
src/store/modules/user.js

@@ -1,5 +1,6 @@
 import { login, logout, getInfo } from '@/api/login'
 import { getToken, setToken, removeToken } from '@/utils/auth'
+import Cookies from 'js-cookie'
 
 const user = {
   state: {
@@ -78,6 +79,7 @@ const user = {
           const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
           if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
             commit('SET_ROLES', res.roles)
+            Cookies.set('roles',res.roles,{ expires: 30 });
             commit('SET_PERMISSIONS', res.permissions)
           } else {
             commit('SET_ROLES', ['ROLE_DEFAULT'])

+ 27 - 4
src/views/canteen/menuScreen.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="menuScreen">
+  <div id="menuScreen" style="position: relative;">
     <div class="title">德荣食堂</div>
     <div class="title2">
       <span>时段</span>
@@ -33,22 +33,27 @@
         </el-table>
       </div>
     </div>
+
+    <p class="people">{{nowDate}}园区打卡人数:{{ dakaNum }}人</p>
   </div>
 </template>
 
 <script>
-import { menuList } from '@/api/canteen/basic.js'
+import axios from 'axios'
+import { menuList, dakaPeople } from '@/api/canteen/basic.js'
 export default {
   data() {
     return {
       tableData: [],
       nowDate: '',
-      intervalId: null
+      intervalId: null,
+      dakaNum: ''
     }
   },
   created() {
     this.getList();
     this.dataRefreh()
+    this.getPeoples()
   },
   destroyed(){
     // 在页面销毁后,清除计时器
@@ -93,13 +98,24 @@ export default {
       this.intervalId = setInterval(() => {
         console.log("刷新" + new Date());
         this.getList(); //加载数据函数
-      }, 1000*60*10);
+        this.getPeoples() // 加载园区打卡人数
+      }, 1000*60*5);
     },
     // 停止定时器
     clear() {
       clearInterval(this.intervalId); //清除计时器
       this.intervalId = null; //设置为null
     },
+    // 获取园区打卡数据
+    getPeoples() {
+      axios.defaults.baseURL = ''
+      axios.get('/data-service-center/accessControl/getPeople ').then(res => {
+        console.log(res.data)
+        if(res.data.code === 200) {
+          this.dakaNum = res.data.data
+        }
+      })
+    }
   },
 }
 </script>
@@ -193,4 +209,11 @@ export default {
 ::v-deep .el-table .cell {
   line-height: normal;
 }
+.people {
+  position: absolute;
+  top: 0;right: 1%; 
+  font-size: 3vh;
+  font-weight: 600;
+  color: #fff;
+}
 </style>

+ 37 - 26
src/views/material/basicFile/details.vue

@@ -982,7 +982,9 @@
           // 医药行业
           case 'material_medcine':
             this.getTagList('material_medcine', (form) => {
-              this.medcineData.form = form;
+              this.medcineData.form = [...form];
+              this.medcineData.value = initParams(this.medcineData.form,'prop');
+              this.medcineRules = initRules(form);
               this.getMedcineDetails(this.materialId, 'material_medcine');
             })
             break;
@@ -1122,7 +1124,7 @@
             }
 
             // _this.handleAddReferLabel('basicData');
-
+            this.count++;
           }
         })
       },
@@ -1437,7 +1439,7 @@
       async getMedcineDetails(id) {
         let _this = this;
         console.log(id);
-        materialApi.medcineDetailsInfo(id).then((res) => {
+        await materialApi.medcineDetailsInfo(id).then((res) => {
           this.loading = false;
           console.log(res, '医药行业');
           let {code, data} = res;
@@ -1446,6 +1448,7 @@
             // this.medcineData.form = data.form;
             // _this.handleAddReferLabel('medcineData');
             console.log(' _this.medcineData', _this.medcineData, res);
+            this.count++;
           }
         })
       },
@@ -1486,27 +1489,30 @@
         })
       },
       // 获取物料列表表头
-      getTagList(templateCode, cb) {
-        let _this = this
-        materialApi.tagList({templateCode}).then(res => {
+      async getTagList(templateCode, cb) {
+        let _this = this;
+        await materialApi.tagList({templateCode}).then(async (res) => {
           console.log(res, `获取${templateCode}表头`);
           let dictIdList = [];
           if (res.code == 200) {
 
-            res.data.map(item => {
-
-              // 查字典
-              if (item.dictId && item.dictId != '') {
-                // 通过接口获取有dict的对应的数据
-                getDicts(item.dictId).then(dict => {
-                  if (dict.data) {
-                    item['dictValue'] = dict.data;
-                  }
-                })
-              }
+            res.data.map(async(item) => {
+                // 查字典
+                if (item.dictId && item.dictId != '') {
+                  // 通过接口获取有dict的对应的数据
+                  await getDicts(item.dictId).then(dict => {
+                    if (dict.data) {
+                      item['dictValue'] = dict.data;
+                    }
+                   
+                  })
+                }
 
             })
 
+              return cb(res.data);
+            
+
             // 动态更改dict
             // res.data.forEach(item => {
             //   if (item.dictId) {
@@ -1520,7 +1526,7 @@
 
             // console.log(_this.dict, 'dicts');
 
-            return cb(res.data);
+            // return cb(res.data);
           }
         })
       },
@@ -1630,7 +1636,10 @@
             // 基本信息
             case 'material':
               await this.getTagList('material', async(form) => {
+                // this.basicData.form = [...form];
                 this.basicData.form = [...form];
+                this.rules = initRules(form);
+                this.basicData.value = initParams(this.basicData.form,'prop')
                 await  this.getMaterialDetails(this.materialId, 'material');
               })
               break;
@@ -2462,28 +2471,30 @@
       async handleRest() {
         this.loading = true;
         // 基本信息
-        await this.getTagList('material', (form) => {
+        await this.getTagList('material', async(form) => {
           this.basicData.form = [...form];
           this.rules = initRules(form);
           this.basicData.value = initParams(this.basicData.form,'prop')
-          this.getMaterialDetails(this.materialId, 'material');
+          await this.getMaterialDetails(this.materialId, 'material');
         })
         // 医疗行业
-        await this.getTagList('material_medcine', (form) => {
-          form.forEach((item) => {
-            this.medcineData.value[item.prop] = ''
-          })
-          this.medcineData.form = form;
+        await this.getTagList('material_medcine',async (form) => {
+          // form.forEach((item) => {
+          //   this.medcineData.value[item.prop] = ''
+          // })
+          this.medcineData.form = [...form];
           this.medcineData.value = initParams(this.medcineData.form,'prop');
           this.medcineRules = initRules(form);
-          this.getMedcineDetails(this.materialId, 'material_medcine');
+          await this.getMedcineDetails(this.materialId, 'material_medcine');
         })
 
       },
+
       
     },
 
     watch: {
+
       // 监听主标签修改标识,控制其他标签是否禁止点击
       'updateButtonGroup': function (nVal, oVal) {
         console.log(nVal, 'nVal', oVal, 'oVal');

+ 59 - 0
src/views/material/changeApply/add/column.js

@@ -160,6 +160,12 @@ export default function useColumns(){
               maintenanceType:'curingType',
               medicalDevices:'medicalInstruments',
               leadTime:'deliveryPeriod',
+              isInventoryStatus:'isInventoryStatus',
+              expiryDateManagerment:'expiryDateManagerment',
+              usefulLife:'usefulLife',
+              serialNoManager:'serialNoManager',
+              ratifyBatchNo:'ratifyBatchNo',
+
             },
 
 
@@ -282,6 +288,49 @@ export default function useColumns(){
           },
 
         },
+        {
+          item:{
+            key:'isInventoryStatus',
+            title:'批号及库存状态管理',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no", // 字典名
+          },
+        },
+        {
+          item:{
+            key:'expiryDateManagerment',
+            title:'效期管理',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no", // 字典名
+          },
+        },
+        {
+          item:{
+            key:'serialNoManager',
+            title:'是否序列号管理',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no", // 字典名
+          },
+        },
+        {
+          item:{
+            key:'usefulLife',
+            title:'有效期',
+          },
+          attr:{
+            is: "el-input-number",
+            controlsPosition:"right",
+            min:0,
+          },
+        },
+
+
         // {
         //   item:{
         //     key:'diCode',
@@ -359,6 +408,16 @@ export default function useColumns(){
         },
         {
           item:{
+            key:'ratifyBatchNo',
+            title:'批准文号',
+          },
+          attr:{
+            is: "el-input",
+          },
+
+        },
+        {
+          item:{
             key:'registrationNo',
             title:'注册证号/备案凭证编号',
           },

+ 84 - 0
src/views/material/changeApply/add/index.vue

@@ -281,6 +281,24 @@ export default {
 
       this.download('/material/change/downloadInner',{}, `变更单物料信息模板${new Date().getTime()}.xlsx`);
     },
+    // 批号及库存状态管理
+    changeIsInventoryStatus(row){
+
+      if(row.isInventoryStatus === '2'){
+
+        row.expiryDateManagerment = '2';
+
+        row.serialNoManager = '2';
+      }
+      this.changeExpiryDateManagerment(row);
+    },
+    changeExpiryDateManagerment(row){
+      
+      if(row.expiryDateManagerment === '2'){
+
+        row.usefulLife = '';
+      }
+    }
 
   },
   created() {
@@ -445,6 +463,72 @@ export default {
                   >
                   </component>
                 </template>
+                <!-- 批号及库存状态管理 -->
+                <template slot="isInventoryStatus" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
+                    @change="changeIsInventoryStatus(scope.row)"
+                  >
+                  <el-option
+                      v-for="item in dict.type[scope.attr.dictName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </component>
+                </template>
+                <!-- 效期管理 -->
+                <template slot="expiryDateManagerment" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
+                    :disabled="scope.row.isInventoryStatus !=='0' "
+                    @change="changeExpiryDateManagerment(scope.row)"
+                  >
+                  <el-option
+                      v-for="item in dict.type[scope.attr.dictName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </component>
+                </template>
+                <!-- 是否序列号管理 -->
+                <template slot="serialNoManager" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
+                    :disabled="scope.row.isInventoryStatus !=='0' "
+                  >
+                  <el-option
+                      v-for="item in dict.type[scope.attr.dictName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </component>
+                </template>
+                <!-- 有效期 -->
+                <template slot="usefulLife" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
+                    :disabled="scope.row.expiryDateManagerment !=='0'"
+                  >
+                  </component>
+                </template>
   
   
                 <el-table-column fixed="right" label="操作" width="120" align="center">

+ 7 - 3
src/views/material/requisition/add.vue

@@ -359,8 +359,12 @@
               </el-col>
               <el-col :span="6">
                 <el-form-item label="启用状态" prop="isEnable">
-                  <el-input v-show="false" disabled v-model="basicForm.isEnable"></el-input>
-                  <el-input disabled value="启用"></el-input>
+                  <!-- <el-input v-show="false" disabled v-model="basicForm.isEnable"></el-input>
+                  <el-input disabled value="启用"></el-input> -->
+                  <el-select v-model="basicForm.isEnable" placeholder="请选择" clearable :disabled="true">
+                    <el-option v-for="item in dict.type.material_enable" :key="item.value" :label="item.label"
+                               :value="item.value"/>
+                  </el-select>
                 </el-form-item>
               </el-col>
               <!-- <el-col :span="6">
@@ -721,7 +725,7 @@
 
   export default {
     name: 'requisition_add',
-    dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type', 'period_unit', 'expiry_date', 'abc_type'],
+    dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type', 'period_unit', 'expiry_date', 'abc_type','material_enable'],
     components: {
       factory,
       fourClass,

+ 31 - 3
src/views/material/requisition/index.vue

@@ -115,6 +115,12 @@
                 @click.stop="deleteRow(scope.row)"
                 v-if="scope.row.status == 0 || scope.row.status == 3"
               >删除</el-button>
+              <el-button 
+                v-if="scope.row.status == '1'" 
+                type="text" 
+                size="mini"
+                @click.stop="handleBack(scope.row)"
+              >流程收回</el-button>
             </template>
           </el-table-column>
         </el-super-table>
@@ -138,7 +144,7 @@
 
 <script>
   import addReq from './add.vue';
-  import {getReqList, delReq, importData, fileImport,betchSubmit,toOA} from '@/api/requisition/basic';
+  import {getReqList, delReq, importData, fileImport,betchSubmit,toOA,oaBack} from '@/api/requisition/basic';
   import {saveAs} from "file-saver";
   import { blobValidate } from "@/utils/ruoyi";
   import { SearchColumns, TableColumns } from './columns';
@@ -147,7 +153,7 @@
 
   export default {
     name: 'requisition',
-    dicts:[...initDicts([...SearchColumns,...TableColumns])],
+    dicts:[...initDicts([...SearchColumns,...TableColumns]),'oa_templete_id'],
     components: {
     addReq,
     ElSuperTable: () => import("@/components/super-table/index.vue"),
@@ -232,7 +238,7 @@
 
                 let ids = this.checkedList.map( item => Number(item.id));
 
-                let {code,msg} = await betchSubmit(ids);
+                let {code,msg} = await betchSubmit({ids});
 
                 if(code == 200){
                   this.reset();
@@ -423,6 +429,7 @@
         this.checkedList = selection;
       },
       check(row) {
+        console.log('xxxx',this.dict.type)
         // console.log('查看详情', row)
         this.isList = false
         this.isComponent = 'addReq'
@@ -469,6 +476,27 @@
       //   this.queryParams.pageNum = val
       //   this.getList(this.queryParams)
       // }
+      //流程收回
+      async handleBack(row){
+        try {
+          const { msg, code } = await oaBack({
+            fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+              return item.label == "物料申请单"
+            }).value,
+            fdId: row.oaId,
+            billCode: row.code,
+            billMaker: row.createBy
+          });
+          if (code === 200) {
+            this.$emit("success");
+            this.$notify.success(msg);
+          }
+        } catch (err) {
+          console.error(err);
+        } finally {
+          this.getList(this.queryParams);
+        }
+      },
     }
   }
 </script>

+ 1 - 1
src/views/purchase/DemandSummary/index.vue

@@ -294,7 +294,7 @@
           </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.demandCycle" label="需求可用周期" align="center" prop="demandCycle" width="50px">
             <template slot-scope="scope">
-              {{scope.row.demandCycle ? parseFloat(scope.row.demandCycle).toFixed(1) : '0.0'}}
+              {{scope.row.demandCycle ? parseFloat(scope.row.demandCycle).toFixed(1) : '-'}}
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.dullQut" label="呆滞量" align="center" prop="dullQut" width="50px">

+ 25 - 12
src/views/purchase/PurchaseDemandList/index.vue

@@ -123,15 +123,18 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
-              <el-form-item label="备注">
-                <el-input
-                  v-model.trim="queryParams.remark"
-                  size="mini"
+              <el-form-item label="制单日期">
+                <el-date-picker
+                  v-model="queryParams.createTimeString"
+                  type="date"
                   clearable
+                  value-format="yyyy-MM-dd"
+                  size="mini"
                   style="width: 200px"
-                />
-                </el-form-item>
-              </el-col>
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
           </el-row>
 
           </div>
@@ -186,7 +189,8 @@
           <el-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
           <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
           <el-table-column show-overflow-tooltip label="需求单号" align="center" width="170" prop="code"/>
-          <el-table-column show-overflow-tooltip label="需求日期" align="center" width="120" prop="demandDate"/>
+          <el-table-column show-overflow-tooltip label="需求日期" align="center" width="100" prop="demandDate"/>
+          <el-table-column show-overflow-tooltip label="制单日期" align="center" width="100" prop="createTime"/>
           <el-table-column show-overflow-tooltip label="需求计划" align="center" width="120" prop="planType" :formatter="formatterPlanType"/>
           <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="120" prop="approverFinishTime"/>
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
@@ -209,7 +213,7 @@
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="edit(scope.row)">编辑</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="commit(scope.row)">提交</el-button>
-            <!-- <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button> -->
+            <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
@@ -316,7 +320,7 @@
 import { getToken } from "@/utils/auth";
 import Add from './add.vue'
 import Refers from '@/components/Refers/refers.vue'
-import TreeRefers from '@/components/Refers/treeRefer.vue'
+import TreeRefers from '@/components/Refers/sigleTreeRefer.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 // 流程收回
 import { rebacktWork } from '@/api/purchase/workSpace.js'
@@ -329,7 +333,7 @@ export default {
     Refers,
     TreeRefers
   },
-  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business', 'sys_reserve_ratio', 'sys_period_unit', 'sys_price_type', 'sys_plan_type'],
+  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business', 'sys_reserve_ratio', 'sys_period_unit', 'sys_price_type', 'sys_plan_type', 'oa_templete_id'],
   data() {
     return {
       loading: true,
@@ -379,6 +383,7 @@ export default {
         demandDept: '',
         demandDate: '',
         remark: '',
+        createTimeString: '',
         materialCode: '',
         status: '',
         pageNum: 1,
@@ -482,6 +487,7 @@ export default {
         demandDept: '',
         demandDate: '',
         remark: '',
+        createTimeString: '',
         materialCode: '',
         status: '',
         pageNum: 1,
@@ -687,7 +693,14 @@ export default {
     // 流程收回
     reback(row) {
       this.$modal.loading("收回中...");
-      let params = {billCode: row.code, fdId: row.flowId, fdTemplateId: '18804432233a7813df7921d436ab69b7' }
+      let params = {
+        billCode: row.code, 
+        fdId: row.flowId, 
+        fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+          return item.label == "采购需求单"
+        }).value,
+        billMaker: row.createBy 
+      }
       rebacktWork(params).then(res => {
         if (res.code === 200) {
           this.$modal.notifySuccess("收回成功");

+ 5 - 0
src/views/purchase/apply/columns.js

@@ -32,6 +32,11 @@ export default function useColumns() {
       item: { key: "sourceType", title: "来源单据类型", width: 100 },
       attr: { is: "el-dict-tag", dictName: "price_source" },
     },
+    // 加个字典获取收回模板id
+    {
+      item: { key: "", title: "", width: 0 },
+      attr: { dictName: "oa_templete_id" },
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: {

+ 1 - 1
src/views/purchase/apply/delete/index.vue

@@ -52,7 +52,7 @@ export default {
             try {
               // try
               const { selectData } = this.$props;
-              const ids = selectData.map((item) => item.id).join(",");
+              const ids = selectData.map((item) => item.id);
               const { msg, code } = await REMOVE(ids);
               if (code === 200) {
                 done();

+ 21 - 4
src/views/purchase/apply/index.vue

@@ -1,7 +1,7 @@
 <script>
   import {dicts} from "./dicts";
   import useColumns from "./columns";
-  import {LIST, mbDownload, failDownload} from "@/api/business/purchase/apply";
+  import {LIST, mbDownload, failDownload,oaBack} from "@/api/business/purchase/apply";
   // 导入的token
   import {getToken} from "@/utils/auth";
 
@@ -172,8 +172,25 @@
         this.upload.open = true
       },
       // 收回
-      reback(row) {
-        console.log(row)
+      async reback(row) {
+        console.log('xxxx',this.dict.type)
+        try {
+          const { msg, code } = await oaBack({
+            fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+              return item.label == "价格申报单"
+            }).value,
+            fdId: row.flowId,
+            billCode: row.priceCode,
+            billMaker: row.createBy
+          });
+          if (code === 200) {
+            this.$emit("success");
+            this.$notify.success(msg);
+          }
+        } catch (err) {
+          console.error(err);
+        } finally {
+        }
       },
     },
   };
@@ -268,7 +285,7 @@
         width="100"
         >
         <template slot-scope="scope">
-          <!-- <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button> -->
+          <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button>
         </template>
       </el-table-column>
     </el-super-table>

+ 1 - 1
src/views/purchase/apply/submit/index.vue

@@ -52,7 +52,7 @@ export default {
             try {
               // try
               const { selectData } = this.$props;
-              const ids = selectData.map((item) => item.id).join(",");
+              const ids = selectData.map((item) => item.id);
               const { msg, code } = await SUBMIT(ids);
               if (code === 200) {
                 done();

+ 1 - 1
src/views/purchase/deliveryAddress/add.vue

@@ -151,7 +151,7 @@
 
 <script>
 import Refers from '@/components/Refers/refers.vue'
-import TreeRefers from '@/components/Refers/treeRefer.vue'
+import TreeRefers from '@/components/Refers/sigleTreeRefer.vue'
 import {addAddress, getAddressDetail, editAddress} from '@/api/purchase/deliveryAddress.js'
 // 用于回显参照框数据
 import { getRefer } from '@/api/purchase/basic.js'

+ 0 - 23
src/views/purchase/purchase-order/add/column copy.js

@@ -1,23 +0,0 @@
-
-// 集采中心
-const PurColumns =[];
-const PurchaseTabColumns =[];
-
-// 事业发展部
-const CauseColumns =[];
-const CauseTabColumns =[];
-// export const initTabColumns = () => tabColumns;
-
-export const Columns = [];
-export const TabColumns = [];
-
-const judgeColumns = () =>{
-
-  const { deptName, deptId, name, nickName, roles } = this.$store.state.user;
-
-  if(roles.length && roles.find(role => role === '')){
-
-  }
-
-
-}

文件差異過大導致無法顯示
+ 785 - 122
src/views/purchase/purchase-order/add/column.js


+ 1055 - 0
src/views/purchase/purchase-order/add/columnCopy.js

@@ -0,0 +1,1055 @@
+export const Columns = [
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "id",
+      puOrgName: "name",
+    },
+    queryParams: () => ({}),
+    require: true,
+    isShow:true,
+  },
+  {
+    key: "billType",
+    title: "订单类型",
+    inputType: "Select",
+    referName: "sys_order_type", // 字典名
+    isShow:true,
+    require: true,
+  },
+  { 
+    key: "oaDemandNo", 
+    title: "OA需求单号", 
+    inputType: "Input",  
+    isShow:true,
+    
+  },
+  { 
+    key: "erpOrderCode", 
+    title: "erp订单编号", 
+    inputType: "Input",  
+    readonly: true,
+    disabled: true,
+    isShow:true,
+  },
+  {
+    key: "code",
+    title: "订单编号",
+    inputType: "Input",
+    readonly: true,
+    disabled: true,
+    isShow:true,
+  },
+  {
+    key: "billDate",
+    title: "订单日期",
+    inputType: "DatePicker",
+    valueFormat: "yyyy-MM-dd",
+    width: 200, 
+    require: true,
+    isShow:true,
+  },
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      supplier: "id",
+      supplierName: "name",
+      paymentAgreement: 'paymentId',
+      paymentAgreementName: 'paymentName',
+    },
+    queryParams: () => ({}),
+    require: true,
+    isShow:true,
+  },
+  {
+    key: "paymentAgreementName",
+    title: "付款协议",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "PAYAGREEMENT_PARAM",
+    dataMapping: {
+      paymentAgreement: 'id',
+      paymentAgreementName: 'name'
+    },
+    queryParams: () => ({}),
+    isShow:true,
+    disabled:true,
+    require: true,
+  },
+  {
+    key: "finalTypeName",
+    title: "结算方式",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "BALATYPE_PARAM",
+    dataMapping: {
+      finalType: 'id',
+      finalTypeName: 'name'
+    },
+    queryParams: () => ({}),
+    isShow:true,
+    disabled:true,
+  },
+  {
+    key: "buyerName",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    valueKey: "code",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      buyer: 'code',
+      buyerName: 'name'
+    },
+    queryParams: () => ({}),
+    require: true,
+    isShow:true,
+  },
+  {
+    key: "puDeptName",
+    title: "采购部门",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "DEPT_PARAM",
+    dataMapping: {
+      puDept: 'id',
+      puDeptName: 'name'
+    },
+    queryParams: () => ({}),
+    require: true,
+    isShow:true,
+  },
+  {
+    key: "customerName",
+    title: "收货客户",
+    inputType: "PopoverSelect",
+    width: 200,
+    valueKey: "id",
+    referName: "CUSTOMER_PARAM",
+    dataMapping: {
+      customer: 'id',
+      customerName: 'name'
+    },
+    queryParams: () => ({}),
+    isShow:true,
+  },
+  {
+    key: "qty",
+    title: "总数量",
+    inputType: "InputNumber",
+    controlsPosition: "right",
+    isShow:true,
+    disabled:true,
+  },
+  {
+    key: "originalQty",
+    title: "原始总数量",
+    inputType: "InputNumber",
+    controlsPosition: "right",
+    isShow:true,
+    disabled:true,
+  },
+  { 
+    key: "money", 
+    title: "价税合计", 
+    inputType: "InputNumber",
+    controlsPosition: "right", 
+    // precision:2,
+    isShow:true, 
+    disabled:true,
+  },
+  { 
+    key: "originalMoney", 
+    title: "原始总金额", 
+    inputType: "InputNumber",
+    controlsPosition: "right", 
+    // precision:2,
+    isShow:true, 
+    disabled:true,
+  },
+  { 
+    key: "notaxMoney", 
+    title: "无税金额", 
+    inputType: "InputNumber",  
+    controlsPosition: "right",
+    // precision:2,
+    isShow:true, 
+    disabled:true,
+  },
+  {
+    key: "status",
+    title: "单据状态",
+    inputType: "Select",
+    referName: "documents_status", // 字典名
+    disabled: true,
+    isShow:true,
+  },
+  // { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", isShow:true, },
+  { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox",  isShow:true,},
+  // { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox",  isShow:true,},
+  // { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox",  isShow:true,},
+  {
+    key: "warehouseName",
+    title: "WMS入库仓库", 
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "WAREHOUSE_PARAM",
+    dataMapping: {
+      warehouse: 'id',
+      warehouseName: 'name',
+    },
+    queryParams: (params) => ({
+      pkOrg: params.puOrg,
+    }),
+    isShow:true,
+    
+    // require: true,
+  },
+  {
+    key: "goodsAllocationName",
+    title: "货位",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "ALLOCATION_PARAM",
+    dataMapping: {
+      goodsAllocation: 'id',
+      goodsAllocationName: 'name',
+      
+    },
+     isShow:true,
+    queryParams: (params) => ({
+      stordocId: params.warehouse,
+    }),
+    width: 200,
+  },
+  // { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox",isShow:true, },
+  { 
+    key: "isInvoice", 
+    title: "发票标识", 
+    inputType: "Checkbox", 
+    isShow:true,
+    disabled:true,
+  },
+  { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input",isShow:true, },
+  { 
+    key: "rebateMoney", 
+    title: "订单使用返利金额", 
+    inputType: "InputNumber",
+    controlsPosition: "right",
+    // precision:2,
+    isShow:true, 
+    require: true,
+  },
+  { 
+    key: "deductionMoney", 
+    title: "订单抵扣余款金额", 
+    inputType: "InputNumber",
+    controlsPosition: "right",
+    // precision:2,
+    isShow:true, 
+    require: true,
+  },
+  { 
+    key: "goodsWarehouseName",
+    title: "收货仓库",
+    inputType: "Input",
+    isShow:true,
+    disabled:true,
+    require: true,
+  },
+  { 
+    key: "address",
+    title: "收货地址",
+    inputType: "PopoverSelect",
+    valueKey: "address",
+    referName: "ADDRESS_PARAM",
+    require: true,
+    isShow:true,
+    dataMapping: {
+      // address: 'address',
+      // addressName: '',
+      goodsWarehouse:'id',
+      goodsWarehouseName:'name',
+      contacts:'contactsName',
+      contactsPhone:'contactsPhone'
+    },
+    queryParams: () => ({}),
+    width: 180
+  },
+  { 
+    key: "contacts", 
+    title: "收货联系人", 
+    inputType: "Input",
+    isShow:true, 
+    disabled:true,
+  },
+  { 
+    key: "contactsPhone", 
+    title: "收货联系人电话", 
+    inputType: "Input",
+    isShow:true, 
+    disabled:true,
+  },
+  {
+    key: "customerDeptName",
+    title: "客户部门",
+    inputType: "PopoverSelect",
+    width: 200,
+    valueKey: "id",
+    referName: "CUSTOMERDEPT_PARAM",
+    dataMapping: {
+      customerDept: 'id',
+      customerDeptName: 'name'
+    },
+     isShow:true,
+    queryParams: () => ({}),
+
+  },
+  {
+    key: "supplierContactsName",
+    title: "供应商业务联系人",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "SUPPLIERCONTACTS_PARAM",
+    dataMapping: {
+      supplierContacts: 'id',
+      supplierContactsName: 'name'
+    },
+     isShow:true,
+    queryParams: (params) => ({
+      supplierId:params.supplier
+    }),
+    width: 200,
+  },
+  { 
+    key: "isUrgency", 
+    title: "紧急程度", 
+    inputType: "Checkbox",
+    isShow:true,
+    disabled:true,
+   },
+  { 
+    key: "isSendWms", 
+    title: "已同步WMS", 
+    inputType: "Checkbox",
+    isShow:true,
+    disabled:true,
+   },
+  // { key: "agent", title: "代理人", inputType: "Input", }, // 建议删除
+  // {
+  //   key: "agentName",
+  //   title: "代理人",
+  //   inputType: "PopoverSelect",
+  //   valueKey: "code",
+  //   referName: "CONTACTS_PARAM",
+  //   dataMapping: {
+  //     agent: 'code',
+  //     agentName: 'name'
+  //   },
+  //    isShow:true,
+  //   queryParams: () => ({}),
+  //   width: 200,
+  // },
+
+  { 
+    key: "isClose", 
+    title: "最终关闭", 
+    inputType: "Checkbox", 
+    isShow:true,
+    disabled:true,
+   },
+  {
+    key: "closeTime",
+    title: "最终关闭日期",
+    inputType: "DatePicker",
+    valueFormat: "yyyy-MM-dd",
+    isShow:true,
+    disabled:true,
+  },
+  { 
+    key: "applyPaymentMoney", 
+    title: "累计付款申请金额", 
+    inputType: "InputNumber", 
+    controlsPosition: "right",
+    // precision:2,
+    isShow:true,
+    disabled:true,
+  },
+  { 
+    key: "paymentMoney", 
+    title: "累计付款金额", 
+    inputType: "InputNumber", 
+    controlsPosition: "right",
+    // precision:2,
+    isShow:true,
+  },
+  { 
+    key: "invoiceMoney", 
+    title: "发票金额", 
+    inputType: "InputNumber",
+    controlsPosition: "right",
+    // precision:2,
+    isShow:true,
+   },
+  {
+    key: "supplierPersonalName",
+    title: "供应商业务员",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    // referName: "SUPPLIERCONTACTS_PARAM",
+    referName: "PSNLICENSE_PARAM",
+    dataMapping: {
+      supplierPersonal: 'id',
+      supplierPersonalName: 'name'
+    },
+     isShow:true,
+    queryParams: (params) => ({
+      // 组织、供应商id
+      pkOrg: params.puOrg,
+      supplierId:params.supplier
+    }),
+  },
+  // { key: "isDeliver", title: "是否发货", inputType: "Checkbox",  isShow:true,},
+  {
+    key: "retReasonName",
+    title: "退换原因",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "RETREASON_PARAM",
+    dataMapping: {
+      retReason: 'id',
+      retReasonName: 'name'
+    },
+     isShow:true,
+    queryParams: () => ({}),
+  },
+  {
+    key: "processTypeName",
+    title: "处理方式",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "PROCESSTYPE_PARAM",
+    dataMapping: {
+      processType: 'id',
+      processTypeName: 'name'
+    },
+     isShow:true,
+    queryParams: () => ({}),
+  },
+  { key: "isEnd", title: "整单关闭标识", inputType: "Checkbox", isShow:true, },
+  {
+    key: "projectNowName",
+    title: "在建工程项目",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "PROJECT_PARAM",
+    dataMapping: {
+      projectNow: 'id',
+      projectNowName: 'name'
+    },
+     isShow:true,
+    queryParams: () => ({}),
+  },
+  {
+    key: "operatingItemsName",
+    title: "经营性项目",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "OPERATING_PARAM",
+    dataMapping: {
+      operatingItems: 'id',
+      operatingItemsName: 'name'
+    },
+     isShow:true,
+    queryParams: () => ({}),
+
+  },
+  { key: "isArrivalReson", title: "到货超期原因", inputType: "Input", isShow:true, },
+  // { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", isShow:true, },
+  { key: "marketingCode", title: "销售订单号", inputType: "Input", isShow:true, },
+  { key: "isArrival", title: "到货超期", inputType: "Checkbox",  isShow:true,},
+  { key: "createByName", title: "创建人", inputType: "Input", isShow:false, },
+  {
+    key: "approveTime",
+    title: "提交时间",
+    inputType: "DatePicker",
+    valueFormat: "yyyy-MM-dd",
+    isShow:false,
+  },
+  { key: "approverName", title: "审批人", inputType: "Input", isShow:false, },
+  {
+    key: "approverFinishTime",
+    title: "审批时间",
+    inputType: "DatePicker",
+    valueFormat: "yyyy-MM-dd",
+    isShow:false,
+  },
+  { key: "updateByName", title: "更新人", inputType: "Input", isShow:false, },
+  // { key: "flowId", title: "OA流程ID", inputType: "Input", isShow:false, },
+  {
+    key: "sysFileRecordList",
+    title: "附件",
+    inputType: "Upload",
+    // fileType: ["pdf",""],
+    span: 24,
+    isShow:true,
+  },
+  { 
+    key: "remark",
+    title: "备注",
+    inputType: "Textarea",
+    isShow:true,
+   },
+
+];
+
+// export const initColumns = () => columns;
+
+export const TabColumns = [
+  {
+    title: '物料信息',
+    key: 'puOrderItemList',
+    tableColumns: [
+      { 
+        key: "rowNo", 
+        title: "行号", 
+        inputType: "Input", 
+        disabled:true,
+        require:false,
+      },
+      { 
+        key: "demandCode",
+        title:"采购需求单号",
+        inputType: "Input", 
+        width: 180,
+        disabled:true,
+        require:false,
+      },
+      { 
+        key: "contractNo",
+        title:"合同编号",
+        inputType: "Input", 
+        width: 180,
+        disabled:true,
+        require:false,
+      },
+      // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
+      // {key: "material",title: "物料",inputType: "Input",   },
+      {
+        key: "materialName",
+        title: "物料",
+        inputType: "PopoverSelect",
+        width: 180,
+        require: true,
+        valueKey: "id",
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "id",
+          materialName: "name",
+          materialCode: "code",
+          // materialClassify:'classifyIdName',
+          materialManufacturersCode:'manufacturersMaterialCode',
+          specification:'specification',
+          model:'model',
+          isMedcine:'isMedicineYN',
+          manufacturer:'manufacturerId',
+          manufacturerName:'manufacturerIdName',
+          unit:'unitId',
+          unitName:'unitIdName',
+          // tax:'materialRateName',
+          storageCondition:'storageCondition',
+          carriageCondition:'transportationCondition',
+          materialClassifyOneName:'oneClass',
+          materialClassifyTwoName:'twoClass',
+          materialClassifyThreeName:'threeClass',
+          materialClassifyFourName:'fourClass',
+          registration:'registrationNo',
+          isDrug:'isDrug',
+        },
+        queryParams: () => ({}),
+      },
+      {
+        key: "materialCode",
+        title: "物料编码",
+        inputType: "Input",
+        require: true,
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      // { //classifyIdName   classifyId
+      //   key: "materialClassify",
+      //   title: "物料分类", 
+      //   inputType: "Input",
+      //   width: 180,
+      //   disabled:true,
+      //   readonly:true, 
+      // },
+      { // manufacturersMaterialCode  manufacturersMaterialName
+        key: "materialManufacturersCode",
+         title: "厂家物料编码", 
+         inputType: "Input",
+          width: 180,
+          disabled:true,
+        readonly:true,
+         },
+      { //specification
+        key: "specification",
+        title: "规格", 
+        inputType: "Input",
+        width: 180 ,
+        disabled:true,
+        readonly:true,
+        },
+      { //model
+        key: "model",
+        title: "型号", 
+        inputType: "Input",
+        disabled:true,
+        readonly:true,
+      },
+      { //isMedicine  isMedicineValue
+        key: "isMedcine",
+        title: "医药物料", 
+        inputType: "Checkbox", 
+        disabled:true,
+        readonly:true,
+        },
+      { // manufacturerId  manufacturerIdName
+        key: "manufacturerName",
+        title: "生产厂家代理人",
+        inputType: "Input",
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      { 
+        key: "isDrug",
+         title: "物料药品属性", 
+         inputType: "Checkbox", 
+         disabled:true,
+      },
+      { //unitId  unitIdName
+        key: "unitName", 
+        title: "单位", 
+        inputType: "Input",
+        disabled:true,
+        readonly:true,
+       },
+      {
+        key: "qty",
+        title: "数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 120,
+        require: true,
+      },
+      {
+        key: "currencyName",
+        title: "币种",
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "CURRENCY_PARAM",
+        dataMapping: {
+          currency: 'id',
+          currencyName: 'name'
+        },
+        queryParams: () => ({}),
+        width: 180,
+      },
+      {
+        key: "priceType",
+        title: "价格类型",
+        inputType: "Select",
+        referName: "sys_price_type", // 字典名
+        width: 180,
+      },
+      { 
+        key: "taxPrice", 
+        title: "含税单价", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        // precision:2,
+        require: true,
+        disabled:true,
+        width: 180,
+       },
+      { 
+        key: "money", 
+        title: "价税合计", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        // precision:2,
+        disabled:true,
+        width: 180,
+       },
+      { //materialRate  materialRateName
+        key: "tax", 
+        title: "税率",
+        // inputType: "Input",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        // precision:2,
+        disabled:true,
+        width: 180,
+      },
+      { 
+        key: "taxDeductMoneya", 
+        title: "折扣金额", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        // precision:2,
+        disabled:true,
+        width: 180,
+       },
+      { 
+        key: "nitemdiscountrate", 
+        title: "折扣(%)", 
+        inputType: "Input",
+        // precision:2,
+        disabled:true,
+        width: 180,
+       },
+      { 
+        key: "ntaxnetprice", 
+        title: "含税净价", 
+        inputType: "Input",
+        controlsPosition: "right",
+        // precision:2,
+        disabled:true,
+        width: 180,
+       },
+      { 
+        key: "arrivalQty",
+        title: "已到货数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        disabled:true,
+        width: 180,
+      },
+      { 
+        key: "unarrivedQty", 
+        title: "未到货数量", 
+        inputType: "InputNumber", 
+        controlsPosition: "right",
+        disabled:true,
+        width: 180,
+      },
+      { 
+        key: "price",
+        title: "无税单价",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        // precision:2,
+        disabled:true,
+        width: 180,
+      },
+      { 
+        key: "notaxMoney", 
+        title: "无税金额", 
+        inputType: "InputNumber", 
+        controlsPosition: "right",
+        // precision:2,
+        disabled:true,
+        width: 180,
+      },
+      // { key: "priceSource", title: "价格目录ID", inputType: "Input", },
+      { key: "isStorage", title: "入库关闭", inputType: "Checkbox", disabled:true, },
+      { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", disabled:true, },
+      { key: "isArrival", title: "到货关闭", inputType: "Checkbox", disabled:true,},
+      { key: "isPayment", title: "付款关闭", inputType: "Checkbox", disabled:true, },
+      { key: "isGift", title: "赠品", inputType: "Checkbox", },
+      {
+        key: "goodsWarehouseName",
+        title: "收货仓库", 
+        inputType: "Input",
+        width: 200,
+        disabled:true,
+      },
+      // { key: "place", title: "收货地点", inputType: "Input", width: 180 },
+      { 
+        key: "address",
+        title: "收货地址",
+        inputType: "PopoverSelect",
+        valueKey: "address",
+        referName: "ADDRESS_PARAM",
+        width: 180,
+        dataMapping:{
+          // address: 'address',
+          // addressName: '',
+          goodsWarehouse:'id',
+          goodsWarehouseName:'name',
+          contacts:'contactsName',
+          contactsPhone:'contactsPhone'
+        }
+      },
+      { 
+        key: "customerName",
+        title: "收货客户", 
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "CUSTOMER_PARAM",
+        width: 180,
+        dataMapping:{
+          customer:'id',
+          customerName:'name',
+        },
+      },
+      { key: "productBatch", title: "产品批号", inputType: "Input", width: 180 },
+      { key: "manufactureDate", title: "生产日期", inputType: "Input", width: 180 },
+      { 
+        key: "efficacyLoseDate", 
+        title: "有效期至/失效日期", 
+        inputType: "Input",
+         width: 180
+         },
+      { 
+        key: "approvalNumber",
+         title: "批准文号",
+          inputType: "Input", 
+          width: 180
+         },
+      { 
+        key: "registration",
+         title: "注册证号", 
+         inputType: "Input", 
+         width: 180 ,
+         disabled:true,
+        },
+
+      { //storageCondition storageConditionName
+        key: "storageCondition",
+        title: "存储条件",
+        inputType: "Select",
+        referName: "sys_storage_condition", // 字典名
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      { // transportationCondition  transportationConditionName
+        key: "carriageCondition",
+        title: "运输条件",
+        inputType: "Select",
+        referName: "sys_conditions_carriage", // 字典名
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+
+      { key: "isBatchLock", title: "批号锁定标识", inputType: "Checkbox", },
+      { key: "isReplenishment", title: "补单标识", inputType: "Checkbox", },
+      { key: "isUrgency", title: "紧急标识", inputType: "Checkbox", },
+      { 
+        key: "originalQty", 
+        title: "原始数量", 
+        inputType: "InputNumber", 
+        controlsPosition: "right",
+        disabled:true,
+        width: 180 ,
+      },
+      { 
+        key: "originalMoney", 
+        title: "原始金额", 
+        inputType: "InputNumber", 
+        controlsPosition: "right",
+        // precision:2,
+        disabled:true,
+        width: 180,
+      },
+      { key: "directProductBatch", title: "直运产品批号", inputType: "Input", width: 180 },
+      { key: "discountRule", title: "折扣规则编码", inputType: "Input", width: 180 },
+      { 
+        key: "reservedQty", 
+        title: "预留数量", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180 ,
+       },
+      { key: "reservedPeriod", title: "预留周期", inputType: "Input", },
+      { 
+        key: "taxDeductClassify", 
+        title: "扣税类别", 
+        inputType: "Select",
+        referName: "tax_deduction_category", // 字典名
+        width: 180,
+       },
+      { key: "exchangeRate", title: "折本汇率", inputType: "Input", },
+      { key: "source", title: "上游单据号", inputType: "Input", width: 180 },
+      // { key: "sourceId", title: "上游单据ID", inputType: "Input", width: 180 },
+      // { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
+      { key: "arrivalDatePlan", title: "计划到货日期", inputType: "Input", width: 180 },
+     
+      { key: "isDistributionPrice", title: "配送价", inputType: "Checkbox", },
+     
+      { //threeClass
+        key: "materialClassifyOneName", 
+        title: "物料一级分类", 
+        inputType: "Input",
+        width: 180,
+        disabled:true,
+        readonly:true, 
+      },
+      { //twoClass
+        key: "materialClassifyTwoName",
+        title: "物料二级分类", 
+        inputType: "Input",
+        width: 180,
+        disabled:true,
+        readonly:true, 
+      },
+      { //threeClass
+        key: "materialClassifyThreeName", 
+        title: "物料三级分类", 
+        inputType: "Input", 
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      { //fourClass
+        key: "materialClassifyFourName", 
+        title: "物料四级分类",
+        inputType: "Input", 
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      // { key: "createByName", title: "创建人", inputType: "Input", },
+      // { key: "updateByName", title: "更新人", inputType: "Input", },
+      
+    ]
+  },
+  {
+    title: '执行结果',
+    key: 'puOrderExecuteList',
+    tableColumns: [
+      // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
+      { 
+        key: "rowno", 
+        title: "行号", 
+        inputType: "Input", 
+        disabled:true,
+        require:false,
+      },
+      {
+        key: "materialName",
+        title: "物料",
+        inputType: "PopoverSelect",
+        width: 180,
+        require: true,
+        valueKey: "id",
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          material: "id",
+          materialName: "name",
+          materialCode: "code",
+          // materialClassify:'classifyIdName',
+          materialManufacturersCode:'manufacturersMaterialCode',
+          specification:'specification',
+          model:'model',
+          isMedcine:'isMedicine',
+          manufacturer:'manufacturerId',
+          manufacturerName:'manufacturerIdName',
+          unit:'unitId',
+          unitName:'unitIdName',
+          // tax:'materialRateName',
+          storageCondition:'storageCondition',
+          carriageCondition:'transportationCondition',
+          materialClassifyOneName:'oneClass',
+          materialClassifyTwoName:'twoClass',
+          materialClassifyThreeName:'threeClass',
+          materialClassifyFourName:'fourClass',
+          registration:'registrationNo',
+          isDrug:'isDrug',
+        },
+        queryParams: () => ({}),
+        width:180,
+      },
+      { 
+        key: "specification",
+        title: "规格", 
+        inputType: "Input", 
+        disabled:true,
+        readonly:true, 
+      },
+      {
+        key: "qty",
+        title: "数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180,
+        require: true,
+      },
+      { 
+        key: "stroageQty", 
+        title: "累计到货主数量", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
+      },
+      { 
+        key: "stockQty", 
+        title: "累计入库主数量", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
+      },
+      { 
+        key: "invoiceQty", 
+        title: "累计开票主数量", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
+      },
+      { 
+        key: "rollbackQty", 
+        title: "累计退货主数量", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
+      },
+      { 
+        key: "backStockQty", 
+        title: "累计退库主数量", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
+      },
+      { 
+        key: "floatQty", 
+        title: "未到货数量", 
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 180, 
+      },
+      // { 
+      //   key: "createByName", 
+      //   title: "创建人", 
+      //   inputType: "Input", 
+      //   width: 120 
+      // },
+      // { 
+      //   key: "updateByName", 
+      //   title: "更新人", 
+      //   inputType: "Input", 
+      //   width: 120 
+      // },
+    ]
+  },
+];
+
+
+// 集采中心
+const PurColumns =[];
+const PurchaseTabColumns =[];
+
+// 事业发展部
+const CauseColumns =[];
+const CauseTabColumns =[];
+// export const initTabColumns = () => tabColumns;

+ 176 - 83
src/views/purchase/purchase-order/add/index.vue

@@ -1,8 +1,12 @@
 <script>
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init/index.js";
-import { Columns, TabColumns } from "./column";
+// import { Columns, TabColumns } from "./column";
+import judgeColumns from "./column";
+import { tax, currency } from "@/components/popover-select-v2/fetch";
 
+const {Columns,TabColumns} = judgeColumns();
+    
 const NewColumns = initColumns(Columns);
 const NewTabColumns = TabColumns.map((element) => ({
   ...element,
@@ -20,14 +24,22 @@ NewTabColumns.forEach((column) => {
 
 export default {
   name: "AddPurchaseOrderDrawer",
+  props:{
+    // roles:{
+    //   type:[Array,String,Object],
+    //   require:true,
+    // }
+  },
   dicts: initDicts(SelectColumns),
   components: {
     FileUploadCenter: () => import("../components/FileUploadCenter/index.vue"),
     popDialog: () => import("@/components/PopDialog/index.vue"),
     BatchImport: () => import("@/components/BatchImport/index.vue"),
   },
+  
 
   data() {
+
     return {
       visible: false,
       loading:false,
@@ -45,7 +57,16 @@ export default {
       isCopy:false,
     };
   },
-  computed: {},
+  computed: {
+    role:{
+      get(){
+        let {roles} = this.$store.state.user;
+        return roles.find(item => item === "syfz-purchaseorder") || "procurementManager";
+        
+      },
+      set(){}
+    }
+  },
   watch: {
     "params.puOrderItemList": {
       handler(nVal, oVal) {
@@ -76,13 +97,8 @@ export default {
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
           ];
-
-          this.rules.goodsAllocationName = [
-            { required: true, message: "货位不能为空", trigger: "change" },
-          ];
         }else{
           this.rules.warehouseName = null;
-          this.rules.goodsAllocationName = null;
         }
 
         this.count++;
@@ -91,7 +107,6 @@ export default {
   },
   methods: {
     beforeOpen() {
-
       if(!this.isCopy){
 
         const { deptName, deptId, name, nickName, orgName, orgId } = this.$store.state.user;
@@ -102,6 +117,7 @@ export default {
         this.params.puDept = deptId;
         this.params.puDeptName = deptName;
         this.params.billDate = new Date().Format('yyyy-MM-dd');
+        this.params.createTime = new Date().Format('yyyy-MM-dd HH:mm:ss');
         console.log(this.params,'this.params');
         // this.addTableRow();
       }
@@ -133,6 +149,7 @@ export default {
             source: "3",
             isClose:'N',
             billDate: new Date().Format('yyyy-MM-dd'),
+            createTime : new Date().Format('yyyy-MM-dd HH:mm:ss'),
             closeTime:'',
             oaDemandNo:'',
             isInvoice:'N',
@@ -145,6 +162,23 @@ export default {
 
           };
 
+          try {
+            const { code, rows} = await orderApi.REFER(
+              {
+                type:'WAREHOUSE_PARAM',
+                search:  this.params.warehouseName,
+                isPage: true,
+              }, {pageNum: 1 , pageSize: 10} );
+
+              if(code ==200){
+                this.judgeGoodsAllocation(rows[0].csFlag);
+              }
+
+
+          } catch (error) {
+            
+          }
+
           for (const key in this.params) {
             // if (Array.isArray(this.params[key])) {
             if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
@@ -188,14 +222,21 @@ export default {
          
 
           "rowno" in rowData &&
-            (rowData["rowno"] = this.params[key].length + 1);
+            (rowData["rowno"] = this.params[key].length ? 
+              this.params[key][this.params[key].length - 1]['rowno'] +1 :
+               this.params[key].length + 1
+            );
 
             // 物料
             if("rowNo" in rowData){
-
-              rowData["rowNo"] = this.params[key].length + 1;
+              
+              rowData["rowNo"] = this.params[key].length ? 
+              this.params[key][this.params[key].length - 1]['rowNo'] +1 :
+               this.params[key].length + 1;
               // 扣税类别
               rowData["taxDeductClassify"] = '1';
+              // 折本汇率
+              rowData["exchangeRate"] = '1';
               // 价格类型
               rowData["priceType"] = 'order';
               // 币种
@@ -205,7 +246,7 @@ export default {
           
 
           // 是否完成询价,新增明细行需默认明细为false
-          rowData["whetherCompleteInquiry"] = false;
+          // rowData["whetherCompleteInquiry"] = false;
           this.params[key].push(rowData);
         }
       }
@@ -218,6 +259,7 @@ export default {
     // 删行
     async delTableRow(prop, index) {
 
+     
       for (const key in this.params) {
         // if (Array.isArray(this.params[key])) {
         if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
@@ -280,18 +322,20 @@ export default {
           }
 
           // puOrderItemList
-         let isPrice =  this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
+        //  let isPrice =  this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
 
-         if(isPrice.length){
+         
 
-            this.$notify.error({
-              title: '错误',
-              message: '询价失败!'
-            });
-            return false
+        //  if(isPrice.length && this.role === 'procurementManager'){
+
+        //     this.$notify.error({
+        //       title: '错误',
+        //       message: '询价失败!'
+        //     });
+        //     return false
 
-         }
-         console.log(isPrice,'isPrice');
+        //  }
+        //  console.log(isPrice,'isPrice');
           cb();
         } else {
           this.$notify.error({
@@ -320,13 +364,22 @@ export default {
           }
       })
     },
-   
+    judgeGoodsAllocation(porp){
+      if(porp === 'Y'){
+        this.rules.goodsAllocationName = [
+          { required: true, message: "货位不能为空", trigger: "change" },
+        ];
+      } else{ 
+        this.rules.goodsAllocationName = null;
+      }
+      this.count++;
+   },
     // 主表参照改变之后
    async handleReferChange(val, type, source){
+     let page = { pageNum: 1 , pageSize: 10 };
       // 供应商选择  
       if( type === 'SUPPLIER_PARAM' ){
 
-        let page = { pageNum: 1 , pageSize: 10 };
 
         let relevanceRefer = [
           {
@@ -347,47 +400,45 @@ export default {
             }
           }
         ]
+        
+        try {
 
-        await relevanceRefer.forEach(async (refer) =>{
-
-          try {
-
-            const { code, rows} = await orderApi.REFER(
-              {
-                ...refer.params,
-                search: "",
-                isPage: true,
-              }, page );
-
-            if (code === 200) {
-
-              source[refer.key] = rows[0]? rows[0].id :'';
-
-              source[`${refer.key}Name`] = rows[0] ? rows[0].name :'';
-
-            }
-            
-          } catch (error) {}
-          
-        })
-
-        // 明细不为空的情况下进行询价
-        let detailList = this.params['puOrderItemList'].filter(item => (
-          item.material && item.material != '' 
-        ))
-
-        if(detailList.length){
-
-          this.params['puOrderItemList'] = this.params['puOrderItemList'].map(item => {
-            
-            item['whetherCompleteInquiry'] = false
-          
-            return item;
-          });
+          let promiseArr =  relevanceRefer.map( (refer) =>{
+
+            return new Promise((resolve,reject)=>{
+
+               orderApi.REFER(
+                {
+                  ...refer.params,
+                  search: "",
+                  isPage: true,
+                }, page ).then(res=>{
+
+                  let {code,rows} = res;
+                  if (code === 200) {
+                    
+                    source[refer.key] = rows[0]? rows[0].id :'';
+                    
+                    source[`${refer.key}Name`] = rows[0] ? rows[0].name :'';
+                    
+                    resolve();
+                  }
+              })
+            })
+          })
+
+          Promise.all(promiseArr).then(async()=>{
+            // 明细不为空的情况下进行询价
+            let detailList = this.params['puOrderItemList'].filter(item => (
+                item.material && item.material != '' 
+              ))
+              
+              if(detailList.length){
 
-          await this.handleGetPrice();
-        }
-        
+                await this.handleGetPrice();
+              }
+          })
+        } catch (error) {}
       }
 
       // 组织
@@ -412,7 +463,8 @@ export default {
               key != "puDept" &&
               key != "puDeptName" &&
               key != "status" &&
-              key != "billDate" 
+              key != "billDate" &&
+              key != "createTime" 
             ) {
               this.params[key] = "";
             } else {
@@ -421,6 +473,14 @@ export default {
         
 
       }
+
+      // WMS仓库
+      if(type === 'WAREHOUSE_PARAM'){
+        this.judgeGoodsAllocation(val.csFlag);
+        source.goodsAllocation = ''
+        source.goodsAllocationName = ''
+        // this.count++
+      }
     },
 
     // 下拉框选择改变
@@ -443,7 +503,7 @@ export default {
 
         source['qty'] = 0;
 
-        source['whetherCompleteInquiry'] = false;
+        // source['whetherCompleteInquiry'] = false;
 
         source['taxPrice'] = 0;
 
@@ -468,6 +528,23 @@ export default {
 
       }
 
+      // 物料触发税率
+      if( type == "MATERIAL_PARAM"){
+        let {rateCode} = source;
+        try {
+          // try
+          this.loading = true;
+          const { ntaxrate } = await tax(rateCode);
+          source.tax = ntaxrate === "0E-8" ? 0 : ntaxrate;
+        } catch (err) {
+          // catch
+          console.error(err);
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      }
+
     },
 
     // 子表下拉框改变
@@ -475,7 +552,7 @@ export default {
      
       if(type == 'priceType' && row.material && row.qty && row.qty != ""){
 
-        row['whetherCompleteInquiry'] = false;
+        // row['whetherCompleteInquiry'] = false;
 
         await this.handleGetPrice();
       }
@@ -484,13 +561,20 @@ export default {
     // 子表inputNumber
     handleInputChange(row, type) {
       // 物料数量变化----询价
-      if (type == "qty" && row.material) {
+      if ((type == "qty" || type == "taxPrice" || type == 'taxDeductMoneya')&& row.material) {
 
-        row['whetherCompleteInquiry'] = false;
+        // row['whetherCompleteInquiry'] = false;
 
-        row.qty && this.handleGetPrice();
+        
+       this.handleGetPrice();
 
       }
+
+      // if(this.role === 'syfz-purchaseorder' && row.material && (type == "qty" ||type === "taxPrice" )){
+
+      //   row.money = row.qty * row.taxPrice;
+      // }
+
     },
 
     // 子表多选框改变
@@ -499,7 +583,7 @@ export default {
       // 勾选赠品,价税合计更新为0,含税单价、无税单价更新为0
       if(type === 'isGift' && source.material && source.qty && source.qty != ""){
 
-        source['whetherCompleteInquiry'] = false;
+        // source['whetherCompleteInquiry'] = false;
 
         this.handleGetPrice()
       }
@@ -508,18 +592,20 @@ export default {
     // 询价 getPrice
     async handleGetPrice() {
 
-      try {
-        
-        // action:insert(新增)、revise(修订)、update(编辑)
-        let { code, data } = await orderApi.getPrice({ ...this.params,action: 'insert' });
-
-        if (code == 200) {
-
-          this.params = data;
-
-        }
+        try {
+          
+          // action:insert(新增)、revise(修订)、update(编辑)
+          let { code, data } = await orderApi.getPrice({ ...this.params,action: 'insert' });
+  
+          if (code == 200) {
+  
+            this.params = data;
+  
+          }
+  
+        } catch (error) {} 
+      
 
-      } catch (error) {} 
     
     },
 
@@ -597,9 +683,15 @@ export default {
     
     async handleTemDownload(){
 
-      this.download('/pu/order/downloadFailData',{}, `物料信息模板${new Date().getTime()}.xlsx`);
+      this.download('/pu/order/downloadFailData',{}, `采购订单物料信息模板${new Date().getTime()}.xlsx`);
     },
 
+    // judgeRole(){
+    //   let {roles} = this.$store.state.user;
+    //   let role =  roles.find(item => item === "syfz-purchaseorder") || "procurementManager";
+    //   return role;
+    // },
+
 
   },
   created() {
@@ -914,8 +1006,9 @@ export default {
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
           <el-button size="mini" @click="addTableRow(params[tabName])"
-            >增行</el-button
-          >
+            >增行</el-button>
+         
+            <!-- v-if="role === 'procurementManager'" -->
           <BatchImport
             ref="batchImport"
             @import="handelImport"

+ 169 - 79
src/views/purchase/purchase-order/edit/index.vue

@@ -2,6 +2,7 @@
 import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initColumn";
 import orderApi from "@/api/business/purchase/purchase-order";
 import {  initDicts, initRules, initParams } from "@/utils/init/index.js";
+import { tax, currency } from "@/components/popover-select-v2/fetch";
 
 export default {
   name: "EditPurchaseOrderDrawer",
@@ -29,7 +30,16 @@ export default {
       count:1
     };
   },
-  computed: {},
+  computed: {
+    role:{
+      get(){
+        let {roles} = this.$store.state.user;
+        return roles.find(item => item === "syfz-purchaseorder") || "procurementManager";
+        
+      },
+      set(){}
+    }
+  },
   watch: {
     "params.contractType": function (newProp) {
       this.tabColumns = editTabColumns.filter((element) =>
@@ -66,13 +76,8 @@ export default {
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
           ];
-
-          this.rules.goodsAllocationName = [
-            { required: true, message: "货位不能为空", trigger: "change" },
-          ];
         }else{
           this.rules.warehouseName = null;
-          this.rules.goodsAllocationName = null;
         }
 
         this.count++;
@@ -115,6 +120,23 @@ export default {
         let { updateColumns, updateTabColumns } = await forbidden(status != '2',source);
         this.columns = updateColumns;
         this.tabColumns = updateTabColumns;
+        try {
+
+            const { code, rows} = await orderApi.REFER(
+              {
+                type:'WAREHOUSE_PARAM',
+                search:  this.params.warehouseName,
+                isPage: true,
+              }, {pageNum: 1 , pageSize: 10} );
+
+              if(code ==200){
+                this.judgeGoodsAllocation(rows[0].csFlag);
+              }
+
+
+          } catch (error) {
+            
+          }
         this.count++;
     },
     // 查询详细
@@ -150,13 +172,20 @@ export default {
           let rowData = initParams(arr, "key", "value");
 
           "rowno" in rowData &&
-            (rowData["rowno"] = this.params[key].length + 1);
+          (rowData["rowno"] = this.params[key].length ? 
+              this.params[key][this.params[key].length - 1]['rowno'] +1 :
+               this.params[key].length + 1
+            );
            // 物料
            if("rowNo" in rowData){
 
-              rowData["rowNo"] = this.params[key].length + 1;
+            rowData["rowNo"] = this.params[key].length ? 
+              this.params[key][this.params[key].length - 1]['rowNo'] +1 :
+               this.params[key].length + 1;
               // 扣税类别
               rowData["taxDeductClassify"] = '1';
+              // 折本汇率
+              rowData["exchangeRate"] = '1';
               // 价格类型
               rowData["priceType"] = 'order';
               // 币种
@@ -165,8 +194,9 @@ export default {
 
             }
           // 是否完成询价,新增明细行需默认明细为false
-          rowData['whetherCompleteInquiry'] = false;
+          // rowData['whetherCompleteInquiry'] = false;
           rowData['delFlag'] = '0';
+          rowData['insertId'] = new Date().getTime();
 
           this.params[key].push(rowData);
         }
@@ -178,8 +208,8 @@ export default {
       // prop.push(initParams(arr, "key", "value"));
     },
     // 删除行
-    async delTableRow(prop, index) {
-      console.log(prop,'prop');
+    async delTableRow(prop, row) {
+      console.log(row,'row---------------');
       if(prop.length === 1){
         this.$alert('订单行不允许为空', '提示', {
           confirmButtonText: '确定',
@@ -196,10 +226,28 @@ export default {
         for (const key in this.params) {
   
           // if (Array.isArray(this.params[key])) {
+            // params[column.key].filter(item => item.delFlag === '0')
           if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
+
+            this.params[key] = this.params[key].map(item =>{
+              if(item.id && item.id === row.id){
+                console.log('删除已有ID的');
+                item['delFlag'] = '2';
+                return item;
+              }else if(item.insertId && item.insertId === row.insertId){
+                console.log('新增的');
+                return ;
+              }else{
+                return item;
+              }
+            }).filter(item2 => item2 !== undefined)
+           
+            // console.log(this.params[key]);
+            // this.params[key][index].id ? 
+            //   (this.params[key][index]['delFlag'] = '2') :
+            //   this.params[key].splice(index, 1);
   
-            this.params[key][index].id ? (this.params[key][index]['delFlag'] = '2') :this.params[key].splice(index, 1);
-  
+             
           }
         }
   
@@ -232,18 +280,18 @@ export default {
             return false;
           }
 
-          let isPrice =  _this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
+        //   let isPrice =  _this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
 
-         if(isPrice.length){
+        //  if(isPrice.length && this.role === 'procurementManager'){
 
-          _this.$notify.error({
-              title: '错误',
-              message: '询价失败!'
-            });
-            return false
+        //   _this.$notify.error({
+        //       title: '错误',
+        //       message: '询价失败!'
+        //     });
+        //     return false
 
-         }
-         console.log(isPrice,'isPrice');
+        //  }
+        //  console.log(isPrice,'isPrice');
           cb();
 
         } else {
@@ -279,6 +327,17 @@ export default {
     beforeOpen() {
     },
 
+    judgeGoodsAllocation(porp){
+      if(porp === 'Y'){
+        this.rules.goodsAllocationName = [
+          { required: true, message: "货位不能为空", trigger: "change" },
+        ];
+      } else{ 
+        this.rules.goodsAllocationName = null;
+      }
+      this.count++;
+   },
+
      // 主表参照改变之后
    async handleReferChange(val, type, source){
       // 供应商选择  
@@ -306,46 +365,44 @@ export default {
           }
         ]
 
-        await relevanceRefer.forEach(async (refer) =>{
-
-          try {
-
-            const { code, rows} = await orderApi.REFER(
-              {
-                ...refer.params,
-                search: "",
-                isPage: true,
-              }, page );
-
-            if (code === 200) {
-
-              source[refer.key] = rows[0]? rows[0].id :'';
+        try {
 
-              source[`${refer.key}Name`] = rows[0] ? rows[0].name :'';
+          let promiseArr =  relevanceRefer.map( (refer) =>{
+
+            return new Promise((resolve,reject)=>{
+
+              orderApi.REFER(
+                {
+                  ...refer.params,
+                  search: "",
+                  isPage: true,
+                }, page ).then(res=>{
+
+                  let {code,rows} = res;
+                  if (code === 200) {
+                    
+                    source[refer.key] = rows[0]? rows[0].id :'';
+                    
+                    source[`${refer.key}Name`] = rows[0] ? rows[0].name :'';
+                    
+                    resolve();
+                  }
+              })
+            })
+          })
+
+          Promise.all(promiseArr).then(async()=>{
+            // 明细不为空的情况下进行询价
+            let detailList = this.params['puOrderItemList'].filter(item => (
+                item.material && item.material != '' 
+              ))
+              
+              if(detailList.length){
 
-            }
-            
+                await this.handleGetPrice();
+              }
+          })
           } catch (error) {}
-          
-        })
-
-        // 明细不为空的情况下进行询价
-        let detailList = this.params['puOrderItemList'].filter(item => (
-          item.material && item.material != '' 
-        ))
-        
-        if(detailList.length){
-
-          this.params['puOrderItemList'] = this.params['puOrderItemList'].map(item => {
-
-            item['whetherCompleteInquiry'] = false
-
-            return item;
-          });
-
-          await this.handleGetPrice();
-        }
-
       
       }
 
@@ -380,6 +437,14 @@ export default {
 
 
       }
+
+      // WMS仓库
+      if(type === 'WAREHOUSE_PARAM'){
+        this.judgeGoodsAllocation(val.csFlag);
+        source.goodsAllocation = ''
+        source.goodsAllocationName = ''
+        // this.count++
+      }
     },
     // 子表参照改变之后
     async handleTabReferChange(val, type, source) {
@@ -389,7 +454,7 @@ export default {
 
         source['qty'] = 0;
 
-        source['whetherCompleteInquiry'] = false;
+        // source['whetherCompleteInquiry'] = false;
         
         source['taxPrice'] = 0;
 
@@ -415,6 +480,23 @@ export default {
 
       }
 
+      // 物料触发税率
+      if( type == "MATERIAL_PARAM"){
+        let {rateCode} = source;
+        try {
+          // try
+          this.loading = true;
+          const { ntaxrate } = await tax(rateCode);
+          source.tax = ntaxrate === "0E-8" ? 0 : ntaxrate;
+        } catch (err) {
+          // catch
+          console.error(err);
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      }
+
     },
 
     // 子表Select改变之后
@@ -434,7 +516,7 @@ export default {
       // && row.qty
       if(type == 'priceType' && row.material  && row.qty != ""){
 
-        row['whetherCompleteInquiry'] = false;
+        // row['whetherCompleteInquiry'] = false;
 
         this.handleGetPrice();
 
@@ -445,7 +527,7 @@ export default {
 
 
       // 物料数量变化----询价
-      if (type == 'qty' && row.material ) {
+      if ((type == "qty" || type == "taxPrice"  || type == 'taxDeductMoneya') && row.material ) {
 
         if(this.params.status === '2'){
 
@@ -454,9 +536,9 @@ export default {
 
         }else{
 
-          row['whetherCompleteInquiry'] = false;
+          // row['whetherCompleteInquiry'] = false;
 
-          row.qty && this.handleGetPrice();
+          this.handleGetPrice();
 
         }
 
@@ -479,7 +561,7 @@ export default {
       // 勾选赠品,价税合计更新为0,含税单价、无税单价更新为0
       if(type === 'isGift' && source.material && source.qty && source.qty != ""){
 
-        source['whetherCompleteInquiry'] = false;
+        // source['whetherCompleteInquiry'] = false;
 
         this.handleGetPrice()
       }
@@ -487,21 +569,27 @@ export default {
     },
     // 询价 getPrice
     async handleGetPrice() {
-      try {
-        // action:insert(新增)、revise(修订)、update(编辑)
-        let { code, data } = await orderApi.getPrice({
-          ...this.params ,
-          action: this.handleIsRevise() ? 'revise':'update',
-        });
-        if (code == 200) {
-          this.params = data;
-          
-        }
-      } catch (error) {
 
-      } finally {
+      // if(this.role === 'procurementManager'){
+        
+        try {
+          // action:insert(新增)、revise(修订)、update(编辑)
+          let { code, data } = await orderApi.getPrice({
+            ...this.params ,
+            action: this.handleIsRevise() ? 'revise':'update',
+          });
+          if (code == 200) {
+            this.params = data;
+            
+          }
+        } catch (error) {
 
-      }
+        } finally {
+
+        }
+      // }
+
+      
     },
     // 修订——计算金额
     async handleCalculateOrderAmount(){
@@ -612,6 +700,7 @@ export default {
 
       this.download('/pu/order/downloadFailData',{}, `物料信息模板${new Date().getTime()}.xlsx`);
     },
+
   },
   created() {},
   mounted() { },
@@ -878,6 +967,7 @@ export default {
               编辑:自制:可删可增 -->
               <!-- v-if="!handleIsRevise()" -->
               <el-table-column 
+                v-if="!handleIsRevise()"
                 fixed="right" 
                 label="操作" 
                 width="120" >
@@ -885,7 +975,7 @@ export default {
               >
               <!-- v-if="!handleIsRevise()"  -->
                   <el-button 
-                    @click.native.prevent="delTableRow(params[tabName], scope.$index)" 
+                    @click.native.prevent="delTableRow(params[tabName], scope.row)" 
                     type="text" 
                     size="small"
                     > 删行

+ 4 - 1
src/views/purchase/purchase-order/edit/initColumn.js

@@ -1,7 +1,10 @@
-import { Columns, TabColumns } from "../add/column";
+// import { Columns, TabColumns } from "../add/column";
 import { initColumns, initParams } from "@/utils/init/index.js";
 import deepCopy from "@gby/deep-copy";
 // import {deepCopy} from "../dist/deep-copy.es"
+import judgeColumns from "../add/column";
+
+const { Columns, TabColumns } = judgeColumns();
 
 
 export const editColumns = initColumns(Columns);

+ 33 - 6
src/views/purchase/purchase-order/index.vue

@@ -2,8 +2,6 @@
 <script>
 import { TableColumns, SearchColumns, TabColumns, SelectColumns } from "./column";
 import orderApi from "@/api/business/purchase/purchase-order";
-import {saveAs} from "file-saver";
-import { blobValidate } from "@/utils/ruoyi";
 import {
   initPage,
   initParams,
@@ -21,7 +19,7 @@ TabColumns.forEach(column =>{
 export default {
   name: "PuchaseOrder",
   // dicts: initDicts(SelectColumns),
-  dicts: [...initDicts(allColumns)],
+  dicts: [...initDicts(allColumns), 'oa_templete_id'],
   components: {
     AddDrawer: () => import('./add/index.vue'),
     SeeDrawer: () => import('./see/index.vue'),
@@ -374,7 +372,7 @@ export default {
 
             _this.$alert(msg, '提示', {
               showCancelButton: true,
-              confirmButtonText: '置为0并提交',
+              confirmButtonText: '继续提交',
               cancelButtonText: '取消',
               beforeClose: async(action, instance, done) => {
                 if (action === 'confirm') {
@@ -408,7 +406,28 @@ export default {
       })
      
     },
-
+    //流程收回
+    async handleBack(row){
+      console.log('xxxx',this.dict.type)
+      try {
+        const { msg, code } = await orderApi.oaBack({
+          fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+              return item.label == "采购订单"
+            }).value,
+          fdId: row.flowId,
+          billCode: row.code,
+          billMaker: row.createBy
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
+        }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.fetchList(this.params, this.page);
+      }
+    },
     // 判断“整单退回”按钮
     judgeIsAllReturn() {
       if (this.checkedList.length == 1) {
@@ -638,7 +657,9 @@ export default {
       return {
         status,
         fdId:flowId,
-        fdTemplateId:'1880447a834addc648b3763477a9b09f',
+        fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+          return item.label == "采购订单"
+        }).value,
         billCode:code,
         billMaker:createBy,
       }
@@ -757,6 +778,12 @@ export default {
                 @click.stop="handleSubmit(scope.row)"
               >提交</el-button>
               <el-button 
+                v-if="scope.row.status == '1'" 
+                type="text" 
+                size="mini"
+                @click.stop="handleBack(scope.row)"
+              >收回</el-button>
+              <el-button 
                 v-if="scope.row.flowId && scope.row.flowId !== '' && scope.row.status !== '9'" 
                 type="text" 
                 size="mini"

+ 4 - 2
src/views/purchase/purchase-order/see/index.vue

@@ -6,9 +6,12 @@ import {
   initRules,
   initParams,
 } from "@/utils/init/index.js";
-import { Columns, TabColumns } from "../add/column";
+// import { Columns, TabColumns } from "../add/column";
 import orderApi from "@/api/business/purchase/purchase-order";
 import { PRINT } from "@/api/business/purchase/task";
+import judgeColumns from "../add/column";
+
+const { Columns, TabColumns } = judgeColumns();
 
 const NewColumns = initColumns(Columns);
 const NewTabColumns = TabColumns.map((element) => ({
@@ -358,7 +361,6 @@ export default {
                     :placeholder="cColumn.placeholder"
                     :data-mapping="cColumn.dataMapping" 
                     :query-params="cColumn.queryParams" 
-                    size="mini"
                   ></dr-popover-select>
 
                   <el-input-number v-if="cColumn.inputType === 'InputNumber'" 

+ 7 - 13
src/views/purchase/transferOrder/add.vue

@@ -12,7 +12,6 @@
           <el-col :span="1.5">
             <el-form-item label="单据日期">
               <el-date-picker clearable :disabled="sonDisable" v-model="basicForm.billDate" size="mini" type="date"
-                @change="changeBillDate"
                 value-format="yyyy-MM-dd"
                 style="width: 200px"
               >
@@ -115,7 +114,7 @@
             <el-form-item label="利润中心">
               <el-select clearable :disabled="sonDisable"
                 size="mini"
-                v-model="basicForm.liacenter"
+                v-model="basicForm.liacenterName"
                 @clear="clean('利润中心')"
                 @focus="chooseTreeRefer('LIACENTER_PARAM', false, '利润中心')"
                 style="width: 200px"
@@ -401,7 +400,7 @@
                     </el-form-item>
                   </template>
                 </el-table-column>
-                <el-table-column
+                <!-- <el-table-column
                   show-overflow-tooltip
                   label="调拨日期"
                   align="center"
@@ -423,7 +422,7 @@
                       </el-date-picker>
                     </el-form-item>
                   </template>
-                </el-table-column>
+                </el-table-column> -->
                 <el-table-column
                   show-overflow-tooltip
                   label="调拨出库单号"
@@ -1559,12 +1558,6 @@ export default {
     }
   },
   methods: {
-    // 改变单据日期时清空子表的调拨日期
-    changeBillDate() {
-      this.basicForm.materialInfo.forEach((item) => {
-        item.allotDate = null;
-      });
-    },
     // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
     controlCk(val) {
       if (val = '调出库存组织') {console.log("进了吗");}
@@ -1899,7 +1892,7 @@ export default {
         producBatch: null,
         manufactureDate: null,
         periodEndDate: null,
-        allotDate: null,
+        allotDate: new Date(),
         ratifyCode: null,
         registration: null,
         productCode: null,
@@ -2105,9 +2098,10 @@ export default {
       this.$refs.tree.init(this.referCondition);
     },
     selectionsToInput2(selection) {
+      console.log('selection',selection);
       this.liacenterOptions.push(selection);
-      this.basicForm.liacenter = selection.id;
-      this.basicForm.liacenterName = selection.name;
+      this.basicForm.liacenter = selection[0].id;
+      this.basicForm.liacenterName = selection[0].name;
     },
     // 明细行选择物料编码带出数据
     chooseMaterial(index) {

+ 88 - 3
src/views/purchase/transferOrder/index.vue

@@ -72,7 +72,22 @@
 
       
         <div class="btn_grooup">
-          <el-button type="primary" size="mini" @click="addOrder">新增</el-button>
+          <el-button-group>
+            <el-button type="primary" size="mini" @click="addOrder">新增</el-button>
+          </el-button-group>
+          <el-button-group>
+            <el-dropdown @command="btnImport">
+              <el-button type="primary" size="mini">
+                导入<i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-button size="mini" type="primary" @click="useImportTemplate">模板下载</el-button>
+                <el-upload ref="upload" action="" :http-request="onUpload">
+                  <el-button size="mini" type="primary">数据导入</el-button>
+                </el-upload>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-button-group>
         </div>
 
         <el-table 
@@ -136,6 +151,7 @@
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="commit(scope.row)">提交</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '1'" @click="handleBack(scope.row)">流程收回</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
@@ -335,10 +351,10 @@
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import Refers from '@/components/Refers/refers.vue'
-import {getOrderList, delOrder, submitOrder,listStAllotItem } from '@/api/purchase/transferOrder.js'
+import {getOrderList, delOrder, submitOrder,listStAllotItem,importData,oaBack } from '@/api/purchase/transferOrder.js'
 export default {
   name: 'transferOrder',
-  dicts: ['sys_allot_billtype'],
+  dicts: ['sys_allot_billtype', 'oa_templete_id'],
   components: {
     Add,
     CollapseTransition,
@@ -577,6 +593,66 @@ export default {
         this.queryParams.createBy = selection[0].code
       }
     },
+    //导入按钮
+    btnImport(command){
+      if(command == 'useImportTemplate'){
+        this.useImportTemplate();
+      }
+      if(command == 'useImportData'){
+        this.useImportData();
+      }
+    },
+    //模板下载
+    useImportTemplate(){
+      this.download('pu/allot/importTemplate', {
+      }, `调拨单导入模板_${new Date().getTime()}.xlsx`)
+    },
+    //导入
+    useImportData(){
+      console.log("导入");
+    },
+    // 上传文件
+    onUpload (file) {
+      this.loading = true;
+      let formData = new FormData()
+      formData.append('file',file.file)
+      importData(formData).then((res) => {
+        console.log('res',res);
+        if(res.code == '200'){
+          this.$message.success(res.msg);
+        }else{
+          this.$message.success(res.msg);
+        }
+      }).catch((e) => {
+        console.log('e',e);
+        this.$message.error(e.message)
+      }).finally((e) => {
+        this.$refs['upload'].clearFiles();
+        this.resetList();
+        this.loading = false;
+      })
+    },
+    //流程收回
+    async handleBack(row){
+      try {
+        const { msg, code } = await oaBack({
+          fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+            return item.label == "调拨订单"
+          }).value,
+          billCode: row.code,
+          billMaker: row.createBy
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
+        }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.getList(this.queryParams);
+      }
+    },
+
   }
 
 }
@@ -611,4 +687,13 @@ export default {
 .exporttable {
   border: solid 1px #c0c0c0;
  }
+.el-dropdown {
+  vertical-align: top;
+}
+.el-dropdown + .el-dropdown {
+  margin-left: 15px;
+}
+.el-icon-arrow-down {
+  font-size: 12px;
+}
 </style>

+ 209 - 7
src/views/purchase/workSpace/index.vue

@@ -50,7 +50,7 @@
         @row-dblclick="doubleClick"
         ref="tables"
       >
-        <el-table-column type="selection" width="55" />
+        <!-- <el-table-column type="selection" width="55" /> -->
         <el-table-column label="序号" type="index" align="center" width="50px"/>
         <el-table-column show-overflow-tooltip label="标题" align="center" prop="docSubject"/>
         <el-table-column show-overflow-tooltip label="创建人" align="center" prop="docCreate"/>
@@ -78,12 +78,59 @@
         :total=total>
       </el-pagination>
 
+      <el-card class="box-card" style="margin-top: 10px;">
+        <div slot="header" class="clearfix">
+          <span>单据概述</span>
+        </div>
+        <el-table
+          :data="sonTableList" 
+          fit
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          max-height="410"
+          border
+          highlight-current-row
+          style="font-size: 12px;"
+        >
+          <el-table-column label="序号" type="index" align="center" width="50px"/>
+            <el-table-column v-for="(col,index) in cols" :key="index"
+              :prop="col.prop"
+              :label="col.label"
+              :formatter="col.formatter"
+            >
+            </el-table-column>
+          <!-- <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode"/>
+          <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName"/>
+          <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
+          <el-table-column show-overflow-tooltip label="型号" align="center" prop="model"/>
+          <el-table-column show-overflow-tooltip label="单位" align="center" prop="unitName"/>
+          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName"/>
+          <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName"/>
+          <el-table-column show-overflow-tooltip label="调出货位" align="center" prop="deliveryAllocationName"/>
+          <el-table-column show-overflow-tooltip label="数量" align="center" prop="qty"/>
+          <el-table-column show-overflow-tooltip label="调入仓库" align="center" prop="storageWarehouseName"/>
+          <el-table-column show-overflow-tooltip label="调入货位" align="center" prop="storageAllocationName"/> -->
+        </el-table>
+
+        <el-pagination
+          background
+          @size-change="sonSizeChange"
+          @current-change="sonCurrentChange"
+          :current-page="sonQuery.pageNum"
+          :page-sizes="[10, 20, 50, 100, 200, 500]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=sonTotal>
+        </el-pagination>
+      </el-card>
+
     </el-card>
   </div>
 </template>
 
 <script>
-import { getWorkSpaceList, auditWork } from '@/api/purchase/workSpace.js'
+import { getWorkSpaceList, auditWork, getWorkDetailList } from '@/api/purchase/workSpace.js'
 export default {
   name: 'workSpace',
   dicts: ['oa_templete_id'],
@@ -98,7 +145,30 @@ export default {
       loading: false,
       tableList: [],
       total: 0,
-      ids: []
+      ids: [],
+      sonTableList: [],
+      sonQuery: {
+        pageNum: 1,
+        pageSize: 10
+      },
+      sonTotal: 0,
+      checkRow: {
+        billCode: '',
+        type: ''
+      },
+      cols: [
+        {label: '物料编码',  prop: 'materialCode'},
+        {label: '物料名称',  prop: 'materialName'},
+        {label: '规格',  prop: 'specification'},
+        {label: '型号',  prop: 'model'},
+        {label: '单位',  prop: 'unitName'},
+        {label: '生产厂家/代理人',  prop: 'manufacturerName'},
+        {label: '调出仓库',  prop: 'deliveryWarehouseName'},
+        {label: '调出货位',  prop: 'deliveryAllocationName'},
+        {label: '数量',  prop: 'qty'},
+        {label: '调入仓库',  prop: 'storageWarehouseName'},
+        {label: '调入货位',  prop: 'storageAllocationName'},
+      ]
     }
   },
   created() {
@@ -134,11 +204,113 @@ export default {
       this.ids = selection
       // console.log('选中数组', this.ids.join())
     },
-    rowSelect(row) {
-      this.$refs.tables.toggleRowSelection(row);
-    },
     doubleClick(row) {
-      this.check(row)
+      // this.$refs.tables.toggleRowSelection(row);
+      this.rowSelect(row)
+    },
+    rowSelect(row) {
+      // this.check(row)
+      // 选择行存储便于子表分页
+      this.checkRow = row
+      // 采购需求单
+      if(row.type == 'PU_DEMAND_RULE') {
+        this.cols = [
+          {label: '物料编码',  prop: 'materialCode'},
+          {label: '物料名称',  prop: 'materialName'},
+          {label: '规格',  prop: 'specification'},
+          {label: '型号',  prop: 'model'},
+          {label: '单位',  prop: 'unitName'},
+          {label: '生产厂家/代理人',  prop: 'manufacturerName'},
+          {label: '实际(业务)需求量',  prop: 'qty'},
+          {label: '月均销量',  prop: 'averageQtyMonth'},
+          {label: '需求可用周期',  prop: 'demandPeriod'},
+          {label: '业务备注',  prop: 'remark'},
+          {label: '紧急标识',  prop: 'isUrgency',
+            formatter: function(row, column, cellValue, index) {
+              return row.isUrgency == 'Y' ? '是' : '否'
+            }
+          },
+          {label: '补单标识',  prop: 'isReplenishment',
+            formatter: function(row, column, cellValue, index) {
+              return row.isReplenishment == 'Y' ? '是' : '否'
+            }
+          },
+        ]
+        // 调拨订单
+      } else if (row.type == 'ALLOT_RULE') {
+        this.cols = [
+          {label: '物料编码',  prop: 'materialCode'},
+          {label: '物料名称',  prop: 'materialName'},
+          {label: '规格',  prop: 'specification'},
+          {label: '型号',  prop: 'model'},
+          {label: '单位',  prop: 'unitName'},
+          {label: '生产厂家/代理人',  prop: 'manufacturerName'},
+          {label: '调出仓库',  prop: 'deliveryWarehouseName'},
+          {label: '调出货位',  prop: 'deliveryAllocationName'},
+          {label: '数量',  prop: 'qty'},
+          {label: '调入仓库',  prop: 'storageWarehouseName'},
+          {label: '调入货位',  prop: 'storageAllocationName'},
+        ]
+        // 物料申请单
+      } else if (row.type == 'MATERIAL_APPLY_RULE') {
+        this.cols = [
+          {label: '物料一级分类',  prop: 'classOneName'},
+          {label: '物料基本分类',  prop: 'classifyName'},
+          {label: '物料名称',  prop: 'materialName'},
+          {label: '型号',  prop: 'model'},
+          {label: '规格',  prop: 'specification'},
+          {label: '生产厂家/代理人',  prop: 'manufacturerName'},
+          {label: '注册证号',  prop: 'registrationNo'},
+          {label: '注册人',  prop: 'registrant'},
+          {label: '存储条件',  prop: 'storageCondition'},
+          {label: '运输条件',  prop: 'transportationCondition'},
+          {label: '是否医药物料',  prop: 'isMedicine',
+            formatter: function(row, column, cellValue, index) {
+              return row.isMedicine == '0' ? '是' : '否'
+            }
+          },
+          {label: '是否药品',  prop: 'isDrug',
+            formatter: function(row, column, cellValue, index) {
+              return row.isDrug == '0' ? '是' : '否'
+            }
+          },
+        ]
+        // 价格申报单
+      } else if (row.type == 'PU_PRICE_APPLY_RULE') {
+        this.cols = [
+          {label: '物料编码',  prop: 'materialCode'},
+          {label: '物料名称',  prop: 'materialName'},
+          {label: '型号',  prop: 'model'},
+          {label: '规格',  prop: 'specification'},
+          {label: '生产厂家/代理人',  prop: 'manufacturerName'},
+          {label: '含税单价',  prop: 'taxPrice'},
+          {label: '最近价格',  prop: 'recentlyPrice'},
+          {label: '单价差',  prop: 'priceDiffer'},
+          {label: '客户',  prop: 'customerName'},
+          {label: '供应商名称1',  prop: 'supplierName1'},
+          {label: '单价1',  prop: 'unitPrice1'},
+        ]
+        // 采购订单
+      } else if (row.type == 'PU_ORDER_RULE') {
+        this.cols = [
+          {label: '收货客户',  prop: 'customerName'},
+          {label: '物料编码',  prop: 'materialCode'},
+          {label: '物料名称',  prop: 'materialName'},
+          {label: '生产厂家',  prop: 'manufacturerName'},
+          {label: '医药物料',  prop: 'isMedcine'},
+          {label: '数量',  prop: 'qty'},
+          {label: '含税单价',  prop: 'taxPrice'},
+          {label: '价税合计',  prop: 'money'},
+          {label: '赠品',  prop: 'isGift',
+            formatter: function(row, column, cellValue, index) {
+              return row.isGift == 'Y' ? '是' : '否'
+            }        
+          },
+          {label: '折扣%',  prop: 'nitemdiscountrate'},
+          {label: '价格类型',  prop: 'priceType'},
+        ]
+      }
+      this.getDetailList(this.checkRow)
     },
     audits() {
       if(this.ids.length == 0) {
@@ -151,11 +323,13 @@ export default {
             this.$modal.closeLoading();
             this.$modal.notifySuccess("审批成功");
             this.searchList()
+            this.sonTableList = []
           }
         })
         }).catch(() => {
           this.$modal.closeLoading();
           this.searchList()
+          this.sonTableList = []
         })
       } 
     },
@@ -170,10 +344,12 @@ export default {
           this.$modal.closeLoading();
           this.$modal.notifySuccess("审批成功");
           this.searchList()
+          this.sonTableList = []
         }
       }).catch(() => {
         this.$modal.closeLoading();
         this.searchList()
+        this.sonTableList = []
       })
     },
     handleSizeChange(val) {
@@ -184,6 +360,32 @@ export default {
       this.queryParams.pageNum = val
       this.getList(this.queryParams)
     },
+    sonSizeChange(val) {
+      this.sonQuery.pageSize = val
+      this.getDetailList(this.checkRow)
+    },
+    sonCurrentChange(val) {
+      this.sonQuery.pageNum = val
+      this.getDetailList(this.checkRow)
+    },
+    // 获取单据概述列表
+    getDetailList (row) {
+      this.$modal.loading("加载中...");
+      let param = {
+        billCode: row.billCode,
+        type: row.type,
+        ...this.sonQuery
+      }
+      getWorkDetailList(param).then(res => {
+        if(res.code === 200) {
+          this.sonTableList = res.rows
+          this.sonTotal = res.total
+          this.$modal.closeLoading();
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
   }
 }
 </script>

+ 8 - 2
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-       target: `http://test-sy.derom.com/drp-admin`, //测试
+        target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
@@ -54,7 +54,7 @@ module.exports = {
         },
       },
       "/drp-file": {
-        target: `https://test-sy.derom.com`,
+        target: `https://sy.derom.com`,
         changeOrigin: true,
         pathRewrite: { [`^/drp-file`]: "" },
       },
@@ -64,6 +64,12 @@ module.exports = {
         changeOrigin: true,
         pathRewrite: { [`^/sy-derom`]: "" },
       },
+      // 打卡人数跨域配置
+      "/data-service-center": {
+        target: `https://sy.derom.com`,
+        ws: true,
+        changeOrigin: true,
+      }
     },
     disableHostCheck: true,
   },

部分文件因文件數量過多而無法顯示