فهرست منبع

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!561
黄梓星 1 سال پیش
والد
کامیت
f0e92766e0
34فایلهای تغییر یافته به همراه4378 افزوده شده و 5199 حذف شده
  1. 15 0
      src/api/purchase/equipmentData.js
  2. 2 0
      src/components/BatchImport/index.vue
  3. 0 208
      src/components/PopDialog/index2.vue
  4. 34 35
      src/components/popover-select-v2/index.vue
  5. 45 0
      src/components/popover-select/components/MANUFACTURER_PARAM.js
  6. 10 0
      src/components/popover-select/components/MATERIALTAX_PARAM.js
  7. 10 0
      src/components/popover-select/components/ORIGINPLACE_PARAM.js
  8. 44 23
      src/components/popover-tree-select/index.vue
  9. 2 0
      src/components/super-form/index.vue
  10. 1 1
      src/components/super-ux-table/index.vue
  11. 6 6
      src/router/index.js
  12. 49 45
      src/views/material/basicFile/details.vue
  13. 408 248
      src/views/material/basicFile/index.vue
  14. 12 2
      src/views/material/requisition/add.vue
  15. 0 960
      src/views/material/requisition/add/columns.js
  16. 0 336
      src/views/material/requisition/add/index.vue
  17. 11 5
      src/views/material/requisition/columns.js
  18. 0 82
      src/views/material/requisition/details.vue
  19. 951 0
      src/views/material/requisition/details/columns.js
  20. 771 0
      src/views/material/requisition/details/index.vue
  21. 14 0
      src/views/material/requisition/dicts.js
  22. 504 363
      src/views/material/requisition/index copy.vue
  23. 258 448
      src/views/material/requisition/index.vue
  24. 0 1816
      src/views/purchase/PurchaseDemandList/add_bak.vue
  25. 874 0
      src/views/purchase/PurchaseDemandList/index-bak.vue
  26. 58 31
      src/views/purchase/PurchaseDemandList/index.vue
  27. 24 168
      src/views/purchase/apply/add/index.vue
  28. 24 168
      src/views/purchase/apply/copy/index.vue
  29. 24 168
      src/views/purchase/apply/edit/index.vue
  30. 180 38
      src/views/purchase/equipmentData/add.vue
  31. 15 30
      src/views/purchase/equipmentData/index.vue
  32. 2 2
      src/views/purchase/purchase-order/column.js
  33. 28 14
      src/views/purchase/task/columns.js
  34. 2 2
      vue.config.js

+ 15 - 0
src/api/purchase/equipmentData.js

@@ -16,4 +16,19 @@ export function downLoadMb(data) {
     data: data,
     responseType: 'blob'
   })
+}
+// 设备产品数据库新增
+export function addEquipment(data) {
+  return request({
+    url: `/device/origin`,
+    method: 'post',
+    data: data
+  })
+}
+// 设备产品数据库详情
+export function getEquipmentDetail(id) {
+  return request({
+    url: `/device/origin/${id}`,
+    method: 'get',
+  })
 }

+ 2 - 0
src/components/BatchImport/index.vue

@@ -139,6 +139,8 @@ export default {
     :size="size"
     @click="open"
     type="primary"
+    v-bind="$attrs"
+    v-on="$listeners"
   >
     {{ title }}
     <el-dialog 

+ 0 - 208
src/components/PopDialog/index2.vue

@@ -1,208 +0,0 @@
-<template>
-  <div>
-    <el-dialog title="物料编码选择" width="1000px" :close-on-click-modal="false" :append-to-body="true" v-dialogDrag
-      class="userDialog" :visible.sync="visible">
-      <el-container style="height: 500px">
-        <el-container>
-          <el-header style="text-align: left; font-size: 12px; height: 30px">
-            <el-form size="small" :inline="true" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()"
-              @submit.native.prevent>
-              <el-form-item prop="code">
-                <el-input size="small" v-model.trim="searchForm.code" placeholder="请输入物料编号查询" clearable></el-input>
-              </el-form-item>
-              <el-form-item prop="name">
-                <el-input size="small" v-model="searchForm.name" placeholder="请输入物料名称查询" clearable></el-input>
-              </el-form-item>
-              <el-form-item>
-                <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
-                <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
-              </el-form-item>
-            </el-form>
-          </el-header>
-          <el-main>
-            <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable"
-              @select="handleSelectionChange" :selection="selectedRows"  height="calc(100% - 40px)" style="width: 100%">
-              <el-table-column type="selection" header-align="center" align="center" width="50">
-              </el-table-column>
-              <el-table-column prop="code" header-align="center" align="center" sortable="custom" min-width="90"
-                label="物料编码">
-              </el-table-column>
-              <el-table-column prop="name" header-align="center" align="center" sortable="custom" min-width="90"
-                label="物料名称">
-              </el-table-column>
-              <el-table-column prop="specification" header-align="center" align="center" sortable="custom" min-width="90"
-                label="规格">
-              </el-table-column>
-              <el-table-column prop="model" header-align="center" align="center" sortable="custom" min-width="90"
-                label="型号">
-              </el-table-column>
-              <el-table-column prop="manufacturerIdName" header-align="center" align="center" sortable="custom" min-width="90"
-                label="生产厂家">
-              </el-table-column>
-            </el-table>
-
-            <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
-              :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
-              :total="total" layout="total, sizes, prev, pager, next, jumper">
-            </el-pagination>
-          </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 axios from 'axios'
-import { getMaterialList } from '@/api/changeApply/basic'
-export default {
-  data() {
-    return {
-      searchForm: {
-        code: '',
-        name: '',
-        isSync: '',
-        pageNo: 1,
-        pageSize: 10,
-      },
-      dataListAllSelections: [], // 所有选中的数据包含跨页数据
-      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
-      dataList: [],
-      total: 0,
-      orders: [],
-      loading: false,
-      visible: false,
-      selectedRows:[]
-    };
-  },
-  props: {
-    selectData: {
-      type: Array,
-      default: () => {
-        return [];
-      },
-    },
-    // 是否启用单选
-    single: {
-      type: Boolean,
-      default: true
-    }
-  },
-  methods: {
-    init(val) {
-      this.visible = true;
-      this.searchForm.isSync = val
-      this.$nextTick(() => {
-        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
-        this.resetSearch();
-      });
-    },
-    // 获取数据列表
-    refreshList() {
-      this.loading = true;
-      // axios({
-      //   url: "http://172.16.62.241:8000/drp-admin/system/material/list", // 自己的接口路径
-      //   method: "post",
-      //   data: {
-      //     // current: this.pageNo,
-      //     size: this.pageSize,
-      //     // orders: this.orders,
-      //     // ...this.searchForm,
-      //   },
-      let params = {
-        ...this.searchForm,
-        // 默认查询已启用
-        isEnable: '0'
-      }
-      getMaterialList(params).then(({ data }) => {
-        console.log('data', data)
-        this.dataList = data.tableBody.rows;
-        this.total = data.tableBody.total;
-        this.loading = false;
-        this.$nextTick(() => {
-          this.setSelectRow();
-        });
-      });
-    },
-    // 每页数
-    sizeChangeHandle(val) {
-      console.log('每页数:', val)
-      this.searchForm.pageSize = val;
-      this.refreshList();
-    },
-    // 当前页
-    currentChangeHandle(val) {
-      console.log('当前页:', val)
-      this.searchForm.pageNo = val;
-      this.refreshList();
-    },
-    // 排序
-    resetSearch() {
-      this.$refs['searchForm'].resetFields();
-      this.searchForm.pageNo = 1;
-      this.refreshList();
-    },
-    watchSel(rows) {
-      console.log('监听得到选中吗', rows)
-      this.dataListAllSelections = rows
-    },
-    // 表格选中数据
-    rowSelect(row) {
-      // this.$refs.contractTable.clearSelection();
-      // this.$refs.contractTable.toggleRowSelection(row);
-      // this.dataListAllSelections = this.single ? [row] : selection
-      this.$refs.contractTable.toggleRowSelection(row);
-    },
-    // 选中数据
-    handleSelectionChange(selection, row) {
-      console.log('selection',selection)
-      console.log('row',[row])
-      if (this.single && selection.length > 1) {
-        this.$refs.contractTable.clearSelection();
-        this.$refs.contractTable.toggleRowSelection(row);
-      }
-      this.dataListAllSelections = this.single ? [row] : selection
-    },
-    // 设置选中的方法
-    setSelectRow() {
-      this.$refs.contractTable.clearSelection();
-      if (!this.dataListAllSelections || this.dataListAllSelections.length <= 0) {
-        return;
-      }
-      for (let i = 0; i < this.dataList.length; i++) {
-        if (this.dataListAllSelections.some(item => item[this.idKey] == this.dataList[i][this.idKey])) {
-          // 设置选中,记住table组件需要使用ref="table"
-          this.$refs.contractTable.toggleRowSelection(this.dataList[i], true);
-        }
-      }
-    },
-    doSubmit() {
-      this.visible = false;
-      console.log('选择的数据?', this.dataListAllSelections)
-      this.$emit("doSubmit", this.dataListAllSelections);
-    },
-  },
-};
-</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>

+ 34 - 35
src/components/popover-select-v2/index.vue

@@ -6,7 +6,7 @@ export default {
   props: {
     // v-model
     value: {
-      type: [Array, String,Number],
+      type: [Array, String, Number],
       require: true,
     },
     // 参照类型 ,对应后端
@@ -49,11 +49,15 @@ export default {
       },
     },
     // 赋值
-    copy:{
-      type:Boolean,
-      default:() =>{
-        return false
-      }
+    copy: {
+      type: Boolean,
+      default: () => {
+        return false;
+      },
+    },
+    clearable: {
+      type: Boolean,
+      default: true,
     },
   },
   components: {
@@ -134,23 +138,18 @@ export default {
         if (code === 200) {
           this.data = rows;
 
-
           // 处理新增字段无法映射
           let that = this;
 
-          this.TableColumns.forEach(({item,attr}) =>{
-
-            that.data = that.data.map(d =>{
-
-              if(!attr.is && attr.formatter){
+          this.TableColumns.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;
         }
@@ -209,7 +208,6 @@ export default {
           }),
           this.$props
         );
-
       } else {
         for (let key in dataMapping) {
           source[key] = prop[0][dataMapping[key]];
@@ -219,27 +217,24 @@ export default {
         this.$emit("change", prop[0], this.$props);
       }
     },
-    async handleChange(){
+    async handleChange() {
       // 物料赋值'MATERIAL_PARAM'
-      const { referName} = this.$props;
+      const { referName } = this.$props;
 
       let materialCodeList = this.innerValue.split(/,|,|\s+/);
-      
+
       try {
-        let { code, rows } = await REFER( {
-            materialCodeList,
-            type:referName,
-          })
-        if(code == 200){
+        let { code, rows } = await REFER({
+          materialCodeList,
+          type: referName,
+        });
+        if (code == 200) {
           this.$emit("change", rows, this.$props);
         }
-      } catch (error) {
-        
-      }
-      
+      } catch (error) {}
     },
-    handleClear(){
-      this.innerValue = '';
+    handleClear() {
+      this.innerValue = "";
     },
   },
   created() {},
@@ -252,7 +247,7 @@ export default {
   <div class="popover-select-v2">
     <el-input
       v-if="copy"
-      clearable
+      :clearable="clearable"
       v-bind="$attrs"
       v-model="innerValue"
       :size="size"
@@ -264,7 +259,7 @@ export default {
     </el-input>
     <el-autocomplete
       v-else
-      clearable
+      :clearable="clearable"
       v-bind="$attrs"
       v-model="innerValue"
       :value-key="valueKey"
@@ -322,8 +317,12 @@ export default {
               </el-input>
             </el-form-item>
             <el-form-item>
-              <el-button icon="el-icon-search" @click="useQuery">搜索</el-button>
-              <el-button icon="el-icon-refresh" @click="useReset">重置</el-button>
+              <el-button icon="el-icon-search" @click="useQuery"
+                >搜索</el-button
+              >
+              <el-button icon="el-icon-refresh" @click="useReset"
+                >重置</el-button
+              >
             </el-form-item>
           </div>
         </el-form>

+ 45 - 0
src/components/popover-select/components/MANUFACTURER_PARAM.js

@@ -8,4 +8,49 @@ export default [
     item: { key: "name", title: "名称", width: "auto" },
     attr: {},
   },
+  {
+    item: { key: "registrantName", title: "注册人/上市许可持有人", width: "auto" },
+    attr: {
+      type:'ComputedInput',
+      formatter: (prop) => {
+        return prop.manufacturerOther != null ? prop.manufacturerOther.registrantName : null;
+      },
+    },
+  },
+  {
+    item: { key: "productionLicense", title: "生产许可证号/备案凭证号", width: "auto" },
+    attr: {
+      type:'ComputedInput',
+      formatter: (prop) => {
+        return prop.manufacturerOther != null ? prop.manufacturerOther.productionLicense : null;
+      },
+    },
+  },
+  {
+    item: { key: "brand", title: "品牌", width: "auto" },
+    attr: {
+      type:'ComputedInput',
+      formatter: (prop) => {
+        return prop.manufacturerOther != null ? prop.manufacturerOther.brand : null;
+      },
+    },
+  },
+  {
+    item: { key: "countryName", title: "产地", width: "auto" },
+    attr: {
+      type:'ComputedInput',
+      formatter: (prop) => {
+        return prop.manufacturerOther != null ? prop.manufacturerOther.countryName : null;
+      },
+    },
+  },
+  {
+    item: { key: "countryId", title: "产地ID", width: "auto" },
+    attr: {
+      type:'ComputedInput',
+      formatter: (prop) => {
+        return prop.manufacturerOther != null ? prop.manufacturerOther.countryId : null;
+      },
+    },
+  },
 ];

+ 10 - 0
src/components/popover-select/components/MATERIALTAX_PARAM.js

@@ -0,0 +1,10 @@
+export default [
+  {
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
+  },
+  {
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
+  },
+];

+ 10 - 0
src/components/popover-select/components/ORIGINPLACE_PARAM.js

@@ -0,0 +1,10 @@
+export default [
+  {
+    item: { key: "code", title: "编码" , width: "auto"},
+    attr: {},
+  },
+  {
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
+  },
+];

+ 44 - 23
src/components/popover-tree-select/index.vue

@@ -36,6 +36,19 @@ export default {
       type: Object,
       default: () => ({}),
     },
+    defaultProps: {
+      type: Object,
+      default: () => {
+        return {
+          label: "name",
+          children: "children",
+        };
+      },
+    },
+    onlyFinal: {
+      type: Boolean,
+      default: false,
+    },
   },
   components: {},
   data() {
@@ -48,12 +61,13 @@ export default {
         search: "",
         isPage: false,
       },
+      isSure: true,
       data: [],
       selectData: [],
-      defaultProps: {
-        label: "name",
-        children: "children",
-      },
+      // defaultProps: {
+      //   label: "name",
+      //   children: "children",
+      // },
     };
   },
   computed: {
@@ -140,6 +154,9 @@ export default {
     },
     // select
     useSelect(prop) {
+      if (this.$props.onlyFinal) {
+        this.isSure = prop.children ? false : true;
+      }
       this.selectData = [prop];
     },
     // filter
@@ -149,20 +166,26 @@ export default {
     },
     // confirm
     useConfirm(prop) {
-      this.hide();
-      const {
-        $props: { source, valueKey, dataMapping },
-      } = this;
-      for (let key in dataMapping) {
-        source[key] = prop[0][dataMapping[key]];
+      if (this.isSure) {
+        this.hide();
+        const {
+          $props: { source, valueKey, dataMapping },
+        } = this;
+        for (let key in dataMapping) {
+          source[key] = prop[0][dataMapping[key]];
+        }
+        this.innerValue = prop[0][valueKey];
+        console.log(valueKey, "valueKey");
+        console.log(prop[0][valueKey], "prop[0][valueKey]");
+        console.log(this.innerValue, "innerValue");
+        console.log(source, "source");
+        this.$emit("update:source", source);
+        this.$emit("change", prop, this.$props);
+      } else {
+        this.$message.warning({
+          message: "请选择最末级节点",
+        });
       }
-      this.innerValue = prop[0][valueKey];
-      console.log(valueKey,'valueKey');
-      console.log(prop[0][valueKey],'prop[0][valueKey]');
-      console.log(this.innerValue,'innerValue');
-      console.log(source,'source');
-      this.$emit("update:source", source);
-      this.$emit("change", prop, this.$props);
     },
   },
   created() {},
@@ -212,7 +235,7 @@ export default {
       :close-on-click-modal="false"
       :close-on-press-escape="false"
       append-to-body
-      style="padding: 10px;"
+      style="padding: 10px"
     >
       <div slot="footer">
         <el-button
@@ -225,7 +248,6 @@ export default {
         <el-button :size="$attrs.size" :loading="loading" @click="hide"
           >取 消</el-button
         >
-        
       </div>
       <el-form
         v-loading="loading"
@@ -240,8 +262,8 @@ export default {
         <el-form-item>
           <el-button icon="el-icon-refresh" @click="useReset"></el-button>
         </el-form-item>
-        <div style="height: 400px;overflow: auto;">
-          <el-tree          
+        <div style="height: 400px; overflow: auto">
+          <el-tree
             v-loading="loading"
             :data="data"
             :props="defaultProps"
@@ -257,5 +279,4 @@ export default {
     </el-dialog>
   </div>
 </template>
-<style scoped>
-</style>
+<style scoped></style>

+ 2 - 0
src/components/super-form/index.vue

@@ -102,6 +102,7 @@ export default {
           :label="item.title"
           :required="getFormItemRequired(item, innerValue)"
         >
+        <template #default="form">
           <slot :name="item.key" :row="innerValue" :item="item" :attr="attr">
             <component
               v-if="attr.is === 'el-select'"
@@ -162,6 +163,7 @@ export default {
             >
             </component>
           </slot>
+        </template>
         </el-form-item>
       </el-col>
     </el-row>

+ 1 - 1
src/components/super-ux-table/index.vue

@@ -400,7 +400,7 @@ export default {
       <ux-table-column
         v-if="checkbox"
         fixed="left"
-        width="60"
+        width="50"
         align="center"
         type="checkbox"
         resizable

+ 6 - 6
src/router/index.js

@@ -138,13 +138,13 @@ export const constantRoutes = [
     component: Layout,
     hidden: true,
     // permissions:['system:material:query'],
-    children: [
-      {
-        path: `detail`,
-        component: () => import('@/views/material/requisition/details')
-      }
+    // children: [
+    //   {
+    //     path: `detail`,
+    //     component: () => import('@/views/material/requisition/details')
+    //   }
 
-    ]
+    // ]
   },
   // 物料基础信息
   {

+ 49 - 45
src/views/material/basicFile/details.vue

@@ -18,7 +18,7 @@
             <el-col :span="1.5">
               <el-button-group>
                 <el-button
-                  size="small"
+                  :size="size"
                   @click="handleSave"
                   v-hasPermi="[
                     'system:material:add',
@@ -32,7 +32,7 @@
 
             <el-col :span="1.5">
               <el-button-group>
-                <el-button size="small" @click="handleCancel">取消</el-button>
+                <el-button :size="size" @click="handleCancel">取消</el-button>
               </el-button-group>
             </el-col>
           </el-row>
@@ -41,30 +41,30 @@
             <!-- 新增、修改、删除、复制 -->
             <el-col :span="1.5">
               <el-button-group>
-                <!-- <el-button size="small" @click="handleInster">新增</el-button> -->
-                <el-button size="small" @click="handleBasicEdit"
+                <!-- <el-button :size="size" @click="handleInster">新增</el-button> -->
+                <el-button :size="size" @click="handleBasicEdit"
                   >修改</el-button
                 >
-                <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
-                <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
+                <!-- <el-button :size="size" @click="handleDel">删除</el-button> -->
+                <!-- <el-button :size="size" @click="handleCopy">复制</el-button> -->
               </el-button-group>
             </el-col>
 
             <!-- 查询、刷新、过滤 -->
             <el-col :span="1.5">
               <el-button-group>
-                <el-button size="small" @click="handleRefresh">刷新</el-button>
+                <el-button :size="size" @click="handleRefresh">刷新</el-button>
               </el-button-group>
             </el-col>
 
             <!-- 启用 -->
             <el-col :span="1.5">
               <el-button-group>
-                <el-button size="small" @click="handleMaterialType"
+                <el-button :size="size" @click="handleMaterialType"
                   >维护物料类别</el-button
                 >
                 <el-button
-                  size="small"
+                  :size="size"
                   @click="handleIsInvoke"
                   :key="count"
                   v-hasPermi="['system:material:add']"
@@ -79,7 +79,7 @@
             <el-col :span="1.5">
               <el-button-group>
                 <el-button
-                  size="small"
+                  :size="size"
                   @click="handleNewVersion"
                   v-hasPermi="['system:material:versions']"
                   >维护新版本
@@ -99,18 +99,18 @@
         >
           <el-col :span="1.5">
             <el-button-group>
-              <el-button size="small" @click="handleOtherEdit('table')"
+              <el-button :size="size" @click="handleOtherEdit('table')"
                 >修改</el-button
               >
               <el-button
-                size="small"
+                :size="size"
                 v-show="activeMainTab != 'material_finance'"
                 @click="handleOtherDel"
                 >删除</el-button
               >
             </el-button-group>
             <el-button-group>
-              <el-button size="small" @click="handleOtherListRefresh"
+              <el-button :size="size" @click="handleOtherListRefresh"
                 >刷新</el-button
               >
             </el-button-group>
@@ -122,7 +122,7 @@
           <el-col :span="6">
             <!-- :disabled="headerParam.isEdit" -->
             <el-button
-              size="small"
+              :size="size"
               @click="handleBack"
               :disabled="updateButtonGroup"
               >返回</el-button
@@ -303,6 +303,7 @@
                             v-model="basicData.value[f.prop]"
                             :type="f.attribute || 'text'"
                             :readonly="handleJudge(f)"
+                            :rows="1"
                             :maxlength="judgeMaxLength(f.prop)"
                           ></el-input>
                         </el-form-item>
@@ -488,6 +489,7 @@
                                 size="mini"
                                 v-model="medcineData.value[m.prop]"
                                 :type="m.attribute || 'text'"
+                                :rows="1"
                                 :readonly="
                                   !(
                                     updateButtonGroup &&
@@ -644,13 +646,13 @@
         <el-col :span="1.5">
           <el-button-group>
             <el-button
-              size="small"
+              :size="size"
               :disabled="!materialType.isEdit"
               @click="handleMaterialTypeRow('add')"
               >增行
             </el-button>
             <el-button
-              size="small"
+              :size="size"
               :disabled="!materialType.isEdit"
               @click="handleMaterialTypeRow('del')"
               >删行
@@ -658,18 +660,18 @@
           </el-button-group>
           <el-button-group>
             <el-button
-              size="small"
+              :size="size"
               @click="handleMaterialTypeRow('edit')"
               v-hasPermi="['system:material:add']"
               >{{ materialType.isEdit ? "保存" : "修改" }}
             </el-button>
             <el-button
-              size="small"
+              :size="size"
               v-if="materialType.isEdit"
               @click="handleMaterialTypeRow('cancal')"
               >取消</el-button
             >
-            <el-button size="small" @click="handleMaterialTypeRow"
+            <el-button :size="size" @click="handleMaterialTypeRow"
               >刷新</el-button
             >
           </el-button-group>
@@ -774,21 +776,21 @@
         <el-row :gutter="10" class="mb10" type="flex" justify="end">
           <el-col :span="1.5" v-if="!otherDeatils.isEdit">
             <el-button-group>
-              <el-button size="small" @click="handleOtherEdit('form')"
+              <el-button :size="size" @click="handleOtherEdit('form')"
                 >修改</el-button
               >
-              <!-- <el-button size="small" @click="handleOtherDel">删除</el-button> -->
+              <!-- <el-button :size="size" @click="handleOtherDel">删除</el-button> -->
             </el-button-group>
             <el-button-group>
-              <el-button size="small" @click="handleOtherRefresh"
+              <el-button :size="size" @click="handleOtherRefresh"
                 >刷新</el-button
               >
             </el-button-group>
           </el-col>
           <el-col :span="1.5" v-else>
             <el-button-group>
-              <el-button size="small" @click="handleOtherSave">保存</el-button>
-              <el-button size="small" @click="handleOtherCancel"
+              <el-button :size="size" @click="handleOtherSave">保存</el-button>
+              <el-button :size="size" @click="handleOtherCancel"
                 >取消</el-button
               >
             </el-button-group>
@@ -805,21 +807,21 @@
               <el-form-item label="物料编码">
                 <el-input
                   v-model="basicData.value.code"
-                  size="small"
+                  :size="size"
                   readonly
                 ></el-input>
               </el-form-item>
               <el-form-item label="物料名称">
                 <el-input
                   v-model="basicData.value.name"
-                  size="small"
+                  :size="size"
                   readonly
                 ></el-input>
               </el-form-item>
               <el-form-item label="英文名称">
                 <el-input
                   v-model="basicData.value.enName"
-                  size="small"
+                  :size="size"
                   readonly
                 ></el-input>
               </el-form-item>
@@ -915,7 +917,7 @@
                       <!--attribute 文本 数字 文本域 为null -->
                       <el-form-item v-else :label="f.name">
                         <el-input
-                          size="small"
+                          :size="size"
                           v-model="otherDeatils.value[f.prop]"
                           :type="f.attribute || 'text'"
                           :readonly="!(otherDeatils.isEdit && f.edit)"
@@ -939,28 +941,28 @@
                 <el-form-item label="创建人">
                   <el-input
                     v-model="basicData.value.createByName"
-                    size="small"
+                    :size="size"
                     readonly
                   ></el-input>
                 </el-form-item>
                 <el-form-item label="创建时间">
                   <el-input
                     v-model="basicData.value.createTime"
-                    size="small"
+                    :size="size"
                     readonly
                   ></el-input>
                 </el-form-item>
                 <el-form-item label="最后修改人">
                   <el-input
                     v-model="basicData.value.updateByName"
-                    size="small"
+                    :size="size"
                     readonly
                   ></el-input>
                 </el-form-item>
                 <el-form-item label="最后修改时间">
                   <el-input
                     v-model="basicData.value.updateTime"
-                    size="small"
+                    :size="size"
                     readonly
                   ></el-input>
                 </el-form-item>
@@ -1060,12 +1062,12 @@
         <el-row class="more-button">
           <el-button
             round
-            size="small"
+            :size="size"
             type="primary"
             @click="handleConfirmRefer"
             >确认</el-button
           >
-          <el-button round size="small" @click="handleConcalRefer"
+          <el-button round :size="size" @click="handleConcalRefer"
             >取消</el-button
           >
         </el-row>
@@ -2596,13 +2598,15 @@ export default {
       // diCode
       param.diCode = param.diCode && param.diCode.replace(/ /g, "");
       console.log(param, "保存物料以及相关页签param");
-      materialApi.insertMaterialInfo(param).then((res) => {
-        console.log(res, "保存物料以及相关页签");
-        if (res.code == 200) cb();
-      })
-      .catch((error) => {
-        this.loading = false;
-      });
+      materialApi
+        .insertMaterialInfo(param)
+        .then((res) => {
+          console.log(res, "保存物料以及相关页签");
+          if (res.code == 200) cb();
+        })
+        .catch((error) => {
+          this.loading = false;
+        });
     },
     // 保存财务信息——单个数据
     async handleSaveFinance(data) {
@@ -2943,9 +2947,9 @@ export default {
   }
 
   .md-content {
-    margin-top: 12px;
+    // margin-top: 12px;
     // height: calc(100vh - 260px);
-    height: calc(100vh - 228px);
+    // height: calc(100vh - 200px);
     box-sizing: border-box;
 
     .md-basic {
@@ -2960,7 +2964,7 @@ export default {
         }
 
         .el-form {
-          max-height: 350px;
+          max-height: 430px;
           overflow-y: auto;
           overflow-x: hidden;
 
@@ -3085,7 +3089,7 @@ export default {
 <style scoped>
 .md-content >>> .el-form-item,
 .otherDialog >>> .el-form-item {
-  margin-bottom: 10px;
+  margin-bottom: 0px;
 }
 
 .md-content >>> .el-tabs--border-card > .el-tabs__content {

+ 408 - 248
src/views/material/basicFile/index.vue

@@ -2,11 +2,17 @@
 <script src="../../../main.js"></script>
 <template>
   <div class="material-basic" v-loading="failLoad">
-
     <!-- 主体列表 -->
-    <el-card class="material-list" v-loading="loading">
-
-    <div style="margin: 0 0 10px 0;">
+    <el-card
+      class="material-list"
+      v-loading="loading"
+      :body-style="{
+        height: '100%',
+        padding: '10px ',
+        display: 'flex',
+        'flex-direction': 'column',
+      }"
+    >
       <!-- 查询条件 -->
       <el-super-search
         v-model="params"
@@ -16,14 +22,14 @@
         @reset="handleResetQuery"
         @submit="handleQuery"
       ></el-super-search>
-    
-    </div>
-    <!-- 操作栏 -->
-      <el-row 
-        :gutter="10" 
+
+      <!-- 操作栏 -->
+      <el-row
+        :gutter="10"
         class="mb10"
         type="flex"
         justify="end"
+        style="margin: 10px 0"
       >
         <!-- 新增、修改、删除、复制 -->
         <el-col :span="1.5">
@@ -36,10 +42,14 @@
         <!-- 启用 -->
         <el-col :span="1.5">
           <el-button-group>
-            <el-button :size="size" @click="handleIsInvoke" :disabled="checkedList.length != 1"
-                       v-hasPermi="['system:material:add']">
+            <el-button
+              :size="size"
+              @click="handleIsInvoke"
+              :disabled="checkedList.length != 1"
+              v-hasPermi="['system:material:add']"
+            >
               <!-- 0:启用  2:停用 -->
-              {{ handleJudgeIsUsing() ? '停用' : '启用' }}
+              {{ handleJudgeIsUsing() ? "停用" : "启用" }}
             </el-button>
           </el-button-group>
         </el-col>
@@ -47,144 +57,237 @@
         <!-- 导入导出 -->
         <el-col :span="1.5">
           <el-button-group>
-            <el-button :size="size" @click="handleImport" v-hasPermi="['system:material:import']">批量导入</el-button>
-            <el-button :size="size" @click="handleExport" v-hasPermi="['system:material:export']">批量导出</el-button>
+            <el-button
+              :size="size"
+              @click="handleImport"
+              v-hasPermi="['system:material:import']"
+              >批量导入</el-button
+            >
+            <el-button
+              :size="size"
+              @click="handleExport"
+              v-hasPermi="['system:material:export']"
+              >批量导出</el-button
+            >
           </el-button-group>
         </el-col>
-
-
       </el-row>
 
-      <el-table 
-        v-if="tableHeader.length"
-        border 
-        :data="taskList" 
-        ref="materialTable" 
-        max-height="525"
-        @cell-dblclick="handledbClick" 
-        :row-key="getRowKey"
-        @selection-change="handleSelectionChange" 
-        @select="handleSelect" 
-        @select-all="handleSelectAll"
-        :size="size"
+      <div
+        class="el-super-ux-table"
+        v-resize="resize"
+        style="
+          position: relative;
+          display: flex;
+          flex: 1;
+          flex-direction: column;
+          overflow: auto;
+        "
       >
-        <!--  -->
-        <el-table-column type="selection" width="45" :reserve-selection="true" fixed/>
-        <el-table-column type="index" label="序号" width="55" align="center"/>
-        <el-table-column 
-          width="150" 
-          v-for="h in  tableHeader" v-if="h.show" 
-          :label="h.name" 
-          align="center"
-          show-overflow-tooltip
+        <ux-grid
+          v-if="tableHeader.length"
+          border
+          use-virtual
+          keep-source
+          beautify-table
+          :size="size"
+          :data="taskList"
+          :height="tableHeight"
+          ref="materialTable"
+          @cell-dblclick="handledbClick"
+          @selection-change="handleSelectionChange"
+          @select="handleSelect"
+          @select-all="handleSelectAll"
+          :header-row-style="{
+            color: '#515a6e',
+          }"
+          style="flex: 1"
         >
-          <template slot-scope="scope">
-            <span v-if="h.apiUrl">{{scope.row[`${h.prop}Name`]}}</span>
-            <el-checkbox 
-              v-else-if="h.attribute == 'checkbox'"
-              v-model="scope.row[h.prop]"
-              disabled
-              true-label="0" 
-              false-label="2"
-            ></el-checkbox>
-            <el-dict-tag
-              v-else-if="h.dictId"
-              :value="scope.row[h.prop]"
-              :options="dict.type[h.dictId]"
-            ></el-dict-tag>
-
-            <span v-else>{{ scope.row[h.prop] || '--' }}</span>
-            <!-- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
-            (h.attribute == 'checkbox' ?
-            (scope.row[h.prop] == '0' ? '√' : '')
-            : scope.row[h.prop])
-            }} -->
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <pagination
-        :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="handleQuery"
-        style="height: 32px; padding: 0 !important; "
-      />
-
+          <
+          <!-- 多选 -->
+          <ux-table-column
+            fixed="left"
+            width="60"
+            align="center"
+            type="checkbox"
+            resizable
+            reserve-selection
+            :column-key="rowKey"
+          ></ux-table-column>
+          <!-- 序号 -->
+          <ux-table-column
+            fixed="left"
+            width="50"
+            title="序号"
+            type="index"
+            align="center"
+            class="is-index"
+            resizable
+          ></ux-table-column>
+          <!-- <ux-table-column type="selection" width="45" :reserve-selection="true" fixed/>
+          <ux-table-column type="index" title="序号" width="55" align="center"/> -->
+          <ux-table-column
+            width="150"
+            v-for="h in tableHeader"
+            v-if="h.show"
+            :title="h.name"
+            align="center"
+            resizable
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <span v-if="h.apiUrl">{{ scope.row[`${h.prop}Name`] }}</span>
+              <el-checkbox
+                v-else-if="h.attribute == 'checkbox'"
+                v-model="scope.row[h.prop]"
+                disabled
+                true-label="0"
+                false-label="2"
+              ></el-checkbox>
+              <el-dict-tag
+                v-else-if="h.dictId"
+                :value="scope.row[h.prop]"
+                :options="dict.type[h.dictId]"
+              ></el-dict-tag>
+
+              <span v-else>{{ scope.row[h.prop] || "--" }}</span>
+              <!-- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
+              (h.attribute == 'checkbox' ?
+              (scope.row[h.prop] == '0' ? '√' : '')
+              : scope.row[h.prop])
+              }} -->
+            </template>
+          </ux-table-column>
+        </ux-grid>
+        <div
+          style="
+            height: 50px;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          "
+          :style="{
+            height: '50px',
+          }"
+        >
+          <pagination
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="handleQuery"
+            style="
+              height: 32px;
+              padding: 0 !important;
+              flex: 1;
+              overflow-x: auto;
+            "
+          />
+        </div>
+      </div>
     </el-card>
 
     <!-- 操作提示 -->
-    <el-dialog title="操作提示" :visible.sync="optionDialog.show" width="30%" center>
+    <el-dialog
+      title="操作提示"
+      :visible.sync="optionDialog.show"
+      width="30%"
+      center
+    >
       <span>是否确认{{ optionDialog.op }}?</span>
       <span slot="footer">
         <el-button @click="handleOptionShow('option', false)">取 消</el-button>
-        <el-button type="primary" @click="handleComfirmOption('cancal')">确 定</el-button>
+        <el-button type="primary" @click="handleComfirmOption('cancal')"
+          >确 定</el-button
+        >
       </span>
     </el-dialog>
 
     <!-- 导入弹窗 -->
-    <el-dialog title="批量导入" :visible.sync="importData.show" width="35%" center :before-close="handlefileDialogColse">
+    <el-dialog
+      title="批量导入"
+      :visible.sync="importData.show"
+      width="35%"
+      center
+      :before-close="handlefileDialogColse"
+    >
       <div class="mb-import">
-        <el-upload class="upload-demo" accept=".xls, .xlsx" ref="upload" action="#" :on-remove="handleFileRemove"
-                   :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
-          <el-button slot="trigger" :size="size" type="primary">选取文件</el-button>
-          <el-button style="margin-left: 10px;" :size="size" type="success" @click="handleDownTemplate">下载模板</el-button>
+        <el-upload
+          class="upload-demo"
+          accept=".xls, .xlsx"
+          ref="upload"
+          action="#"
+          :on-remove="handleFileRemove"
+          :file-list="importData.list"
+          :auto-upload="false"
+          :on-change="handleChangeFile"
+          :limit="1"
+        >
+          <el-button slot="trigger" :size="size" type="primary"
+            >选取文件</el-button
+          >
+          <el-button
+            style="margin-left: 10px"
+            :size="size"
+            type="success"
+            @click="handleDownTemplate"
+            >下载模板</el-button
+          >
           <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
         </el-upload>
-
       </div>
       <span slot="footer">
         <el-button @click="handleImportData('cancal')">取 消</el-button>
-        <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
+        <el-button type="primary" @click="handleImportData('confirm')"
+          >确 定</el-button
+        >
       </span>
     </el-dialog>
-
   </div>
 </template>
 
 <script>
-import './style/index.scss';
-import materialApi from '@/api/material/basic';
-import { SearchColumns,OtherDictColumns } from './columns';
+import "./style/index.scss";
+import materialApi from "@/api/material/basic";
+import { SearchColumns, OtherDictColumns } from "./columns";
 import { initDicts } from "@/utils/init.js";
 
 export default {
   name: "material-basic",
-  dicts:[...initDicts([...SearchColumns,...OtherDictColumns])],
+  dicts: [...initDicts([...SearchColumns, ...OtherDictColumns])],
   components: {
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
     ElDictTag: () => import("@/components/DictTag/index.vue"),
-    
   },
   data() {
     const params = this.$init.params(SearchColumns);
-  
+
     return {
       failLoad: false,
-      params:params,
-      SearchColumns:SearchColumns,
-      size:'mini',
+      params: params,
+      SearchColumns: SearchColumns,
+      rowKey: "id",
+      size: "mini",
       // 物料基本信息数据
       taskList: [],
       // 查询表单字段
       queryForm: {
-        name: '',
-        code: '',
-        isEnable: '',
+        name: "",
+        code: "",
+        isEnable: "",
       },
       // 总条数
       total: 1,
       loading: false,
       importData: {
         show: false,
-        list: []
+        list: [],
       },
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 50,
         code: null,
-        name: null
+        name: null,
       },
       // 表头
       tableHeader: [],
@@ -195,23 +298,61 @@ export default {
       // 操作弹窗
       optionDialog: {
         show: false,
-        op: ''
+        op: "",
       },
-    }
+      resizeHeight: 0,
+    };
+  },
+  computed: {
+    tableHeight: {
+      get() {
+        return this.resizeHeight;
+      },
+      set() {},
+    },
+  },
+  directives: {
+    // 使用局部注册指令的方式
+    resize: {
+      // 指令的名称
+      bind(el, binding) {
+        // el为绑定的元素,binding为绑定给指令的对象
+        let width = "",
+          height = "";
+        function isReize() {
+          const style = document.defaultView.getComputedStyle(el);
+          if (width !== style.width || height !== style.height) {
+            binding.value(); // 关键
+          }
+          width = style.width;
+          height = style.height;
+        }
+        el.__vueSetInterval__ = setInterval(isReize, 300);
+      },
+      unbind(el) {
+        clearInterval(el.__vueSetInterval__);
+      },
+    },
   },
-
   methods: {
+    resize() {
+      this.resizeHeight =
+        document.getElementsByClassName("el-super-ux-table")[0].offsetHeight -
+        55;
+    },
     // 判读是否启用
     handleJudgeIsUsing() {
-      return this.checkedList.length == 1 && this.checkedList[0].isEnable == '已启用';
+      return (
+        this.checkedList.length == 1 && this.checkedList[0].isEnable == "已启用"
+      );
     },
-    
+
     // 新增
     handleInster() {
       this.$notify({
-        title: '警告',
-        message: '物料只能通过申请审批增加,不能在节点直接录入!',
-        type: 'warning'
+        title: "警告",
+        message: "物料只能通过申请审批增加,不能在节点直接录入!",
+        type: "warning",
       });
     },
     // 修改
@@ -220,43 +361,46 @@ export default {
         this.$router.push({
           path: `/material/basicFile/detail/${this.checkedList[0].id}`,
           query: {
-            isEdit: true
-          }
+            isEdit: true,
+          },
         });
       } else {
         this.$notify({
-          title: '警告',
-          message: `${this.checkedList.length > 1 ? '修改只能选择单个数据!' : '请选择需要修改的信息!'}`,
-          type: 'warning'
+          title: "警告",
+          message: `${
+            this.checkedList.length > 1
+              ? "修改只能选择单个数据!"
+              : "请选择需要修改的信息!"
+          }`,
+          type: "warning",
         });
       }
     },
     // 删除
     handleDel() {
-      console.log('删除', this.checkedList);
+      console.log("删除", this.checkedList);
       // delMaterial
       if (this.checkedList.length) {
-        let ids = this.checkedList.map(i => i.id);
-        materialApi.delMaterial(ids).then(res => {
+        let ids = this.checkedList.map((i) => i.id);
+        materialApi.delMaterial(ids).then((res) => {
           if (res.code == 200) {
             this.handleRefresh();
             // 清空选中数据
             this.checkedList = [];
             this.$refs.materialTable.clearSelection();
           }
-        })
+        });
       } else {
         this.$notify({
-          title: '警告',
+          title: "警告",
           message: `请选择需要删除的数据!`,
-          type: 'warning'
+          type: "warning",
         });
       }
-
     },
     // 复制
     handleCopy() {
-      console.log('复制');
+      console.log("复制");
     },
     //查询
     handleQuery() {
@@ -273,7 +417,7 @@ export default {
       // }
 
       this.queryParams.pageNum = 1;
-    
+
       this.queryParams.pageSize = 100;
 
       this.params = this.$init.params(SearchColumns);
@@ -287,35 +431,34 @@ export default {
       //   this.queryForm[key] = '';
       // }
     },
-  
+
     // 启用/停用
     handleIsInvoke() {
       // true   当前状态为启用,需要改为停用
       // 0:启用  2:停用
       let param = {
-        isEnable: this.handleJudgeIsUsing() ? '2' : '0',
-        id: this.checkedList[0].id
+        isEnable: this.handleJudgeIsUsing() ? "2" : "0",
+        id: this.checkedList[0].id,
       };
-      materialApi.updateEnableMaterial(param).then(res => {
+      materialApi.updateEnableMaterial(param).then((res) => {
         if (res.code == 200) {
           this.handleRefresh();
           // 清空选中数据
           this.checkedList = [];
           this.$refs.materialTable.clearSelection();
         }
-      })
-
+      });
     },
     isInvoke(val) {
       return val;
     },
     // 申请单查询
     handleQueryForm() {
-      console.log('申请单查询');
+      console.log("申请单查询");
     },
     // 批量导入
     handleImport() {
-      this.importData.show = true
+      this.importData.show = true;
     },
     // 导入弹窗关闭前
     handlefileDialogColse(done) {
@@ -326,59 +469,58 @@ export default {
     handleImportData(type) {
       switch (type) {
         // 取消
-        case 'cancal':
+        case "cancal":
           this.importData.list = [];
           this.importData.show = false;
           break;
         // 确认
-        case 'confirm':
+        case "confirm":
           if (this.importData.list.length) {
-
             let formData = new FormData();
 
-            formData.append('file', this.importData.list[0].raw);
-            materialApi.fileImport(formData).then(res => {
+            formData.append("file", this.importData.list[0].raw);
+            materialApi.fileImport(formData).then((res) => {
               if (res.code == 200) {
                 this.importData.show = false;
                 this.importData.list = [];
                 if (res.data.flag) {
                   this.failLoad = true;
-                  console.log(res.data.datas)
-                  let param = {failDatas: res.data.datas}
+                  console.log(res.data.datas);
+                  let param = { failDatas: res.data.datas };
                   if (null != param) {
-                    materialApi.exportMartial(param).then(res => {
+                    materialApi.exportMartial(param).then((res) => {
                       const blob = new Blob([res], {
                         type: "application/vnd.ms-excel;charset=UTF-8",
-                      });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+                      }); // 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
                       const downloadElement = document.createElement("a"); //创建a标签
                       const href = window.URL.createObjectURL(blob); // 创建下载的链接
-                      downloadElement.href = href;  //下载地址
-                      downloadElement.download = '导入失败的物料基础档案数据.xlsx'; // 下载后文件名
+                      downloadElement.href = href; //下载地址
+                      downloadElement.download =
+                        "导入失败的物料基础档案数据.xlsx"; // 下载后文件名
                       document.body.appendChild(downloadElement);
                       downloadElement.click(); // 点击下载
                       document.body.removeChild(downloadElement); // 下载完成移除元素
                       window.URL.revokeObjectURL(href); // 释放blob对象
                       this.failLoad = false;
-                    })
+                    });
                   }
                 }
                 this.$notify({
                   message: res.data.msg,
-                  type: res.data.flag ? 'warning' : 'success'
+                  type: res.data.flag ? "warning" : "success",
                 });
-                
               } else {
                 this.$notify({
                   message: res.msg,
-                  type: res.code == 200 ? 'success' : 'warning'
+                  type: res.code == 200 ? "success" : "warning",
                 });
               }
-            })
+            });
           } else {
             this.$notify({
-              title:'警告',
-              message: '请上传文件之后在确认!',
-              type: 'warning',
+              title: "警告",
+              message: "请上传文件之后在确认!",
+              type: "warning",
             });
           }
           break;
@@ -397,39 +539,53 @@ export default {
 
     // 批量导出
     handleExport() {
-
-      let ids = this.checkedList.length ? this.checkedList.map(i => i.id) : [];
+      let ids = this.checkedList.length
+        ? this.checkedList.map((i) => i.id)
+        : [];
 
       if (ids.length) {
-
         let params = {
           // orgId: '1',
           ids,
-        }
-        this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
+        };
+        this.download(
+          "/system/material/export",
+          params,
+          `物料基本信息${new Date().getTime()}.xlsx`
+        );
       } else {
         let params = {
-          templateCode:'material',
+          templateCode: "material",
           ...this.params,
-          createTimeBegin: (this.params.createTimeQueue && this.params.createTimeQueue[0]) || '',
-          createTimeEnd:(this.params.createTimeQueue && this.params.createTimeQueue[1]) || '',
-          updateTimeBegin:(this.params.updateTimeQueue && this.params.updateTimeQueue[0]) || '',
-          updateTimeEnd:(this.params.updateTimeQueue && this.params.updateTimeQueue[1]) || ''
-        }
-        this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
+          createTimeBegin:
+            (this.params.createTimeQueue && this.params.createTimeQueue[0]) ||
+            "",
+          createTimeEnd:
+            (this.params.createTimeQueue && this.params.createTimeQueue[1]) ||
+            "",
+          updateTimeBegin:
+            (this.params.updateTimeQueue && this.params.updateTimeQueue[0]) ||
+            "",
+          updateTimeEnd:
+            (this.params.updateTimeQueue && this.params.updateTimeQueue[1]) ||
+            "",
+        };
+        this.download(
+          "/system/material/export",
+          params,
+          `物料基本信息${new Date().getTime()}.xlsx`
+        );
       }
-
     },
     // 下载模板
     handleDownTemplate() {
-      this.download('/system/material/download', {}, `物料基本信息模板.xlsx`)
+      this.download("/system/material/download", {}, `物料基本信息模板.xlsx`);
     },
 
-
     // 操作弹窗显隐
     handleOptionShow(type, val) {
       switch (type) {
-        case 'option':
+        case "option":
           this.optionDialog.show = val;
           break;
       }
@@ -437,13 +593,12 @@ export default {
     // 操作弹窗确认按钮
     handleComfirmOption(op) {
       switch (op) {
-        case 'cancal':
-          this.handleOptionShow('option', false);
+        case "cancal":
+          this.handleOptionShow("option", false);
           break;
       }
     },
 
-
     // 双击行
     handledbClick(e) {
       this.$router.push({
@@ -458,7 +613,7 @@ export default {
     handleUnique(arr, key) {
       // arr  需要去重的数组   type:作为去重依据的key
       const res = new Map();
-      return arr.filter((arr) => !res.has(arr[key]) && res.set(arr[key], 1))
+      return arr.filter((arr) => !res.has(arr[key]) && res.set(arr[key], 1));
     },
     // 选中数据改变
     handleSelectionChange(list) {
@@ -470,7 +625,6 @@ export default {
       this.checkedList = selection;
       // // true就是选中,0或者false是取消选中
       // let selected = selection.length && selection.indexOf(row) !== -1
-
     },
     //手动勾选全选
     handleSelectAll(selection) {
@@ -478,38 +632,43 @@ export default {
     },
     // 获取物料列表信息
     async getMaterialList() {
-
       try {
         this.loading = true;
         let page = {
           pageNum: this.queryParams.pageNum,
           pageSize: this.queryParams.pageSize,
-        }
+        };
 
         let param = {
-          templateCode:'material',
+          templateCode: "material",
           ...this.params,
-          createTimeBegin: (this.params.createTimeQueue && this.params.createTimeQueue[0]) || '',
-          createTimeEnd:(this.params.createTimeQueue && this.params.createTimeQueue[1]) || '',
-          updateTimeBegin:(this.params.updateTimeQueue && this.params.updateTimeQueue[0]) || '',
-          updateTimeEnd:(this.params.updateTimeQueue && this.params.updateTimeQueue[1]) || ''
-        }
+          createTimeBegin:
+            (this.params.createTimeQueue && this.params.createTimeQueue[0]) ||
+            "",
+          createTimeEnd:
+            (this.params.createTimeQueue && this.params.createTimeQueue[1]) ||
+            "",
+          updateTimeBegin:
+            (this.params.updateTimeQueue && this.params.updateTimeQueue[0]) ||
+            "",
+          updateTimeEnd:
+            (this.params.updateTimeQueue && this.params.updateTimeQueue[1]) ||
+            "",
+        };
+
+        console.log(param, "param--------------");
+
+        let { code, data } = await materialApi.materialList(param, page);
 
-        console.log(param,'param--------------');
-
-        let {code,data} = await  materialApi.materialList(param, page);
-        
         if (code == 200) {
           this.taskList = data.tableBody.rows;
           this.total = data.tableBody.total;
-
         }
       } catch (error) {
-        
-      }finally{
+      } finally {
         this.loading = false;
       }
-    
+
       // materialApi.materialList(param, page).then((res) => {
       //   _this.loading = false;
       //   console.log(res, '获取物料列表信息以及表头字段');
@@ -523,10 +682,9 @@ export default {
     },
     // 获取物料列表表头
     getTagList(templateCode) {
-      materialApi.tagList({templateCode}).then(res => {
-        console.log(res, '获取物料列表表头');
+      materialApi.tagList({ templateCode }).then((res) => {
+        console.log(res, "获取物料列表表头");
         if (res.code == 200) {
-
           // let dictList = []
           // res.data.forEach(item =>{
           //   if(item.dictId){
@@ -537,7 +695,7 @@ export default {
           //         dictName:item.dictId
           //       }
           //     });
-              
+
           //   }
           // })
           // console.log(dictList,'dictList');
@@ -546,96 +704,98 @@ export default {
 
           this.tableHeader = res.data;
         }
-      })
+      });
     },
-
-
-  },
-  created() {
   },
+  created() {},
   beforeRouteEnter(to, from, next) {
-
     next((vm) => {
-      if (from.name == 'materialDetail') {
+      if (from.name == "materialDetail") {
         // this.$store.getQuery(this.queryForm);
-        console.log(vm, 'queryValue', vm.$store);
+        console.log(vm, "queryValue", vm.$store);
         vm.queryForm = vm.$store.state.query.queryVlue;
         // 清空选中数据
         vm.checkedList = [];
-        vm.$refs.materialTable &&vm.$refs.materialTable.clearSelection();
+        vm.$refs.materialTable && vm.$refs.materialTable.clearSelection();
       }
-      vm.getTagList('material_list');
+      vm.getTagList("material_list");
       vm.getMaterialList();
     });
   },
   // 进入详情,保留查询条件
   beforeRouteLeave(to, from, next) {
-    if (to.name == 'materialDetail') {
-      this.$store.commit('SET_QUERY', this.queryForm);
+    if (to.name == "materialDetail") {
+      this.$store.commit("SET_QUERY", this.queryForm);
     } else {
-      this.$store.commit('SET_QUERY', {name: '', code: ''});
+      this.$store.commit("SET_QUERY", { name: "", code: "" });
     }
     next();
-  }
-
+  },
 };
 </script>
 
-
 <style lang="scss">
-  .material-list {
-    // height: calc(100vh - 70px);
-
-
-    .el-card__body {
-      height: 100%;
-      box-sizing: border-box;
-      padding: 10px;
-
-      .el-table {
-        // overflow: auto;
-
-        .el-table__body-wrapper {
-          overflow-y: auto !important;
-          overflow-x: auto !important;
-        }
+.material-basic {
+  height: calc(100vh);
+}
+.material-list {
+  // height: calc(100vh - 70px);
+  height: 100%;
+
+  .el-card__body {
+    height: 100%;
+    box-sizing: border-box;
+    padding: 10px;
+
+    .el-table {
+      // overflow: auto;
+
+      .el-table__body-wrapper {
+        overflow-y: auto !important;
+        overflow-x: auto !important;
       }
     }
-
-    .el-pagination {
-      margin-top: 8px;
-      text-align: right;
-    }
   }
 
-  .mb-import {
-    padding: 0 20%;
-    text-align: center;
-    display: flex;
-    align-items: flex-start;
-    justify-content: space-around;
+  .el-pagination {
+    // margin-top: 8px;
+    text-align: right;
   }
+}
+
+.mb-import {
+  padding: 0 20%;
+  text-align: center;
+  display: flex;
+  align-items: flex-start;
+  justify-content: space-around;
+}
 </style>
 <style scoped>
-  .el-dialog__header {
-    background-color: rgb(244, 244, 244);
-  }
-
-  .mb-query >>> .el-form-item__label {
-    font-weight: normal;
-    font-size: 12px;
-  }
-
-  .mb-query >>> .el-form-item {
-    margin-bottom: 8px;
-  }
-
-  .mb-query >>> .el-select {
-    width: 90px;
-  }
-
-  .mb-query >>> .el-scrollbar__wrap {
-    margin-bottom: -18px;
-
-  }
+.el-dialog__header {
+  background-color: rgb(244, 244, 244);
+}
+
+.mb-query >>> .el-form-item__label {
+  font-weight: normal;
+  font-size: 12px;
+}
+
+.mb-query >>> .el-form-item {
+  margin-bottom: 8px;
+}
+
+.mb-query >>> .el-select {
+  width: 90px;
+}
+
+.mb-query >>> .el-scrollbar__wrap {
+  margin-bottom: -18px;
+}
+::v-deep.uxbeautifyTableClass
+  .elx-header--column
+  .elx-resizable.is--line:before {
+  height: 100%;
+  background-color: #dfe6ec;
+}
 </style>

+ 12 - 2
src/views/material/requisition/add.vue

@@ -55,10 +55,19 @@
             <el-row :gutter="10">
               <el-col :span="6">
                 <el-form-item label="物料名称" prop="name">
-                  <el-input
+                  <el-popover-select-v2
+                    :size="size"
+                    title="物料名称"
+                    v-model="basicForm.name"
+                    :source.sync="basicForm"
+                    valueKey="name"
+                    referName="MATERIAL_PARAM"
+                    style="width: 100%"
+                  ></el-popover-select-v2>
+                  <!-- <el-input
                     :disabled="disable"
                     v-model="basicForm.name"
-                  ></el-input>
+                  ></el-input> -->
                 </el-form-item>
               </el-col>
               <el-col :span="6">
@@ -1270,6 +1279,7 @@ export default {
     "material_enable",
   ],
   components: {
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
     factory,
     fourClass,
     unit,

+ 0 - 960
src/views/material/requisition/add/columns.js

@@ -1,960 +0,0 @@
-export default function useColumns(){
-
-  const TableColumns = [
-    {
-      item:{
-        key:'name',
-        title:'物料名称',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'code',
-        title:'物料名称',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'',
-        title:'版本号',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'orgName',
-        title:'所属组织',
-      },
-      attr:{
-        is: "el-popover-select-v2",
-        valueKey: "name",
-        referName: "ORG_PARAM",
-        dataMapping: {
-          orgId:'id'
-        },
-        disabled:true,
-      },
-    },
-    {
-      item:{
-        key:'specification',
-        title:'规格',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'classifyId',
-        title:'四级分类',
-      },
-      attr:{
-        is: "el-popover-tree-select",
-        referName: "MATERIALCLASSIFY_PARAM",
-        valueKey: "id",
-        dataMapping: {
-          // dosageFrom:'id'
-        }
-      },
-    },
-    {
-      item:{
-        key:'isMedicine',
-        title:'医药物料',
-      },
-      attr:{
-        is: "el-select",
-        dictName: "sys_number_yes_no", // 字典名
-      },
-      
-    },
-    {
-      item:{
-        key:'',
-        title:'同步失败原因',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'model',
-        title:'型号',
-      },
-      attr:{
-        is: "el-input",
-      },
-  
-    },
-    {
-      item:{
-        key:'packExplain',
-        title:'包装说明',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'isInventoryStatus',
-        title:'批号及库存状态管理',
-      },
-      attr:{
-        is: "el-select",
-        dictName: "sys_number_yes_no",
-      },
-    },
-    {
-      item:{
-        key:'barCode',
-        title:'条形码',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      // 单位
-      item:{
-        key:'unitId',
-        title:'计量单位',
-      },
-      attr:{
-        is: "el-popover-select-v2",
-        valueKey: "id",
-        referName: "UNIT_PARAM",
-      },
-    },
-    {
-      item:{
-        key:'deliveryPeriod',
-        title:'交货周期',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    {
-      item:{
-        key:'expiryDateManagerment',
-        title:'效期管理',
-      },
-      attr:{
-        is: "el-select",
-        dictName: "sys_number_yes_no",
-      },
-    },
-    {
-      item:{
-        key:'height',
-        title:'高度',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    {
-      item:{
-        key:'manufacturerId',
-        title:'生产厂家/代理人',
-      },
-      attr:{
-        is: "el-popover-select-v2",
-        valueKey: "id",
-        referName: "MANUFACTURER_PARAM",
-      },
-    },
-    {
-      item:{
-        key:'minOrderQty',
-        title:'最小起定量',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    {
-      item:{
-        key:'expiryUnitId',
-        title:'效期单位',
-      },
-      attr:{
-        is: "el-select",
-        dictName: "period_unit",
-      },
-    },
-    {
-      item:{
-        key:'width',
-        title:'宽度',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    { //注册人/上市许可持有人
-      item:{
-        key:'registrant',
-        title:'注册人/上市许可持有人',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'minPackQty',
-        title:'最小包装量',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    {
-      item:{
-        key:'usefulLife',
-        title:'有效期',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    {
-      item:{
-        key:'length',
-        title:'长度',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    {
-      item:{
-        key:'productionPermit',
-        title:'生产许可证',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'minBatchQty',
-        title:'最小批量',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    {
-      item:{
-        key:'usefulLifeUnitId',
-        title:'有效期至单位',
-      },
-      attr:{
-        is: "el-select",
-      dictName: "expiry_date",
-      },
-    },
-    {
-      item:{
-        key:'oriMaterialCode',
-        title:'原系统物料编码',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'storageCondition',
-        title:'存储条件',
-      },
-      attr:{
-        is: "el-select",
-        dictName: "sys_storage_condition",
-      },
-    },
-    {
-      item:{
-        key:'diCode',
-        title:'DI码',
-      },
-      attr:{
-        is: "el-input",
-      },
-  
-    },
-    {
-      item:{
-        key:'nearOnsetManagerment',
-        title:'近效期管理',
-      },
-      attr:{
-        is: "el-select",
-        dictName: "sys_number_yes_no",
-      },
-    },
-    {
-      item:{
-        key:'oneClass',
-        title:'一级分类',
-      },
-      attr:{
-        is: "el-input",
-        disabled:true,
-      },
-    },
-    {
-      item:{
-        key:'transportationCondition',
-        title:'运输条件',
-      },
-      attr:{
-        is: "el-select",
-      dictName: "sys_conditions_carriage",
-      },
-    },
-    {
-      item:{
-        key:'healthCode',
-        title:'医保代码',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'recentWarningPeriod',
-        title:'近效期预警天数',
-      },
-      attr:{
-        is: "el-input-number",
-      },
-    },
-    {
-      item:{
-        key:'twoClass',
-        title:'二级分类',
-      },
-      attr:{
-        is: "el-input",
-        disabled:true,
-      },
-    },
-    {
-      item:{
-        key:'originPlace',
-        title:'产地',
-      },
-      attr:{
-        is: "el-popover-select-v2",
-        valueKey: "name",
-        referName: "ORIGINPLACE_PARAM",
-      },
-    },
-    {
-      item:{
-        key:'manufacturersMaterialName',
-        title:'厂家物料名称',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'manufacturersMaterialCode',
-        title:'厂家物料编码',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'threeClass',
-        title:'三级分类',
-      },
-      attr:{
-        is: "el-input",
-        disabled:true,
-      },
-    },
-    {
-      item:{
-        key:'serviceLife',
-        title:'使用期限/次数',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'materialRate',
-        title:'物料税类',
-      },
-      attr:{
-        is: "el-popover-select-v2",
-        valueKey: "name",
-        referName: "MATERIALTAX_PARAM",
-        dataMapping: {
-          rateCode: "code",
-        },
-      },
-    },
-    {
-      item:{
-        key:'isEnable',
-        title:'启用状态',
-      },
-      attr:{
-        is: "el-select",
-        dictName: "material_enable",
-        disabled:true,
-      },
-    },
-    {
-      item:{
-        key:'',
-        title:'品牌',
-      },
-      attr:{
-        is: "el-input",
-        disabled:true,
-      },
-    },
-    {
-      item:{
-        key:'purchasingOrganization',
-        title:'默认采购组织',
-      },
-      attr:{
-        is: "el-popover-select-v2",
-        valueKey: "name",
-        referName: "ORG_PARAM",
-        // dataMapping: {
-        //   orgId:'id'
-        // },
-      },
-    },
-    {
-      item:{
-        key:'serviceClass',
-        title:'服务类',
-      },
-      attr:{
-        is: "el-input-number",
-        disabled:true,
-      },
-    },
-    {
-      item:{
-        key:'remark',
-        title:'备注',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-    {
-      item:{
-        key:'serialNoManager',
-        title:'序列号管理',
-      },
-      attr:{
-        is: "el-select",
-        dictName: "sys_number_yes_no",
-      },
-    },
-    {
-      item:{
-        key:'puPersonnelId',
-        title:'采购员',
-      },
-      attr:{
-        is: "el-popover-select-v2",
-        referName: "CONTACTS_PARAM",
-        valueKey: "name",
-        // dataMapping: {
-        //   puPersonnelId: "code",
-        // },
-      },
-    },
-    {
-      item:{
-        key:'proposerId',
-        title:'物料申请人',
-      },
-      attr:{
-        is: "el-input",
-      },
-    },
-
-
-
-
-
-
-    // {
-    //   item:{
-    //     key:'billCode',
-    //     title:'单据编码',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //     disabled:true,
-    //   },
-    // },
-    // {
-    //   item:{
-    //     key:'enName',
-    //     title:'英文名称',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'commonName',
-    //     title:'简称',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'unitId',
-    //     title:'计量单位',
-    //   },
-    //   attr:{
-    //     is: "el-popover-select-v2",
-    //     valueKey: "id",
-    //     referName: "UNIT_PARAM",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'classifyAbc',
-    //     title:'ABC分类',
-    //   },
-    //   attr:{
-    //     is: "el-select",
-    //   dictName: "abc_type",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'safeStock',
-    //     title:'安全库存',
-    //   },
-    //   attr:{
-    //     is: "el-input-number",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'isB2c',
-    //     title:'B2C物料',
-    //   },
-    //   attr:{
-    //     is: "el-select",
-    //     dictName: "sys_number_yes_no",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'assembly',
-    //     title:'成套件',
-    //   },
-    //   attr:{
-    //     is: "el-select",
-    //     dictName: "sys_number_yes_no",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'mediumPackageUnitId',
-    //     title:'中包装单位',
-    //   },
-    //   attr:{
-    //     is: "el-popover-select-v2",
-    //     valueKey: "id",
-    //     referName: "UNIT_PARAM",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'rateCode',
-    //     title:'物料税类编码',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //     disabled:true,
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'height',
-    //     title:'高度(MM)',
-    //   },
-    //   attr:{
-    //     is: "el-input-number",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'boxPackaingQty',
-    //     title:'箱包装数',
-    //   },
-    //   attr:{
-    //     is: "el-input-number",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'mediumPackageQty',
-    //     title:'中包装数',
-    //   },
-    //   attr:{
-    //     is: "el-input-number",
-    //   },
-  
-    // },
-    
-    // // {
-    // //   item:{
-    // //     key:'businessLine',
-    // //     title:'业务线',
-    // //   },
-    // //   attr:{
-    // //     is: "el-input",
-    // //   },
-    // // },
-    
-    // // {
-    // //   item:{
-    // //     key:'businessDepartment',
-    // //     title:'业务部门',
-    // //   },
-    // //   attr:{
-    // //     is: "el-input",
-    // //     disabled:true,
-    // //   },
-  
-    // // },
-   
-    // {
-    //   item:{
-    //     key:'importsManufacturer',
-    //     title:'进口产品生产厂家',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //   },
-  
-    // },
-    
-    // {
-    //   item:{
-    //     key:'innerPackingUnit',
-    //     title:'内包装单位',
-    //   },
-    //   attr:{
-    //     is: "el-popover-select-v2",
-    //     valueKey: "id",
-    //     referName: "UNIT_PARAM",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'innerPackingQty',
-    //     title:'内包装数',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //   },
-  
-    // },
-    
-    // {
-    //   item:{
-    //     key:'isDrug',
-    //     title:'药品',
-    //   },
-    //   attr:{
-    //     is: "el-select",
-    //     dictName: "sys_medicine", // 字典名
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'registrationNo',
-    //     title:'注册证号/备案凭证编号',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'medicalInstruments',
-    //     title:'医疗器械',
-    //   },
-    //   attr:{
-    //     is: "el-select",
-    //     dictName: "medical_instruments", // 字典名
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'commonName',
-    //     title:'通用名称',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'ratifyBatchNo',
-    //     title:'批准文号',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'dosageFrom',
-    //     title:'剂型',
-    //   },
-    //   attr:{
-    //     is: "el-popover-tree-select",
-    //     referName: "DOSAGEFORM_PARAM",
-    //     valueKey: "name",
-    //     // dataMapping: {
-    //     //   dosageFrom:'id'
-    //     // }
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'oriRegistrationNo',
-    //     title:'旧注册证号',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'curingType',
-    //     title:'养护类型',
-    //   },
-    //   attr:{
-    //     is: "el-select",
-    //     dictName: "curing_type", // 字典名
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'createName',
-    //     title:'申请人',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //     disabled:true,
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'createTime',
-    //     title:'申请时间',
-    //   },
-    //   attr:{
-    //     is: "el-date-picker",
-    //     valueFormat: "yyyy-MM-dd HH:mm:ss",
-    //     disabled:true,
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'createName',
-    //     title:'创建人',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //     disabled:true,
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'createTime',
-    //     title:'创建时间',
-    //   },
-    //   attr:{
-    //     is: "el-date-picker",
-    //     valueFormat: "yyyy-MM-dd HH:mm:ss",
-    //     disabled:true,
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'updateName',
-    //     title:'最后修改人',
-    //   },
-    //   attr:{
-    //     is: "el-input",
-    //     disabled:true,
-    //   },
-  
-    // },
-    // {
-    //   item:{
-    //     key:'updateTime',
-    //     title:'最后修改时间',
-    //   },
-    //   attr:{
-    //     is: "el-date-picker",
-    //     valueFormat: "yyyy-MM-dd HH:mm:ss",
-    //     disabled:true,
-    //   },
-  
-    // },
-    // // {
-    // //   item:{
-    // //     key:'reviewedByName',
-    // //     title:'最后审核人',
-    // //   },
-    // //   attr:{
-    // //     is: "el-input",
-    // //     disabled:true,
-    // //   },
-  
-    // // },
-    // // {
-    // //   item:{
-    // //     key:'approvalTime',
-    // //     title:'最后审核时间',
-    // //   },
-    // //   attr:{
-    // //     is: "el-date-picker",
-    // //     valueFormat: "yyyy-MM-dd HH:mm:ss",
-    // //     disabled:true,
-    // //   },
-  
-    // // },
-    // {
-    //   item:{
-    //     key:'status',
-    //     title:'单据状态',
-    //   },
-    //   attr:{
-    //     is: "el-select",
-    //     dictName: "documents_status", // 字典名
-    //     disabled:true,
-    //   },
-  
-    // },
-    
-    
-  ].map(({ item, attr }) => ({
-    attr,
-    item: { ...item, hidden: true, span: item.span || 6 },
-  }));
-  
-  const TabColumns = [
-    {
-      item:{
-        key:'maintainMaterialType',
-        title:'维护物料类别',
-      },
-      attr:{
-        value:[]
-      },
-      TableColumns:[
-        {
-          item:{
-            key:'drugId',
-            title:'ID',
-          },
-          attr:{
-            is: "el-select",
-            dictName: "sys_number_yes_no", // 字典名
-          },
-         
-        },
-        {
-          item:{
-            key:'drugCode',
-            title:'药品类别编码',
-            require: true,
-          },
-          attr:{
-            is: "el-popover-select-v2",
-            valueKey: "code",
-          },
-         
-        },
-        {
-          item:{
-            key:'drugName',
-            title:'药品类别名称',
-            require: true,
-          },
-          attr:{
-            is: "el-input",
-            // disabled:true,
-          },
-         
-        },
-        
-      
-  
-      ]
-    }, 
-  ]
-
-  return {TableColumns,TabColumns}
-}
-

+ 0 - 336
src/views/material/requisition/add/index.vue

@@ -1,336 +0,0 @@
-<script>
-export default {
-  name:'AddRequsition',
-  props: {
-    dict: {
-      type: Object,
-    },
-    addType: {
-      type: String,
-      default: "add",
-    },
-  },
-  components:{
-    ElSuperForm: () => import("@/components/super-form/index.vue"),
-    ElSuperTable: () => import("@/components/super-table/index.vue"),
-    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
-    ElPopoverTreeSelect: () =>
-      import("@/components/popover-tree-select/index.vue"),
-  
-  },
-  data(){
-    const {
-      TabColumns,
-      TableColumns,
-      TabColumns: [
-        {
-          item: { key: tabName },
-        },
-      ],
-    } = useColumns();
-
-    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
-    const params = this.$init.params([...TabColumns, ...TableColumns]);
-    return{
-      width: "100%",
-      visible: false,
-      loading:false,
-      rules,
-      params,
-      tabName: tabName,
-      TabColumns: TabColumns,
-      TableColumns: TableColumns,
-    } 
-  },
-  computed: {
-    title: {
-      get() {
-        const { addType } = this;
-        if (addType === "add") {
-          return "新 增";
-        }
-        if (addType === "edit") {
-          return "编 辑";
-        }
-      },
-      set() {},
-    },
-    materialInfo:{
-      get(){
-        const { materialBasic } = this.params;
-        this.params.materialBasic = materialBasic.map((item, index) => ({
-          ...item,
-          $index: index,
-        }));
-
-        return {
-          materialBasic: this.params.materialBasic.filter(
-            ({ delFlag }) => delFlag !== "2"
-          ),
-        }
-      },
-      set(){},
-    }
-  },
-  methods: {
-    setVisible(prop){
-      this.visible = prop;
-    },
-    beforeOpen(){
-      if(this.addType === 'add'){
-        let {name,nickName} = this.$store.state.user;
-        this.params.createBy = name;
-        this.params.createByName = nickName;
-        this.params.createTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
-        this.params.updateBy = name;
-        this.params.updateByName = nickName;
-        this.params.updateTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
-        // this.params.approver = name;
-        this.params.applicationTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
-        this.params.status = '0';
-        console.log(this.$store.state.user,'user');
-        this.params.orgName = '德荣集团';
-        this.useRowAdd(this.tabName);
-      }
-    },
-
-    //
-    async fetchItem(prop) {
-      console.log(prop,'prop----------------');
-      try {
-        // try
-        this.loading = true;
-
-        let { code, data } = await getChangeDetails(prop.id);
-
-        if(code == 200){
-          this.params = data;
-        }
-        
-      } catch (err) {
-        // catch
-        console.error(err);
-      } finally {
-        // finally
-        this.loading = false;
-      }
-    },
-    
-    //
-    async hide() {
-      const {
-        TabColumns,
-        TableColumns,
-        TabColumns: [
-          {
-            item: { key: tabName },
-          },
-        ],
-      } = useColumns();
-      this.visible = false;
-      this.$emit('success');
-      this.tabName = tabName;
-      this.params = this.$init.params([...TabColumns, ...TableColumns]);
-    },
-    //
-    async useRowAdd(prop) {
-      
-      const { TableColumns } = this.TabColumns.find(
-        ({ item: { key } }) => key === prop
-      );
-      this.params[prop].push({
-        delFlag: "0",
-        materialClassifyId:null,
-        ...this.$init.params(TableColumns),
-      });
-    },
-    //
-    async useRowRemove(prop, scope) {
-      const { addType } = this.$props;
-      const {
-        row: { $index },
-      } = scope;
-      if (addType === "add") {
-        this.params[prop].splice($index, 1);
-      }
-      if (addType === "edit") {
-        this.params[prop] = this.params[prop].map((item, index) => ({
-          ...item,
-          delFlag: index === $index ? "2" : item.delFlag,
-        })).filter(item =>( item.id  || (!item.id && item.delFlag === '0')) )
-        ;
-      }
-    },
-    handleSubmitValidate(prop,cb){
-
-      this.$refs[prop].$refs[prop].validate(async (valid) => {
-        if (valid) {
-          try {
-            this.loading = true;
-
-            let validList = this.params['materialBasic'].filter(item => item.delFlag === '0');
-
-            if(validList.length){
-              await cb();
-            }else{
-              this.$notify.error({
-                message:'物料信息不能不为空!'
-              })
-            }
-            
-          } catch (err) {
-            // catch
-            console.error(err);
-          } finally {
-            // finally
-            this.loading = false;
-          }
-        } else {
-          return false;
-        }
-      });
-    },
-    //
-    async useSubmit(prop) {
-      console.log(this.params,'this.params');
-      this.handleSubmitValidate(prop,async()=>{
-
-        try {
-          this.loading = true;
-          const {code,msg} = await addChangeList(this.params);
-
-          if(code == 200){
-
-            this.hide();
-            this.$notify.success({
-              title: msg,
-            });
-          }
-          
-        } catch (error) {}
-        finally{
-          this.loading = false;
-        }
-
-        
-        // await;
-      })
-    },
-  },
-  created() {
-  },
-  mounted() {},
-  destroyed() {},
-}
-</script>
-
-<template>
- <el-drawer
-      v-bind="$attrs"
-      v-on="$listeners"
-      :size="width"
-      :visible.sync="visible"
-      destroy-on-close
-      :show-close="false"
-      @close="hide"
-      @open="beforeOpen"
-      v-loading="loading"
-    >
-      <div 
-        slot="title" 
-        style="display: flex;
-            justify-content: space-between;
-            align-items: center;"
-      >
-        <h3>{{title}}</h3>
-        <div>
-          <el-button
-          type="primary"
-          :size="$attrs.size"
-          :loading="loading"
-          @click="useSubmit('superForm')"
-          >确 认</el-button
-        >
-        <el-button :size="$attrs.size" :loading="loading" @click="hide"
-          >取 消</el-button
-        >
-        </div>
-      </div>
-      <el-super-form
-        v-model="params"
-        :dict="dict"
-        :rules="rules"
-        :size="$attrs.size"
-        :columns="TableColumns"
-        ref="superForm"
-        label-width="auto"
-        label-position="right"
-        style="padding: 20px"
-      >
-        <!-- <template slot="puOrgName" slot-scope="scope">
-          <component
-            v-bind="scope.attr"
-            v-model="scope.row[scope.item.key]"
-            :size="$attrs.size"
-            :source.sync="scope.row"
-          >
-          </component
-        ></template> -->
-      </el-super-form>
-      
-  
-      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
-        <el-tab-pane
-          v-for="({ item, TableColumns: columns }, index) in TabColumns"
-          :key="index"
-          :label="item.title"
-          :name="item.key"
-          lazy
-        >
-          <div style="height: 420px;display:flex">
-            <el-super-table
-              v-model="materialInfo[item.key]"
-              :dict="dict"
-              :ref="tabName"
-              :columns="columns"
-              :size="$attrs.size"
-            >
-              <el-table-column fixed="right" label="操作" width="120" align="center">
-                <template slot="header" slot-scope="scope">
-                  <el-button
-                    type="text"
-                    :size="$attrs.size"
-                    @click="useRowAdd(tabName)"
-                  >
-                    增行
-                  </el-button>
-                </template>
-                <template slot-scope="scope">
-                  <el-button
-                    type="text"
-                    :size="$attrs.size"
-                    @click.native.prevent="useRowRemove(tabName, scope)"
-                  >
-                  删除
-                  </el-button>
-                  <AmendantRecord
-                    v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
-                    v-model="scope.row"
-                  ></AmendantRecord>
-                </template>
-              </el-table-column>
-            </el-super-table>
-          </div>
-        </el-tab-pane>
-      </el-tabs>
-
-      
-     
-    </el-drawer>
-</template>
-
-<style scoped>
-::v-deep .el-table__row.is-hidden {
-  display: none;
-}
-</style>

+ 11 - 5
src/views/material/requisition/columns.js

@@ -1,15 +1,16 @@
 
+export default function useColumns (){
 
- export const TableColumns = [
-  { item: { key: "createName", title: "创建人" ,width:150, }, attr: {} },
+  const TableColumns = [
+  { item: { key: "createName", title: "创建人" ,width:100, }, attr: {} },
   { item: { key: "createTime", title: "创建时间" ,width:150,}, attr: {} },
   { item: { key: "billCode", title: "单据编码" }, attr: {} },
   
   {
-    item: { key: "proposerName", title: "申请人",width:150, },
+    item: { key: "proposerName", title: "申请人",width:100, },
     attr: { },
   },
-  { item: { key: "status", title: "单据状态",width:120, }, 
+  { item: { key: "status", title: "单据状态",width:100, }, 
       attr: {
         
         is: "el-dict-tag",
@@ -58,7 +59,7 @@
     item: { ...item, hidden: true, fixed: false },
   }));
 
- export const SearchColumns = [
+  const SearchColumns = [
     {
       item: { key: "billCode", title: "单据编码" },
       attr: {
@@ -222,3 +223,8 @@
     item: { ...item, hidden: true, span: item.span || 6 },
   }));
 
+  return { TableColumns,SearchColumns }
+
+}
+
+

+ 0 - 82
src/views/material/requisition/details.vue

@@ -1,82 +0,0 @@
-<!-- 物料申请单——详情 -->
-<template>
-  <el-card class="request-details">
-    1111111111
-
-    <el-row type="flex" justify="space-between">
-      <el-col :span="6">
-        <el-button size="small" @click="handleBack">返回</el-button>
-      </el-col>
-      <el-col :span="6" style="text-align: right;">
-        <!-- 附件管理 -->
-        <el-button-group>
-          <el-button size="small" icon="el-icon-paperclip"></el-button>
-        </el-button-group>
-
-        <!-- 切换 -->
-        <el-button-group>
-          <el-button size="small" icon="el-icon-d-arrow-left"></el-button>
-          <el-button size="small" icon="el-icon-arrow-left"></el-button>
-          <el-button size="small" icon="el-icon-arrow-right"></el-button>
-          <el-button size="small" icon="el-icon-d-arrow-right"></el-button>
-        </el-button-group>
-      </el-col>
-    </el-row>
-
-    <div class="rd-content">
-
-      <dr-tabs :tabList="detailsTabs">
-        <template #tabContent>11111</template>
-      </dr-tabs>
-
-    </div>
-  </el-card>
-</template>
-
-<script>
-import drTabs from '../components/dr-tabs.vue';
-// import detailsTabs from '../config/detailsTabs';
-export default {
-  name: 'material-details',
-  data() {
-    return {
-
-      detailsTabs: [
-        {
-          label: '基本信息',
-          code: 'material',
-          isShow: true,
-        },
-        {
-          label: '医药行业',
-          code: 'material_medcine',
-          isShow: true,
-        },
-      ]
-    }
-  },
-  components: {
-    drTabs
-
-  },
-  methods: {
-    // 返回
-    handleBack() {
-      this.$emit("actionBar", "requestList")
-
-    }
-  }
-
-}
-</script>
-
-<style lang="scss">
-.request-details {
-  height: calc(100vh - 158px);
-  box-sizing: border-box;
-
-  .rd-content {
-    margin-top: 12px;
-  }
-}
-</style>

+ 951 - 0
src/views/material/requisition/details/columns.js

@@ -0,0 +1,951 @@
+
+export default function useColumns(){
+
+ 
+  const TabColumns = [
+    // 基本信息
+    {
+      item:{
+        key: 'sysMaterialApply',
+        title: '基本信息',
+      },
+      attr:{
+        is: 'el-super-form',
+        
+        value:{},
+      },
+      TableColumns:[
+        {
+          item:{
+            key:'name',
+            title:'物料名称',
+            required:true,
+          },
+          attr:{
+            is: "el-input",
+            // is: "el-popover-select-v2",
+            // valueKey: "name",
+            // referName: "MATERIAL_PARAM",
+            // dataMapping: {
+            //   classifyId: 'classifyId',
+            //   classifyName: 'classifyIdName',
+            //   isMedicine: 'isMedicine',
+            //   unitId: 'unitId',
+            //   unitName: 'unitIdName',
+            //   packExplain: 'packExplain',
+            //   isInventoryStatus: 'isInventoryStatus',
+            //   manufacturerId: 'manufacturerId',
+            //   manufacturerName: 'manufacturerIdName',
+            //   deliveryPeriod: 'deliveryPeriod',
+            //   expiryDateManagerment: 'expiryDateManagerment',
+            //   registrant: 'registrant',
+            //   minOrderQty: 'minOrderQty',
+            //   expiryUnitId: 'expiryUnitId',
+            //   productionPermit: 'productionPermit',
+            //   minPackQty: 'minPackQty',
+            //   usefulLife: 'usefulLife',
+            //   storageCondition: 'storageCondition',
+            //   minBatchQty: 'minBatchQty',
+            //   usefulLifeUnitId: 'usefulLifeUnitId',
+            //   transportationCondition: 'transportationCondition',
+            //   materialRate: 'materialRate',
+            //   materialRateName: 'materialRateName',
+            //   nearOnsetManagerment: 'nearOnsetManagerment',
+            //   originPlace: 'originPlace',
+            //   originPlaceName: 'originPlaceName',
+            //   purchasingOrganization: 'purchasingOrganization',
+            //   purchasingOrganizationName: 'purchasingOrganizationName',
+            //   recentWarningPeriod: 'recentWarningPeriod',
+            //   brand:'brand',
+            //   puPersonnelId:'puPersonnelId',
+            //   puPersonnelName:'puPersonnelIdName',
+            // },
+          },
+        },
+        {
+          item:{
+            key:'code',
+            title:'物料编码',
+          },
+          attr:{
+            is: "el-input",
+            disabled: true,
+          },
+        },
+        {
+          item:{
+            key:'version',
+            title:'版本号',
+          },
+          attr:{
+            is: "el-input",
+            disabled: true,
+          },
+        },
+        {
+          item:{
+            key:'orgName',
+            title:'所属组织',
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "ORG_PARAM",
+            dataMapping: {
+              orgId:'id'
+            },
+            disabled:true,
+          },
+        },
+        {
+          item:{
+            key:'specification',
+            title:'规格',
+            required: true,
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            // key:'classifyId',
+            key:'classifyName',
+            title:'四级分类',
+            required: true,
+          },
+          attr:{
+            is: "el-popover-tree-select",
+            referName: "MATERIALCLASSIFY_PARAM",
+            valueKey: "name",
+            // 末级
+            onlyFinal: true,
+            defaultProps: {
+              label: function (data, node) {
+                return data.code + " " + data.name;
+              },
+              children: "children",
+            },
+            dataMapping: {
+              classifyId:'id'
+            }
+          },
+        },
+        {
+          item:{
+            key:'isMedicine',
+            title:'医药物料',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no", // 字典名
+          },
+          
+        },
+        {
+          item:{
+            key:'failCause',
+            title:'同步失败原因',
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            key:'model',
+            title:'型号',
+          },
+          attr:{
+            is: "el-input",
+          },
+      
+        },
+        {
+          item:{
+            key:'packExplain',
+            title:'包装说明',
+            required: true,
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            key:'serialNoManager',
+            title:'序列号管理',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no",
+          },
+        },
+        {
+          item:{
+            key:'barCode',
+            title:'条形码',
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          // 单位
+          item:{
+            key:'unitName',
+            title:'计量单位',
+            required: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "UNIT_PARAM",
+            dataMapping: {
+              unitId:'id'
+            }
+          },
+        },
+        {
+          item:{
+            key:'deliveryPeriod',
+            title:'交货周期',
+            required: true,
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+          },
+        },
+        {
+          item:{
+            key:'isInventoryStatus',
+            title:'批号及库存状态管理',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no",
+          },
+        },
+        {
+          item:{
+            key:'height',
+            title:'高度',
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+            
+          },
+        },
+        {
+          item:{
+            key:'manufacturerName',
+            title:'生产厂家/代理人',
+            required: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MANUFACTURER_PARAM",
+            dataMapping: {
+              manufacturerId: 'id',
+              brand:"brand" ,
+              originPlaceName: "countryName" ,
+              originPlace: "countryId",
+              registrant: "registrantName" ,
+              productionPermit: "productionLicense",
+            }
+          },
+        },
+        {
+          item:{
+            key:'minOrderQty',
+            title:'最小起订量',
+            required: true,
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+          },
+        },
+        {
+          item:{
+            key:'expiryDateManagerment',
+            title:'效期管理',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no",
+          },
+        },
+        {
+          item:{
+            key:'width',
+            title:'宽度',
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+          },
+        },
+        { 
+          item:{
+            key:'registrant',
+            title:'注册人/上市许可持有人',
+            required: true,
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            key:'minPackQty',
+            title:'最小包装量',
+            required: true,
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+          },
+        },
+        {
+          item:{
+            key:'expiryUnitId',
+            title:'效期单位',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "period_unit",
+          },
+        },
+        {
+          item:{
+            key:'length',
+            title:'长度',
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+          },
+        },
+        {
+          item:{
+            key:'productionPermit',
+            title:'生产许可证',
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            key:'minBatchQty',
+            title:'最小批量',
+            required: true,
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+          },
+        },
+        {
+          item:{
+            key:'usefulLife',
+            title:'有效期',
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+          },
+        },
+        {
+          item:{
+            key:'oneClass',
+            title:'一级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled: true,
+          },
+        },
+        {
+          item:{
+            key:'storageCondition',
+            title:'存储条件',
+            required: true,
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_storage_condition",
+          },
+        },
+        {
+          item:{
+            key:'diCode',
+            title:'DI码',
+          },
+          attr:{
+            is: "el-input",
+          },
+      
+        },
+        {
+          item:{
+            key:'usefulLifeUnitId',
+            title:'有效期至单位',
+          },
+          attr:{
+            is: "el-select",
+          dictName: "expiry_date",
+          },
+        },
+        {
+          item:{
+            key:'twoClass',
+            title:'二级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled: true,
+          },
+        },
+        {
+          item:{
+            key:'transportationCondition',
+            title:'运输条件',
+          },
+          attr:{
+            is: "el-select",
+          dictName: "sys_conditions_carriage",
+          },
+        },
+        {
+          item:{
+            key:'healthCode',
+            title:'医保代码',
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            key:'nearOnsetManagerment',
+            title:'近效期管理',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no",
+          },
+        },
+        {
+          item:{
+            key:'threeClass',
+            title:'三级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled: true,
+          },
+        },
+        {
+          item:{
+            key:'originPlaceName',
+            title:'产地',
+            required: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "ORIGINPLACE_PARAM",
+            dataMapping: {
+              originPlace: 'id'
+            },
+            disabled: true,
+          },
+          
+        },
+        {
+          item:{
+            key:'manufacturersMaterialCode',
+            title:'厂家物料编码',
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            key:'recentWarningPeriod',
+            title:'近效期预警天数',
+          },
+          attr:{
+            is: "el-input-number",
+            min: 0,
+            controlsPosition: "right",
+          },
+        },
+        {
+          item:{
+            key:'isEnable',
+            title:'启用状态',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "material_enable",
+            disabled: true,
+          },
+        },
+        {
+          item:{
+            key:'serviceLife',
+            title:'使用期限/次数',
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            key:'purchasingOrganizationName',
+            title:'默认采购组织',
+            required: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "ORG_PARAM",
+            dataMapping: {
+              purchasingOrganization:'id'
+            },
+          },
+        },
+        {
+          item:{
+            key:'materialRateName',
+            title:'物料税类',
+            required: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MATERIALTAX_PARAM",
+            dataMapping: {
+              materialRate: "code",
+            },
+          },
+        },
+        {
+          item:{
+            key:'remark',
+            title:'备注',
+          },
+          attr:{
+            is: "el-input",
+          },
+        },
+        {
+          item:{
+            key:'brand',
+            title:'品牌',
+          },
+          attr:{
+            is: "el-input",
+            disabled: true,
+          },
+        },
+        {
+          item:{
+            key:'puPersonnelName',
+            title:'负责采购员',
+            required: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            referName: "CONTACTS_PARAM",
+            valueKey: "name",
+            dataMapping: {
+              puPersonnelId: "code",
+            },
+          },
+        },
+        {
+          item:{
+            key:'proposerName',
+            title:'物料申请人',
+          },
+          attr:{
+            // is: "el-input",
+            // PSNLICENSE_PARAM
+            disabled: true,
+            is: "el-popover-select-v2",
+            referName: "CONTACTS_PARAM",
+            valueKey: "name",
+            dataMapping:{
+              proposerId: 'code'
+            }
+          },
+        },
+        {
+          item:{
+            key:'serviceClass',
+            title:'服务类',
+          },
+          attr:{
+            is: "el-input",
+            // min: 0,
+            // controlsPosition: "right",
+            disabled: true,
+          },
+        },
+
+      ].map(({ item, attr }) => ({
+        attr,
+        item: { ...item, hidden: true, span: item.span || 6 },
+      })),
+    },
+    // 医药属性
+    {
+      item:{
+        key:'sysMaterialMedcineApply',
+        title:'医药属性',
+      },
+      attr:{
+        is: 'el-super-form',
+        value:{},
+      },
+      TableColumns:[
+        {
+          item:{
+            key:'isDrug',
+            title:'药品',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_medicine", // 字典名
+          },
+      
+        },
+        {
+          item:{
+            key:'registrationNo',
+            title:'注册证号/备案凭证编号',
+          },
+          attr:{
+            is: "el-input",
+          },
+      
+        },
+        {
+          item:{
+            key:'medicalInstruments',
+            title:'管理类别',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "medical_instruments", // 字典名
+          },
+      
+        },
+        {
+          item:{
+            key:'commonName',
+            title:'通用名称',
+          },
+          attr:{
+            is: "el-input",
+          },
+      
+        },
+        {
+          item:{
+            key:'ratifyBatchNo',
+            title:'批准文号',
+          },
+          attr:{
+            is: "el-input",
+          },
+      
+        },
+        {
+          item:{
+            key:'dosageFromName',
+            title:'剂型',
+          },
+          attr:{
+            is: "el-popover-tree-select",
+            referName: "DOSAGEFORM_PARAM",
+            valueKey: "name",
+            dataMapping: {
+              dosageFrom:'id'
+            }
+          },
+        },
+        {
+          item:{
+            key:'oriRegistrationNo',
+            title:'旧注册证号',
+          },
+          attr:{
+            is: "el-input",
+          },
+      
+        },
+        {
+          item:{
+            key:'curingType',
+            title:'养护类型',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "curing_type", // 字典名
+          },
+        }
+      ].map(({ item, attr }) => ({
+        attr,
+        item: { ...item, hidden: true, span: item.span || 6 },
+      })),
+    },
+    // 维护物料类别
+    {
+      item:{
+        key:'sysMaterialMedcineItemApply',
+        title:'维护物料类别',
+      },
+      attr:{
+        is: 'el-super-ux-table',
+        value:[]
+      },
+      TableColumns:[
+        {
+          item:{
+            key:'drugId',
+            title:'ID',
+          },
+          attr:{
+            is: "el-input",
+            readonly:true,
+          },
+         
+        },
+        {
+          item:{
+            key:'drugCode',
+            title:'药品类别编码',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+            readonly:true,
+          },
+         
+        },
+        {
+          item:{
+            key:'drugName',
+            title:'药品类别名称',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+            // MEDICINE_DRUG
+            // is: "el-popover-select-v2",
+            // valueKey: "name",
+            // referName: "ORG_PARAM",
+            // dataMapping: {
+            //   // drugCode: undefined,
+            //   // drugId: undefined
+            // },
+            readonly:true,
+          },
+         
+        },
+      ].map(({ item, attr }) => ({
+        attr,
+        item: { ...item, hidden: true, span: item.span || 6 },
+      }))
+    }, 
+    // 单据信息
+    {
+      item:{
+        key:'applyBillInfo',
+        title:'单据信息',
+      },
+      attr:{
+        is: 'el-super-form',
+        value:{},
+      },
+      TableColumns:[
+        {
+          item:{
+            key:'createByName',
+            title:'申请人',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+      
+        },
+        {
+          item:{
+            key:'createTime',
+            title:'申请时间',
+          },
+          attr:{
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            disabled:true,
+          },
+      
+        },
+        {
+          item:{
+            key:'createByName',
+            title:'创建人',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+      
+        },
+        {
+          item:{
+            key:'createTime',
+            title:'创建时间',
+          },
+          attr:{
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            disabled:true,
+          },
+      
+        },
+        {
+          item:{
+            key:'updateByName',
+            title:'最后修改人',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+      
+        },
+        {
+          item:{
+            key:'updateTime',
+            title:'最后修改时间',
+          },
+          attr:{
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            disabled:true,
+          },
+      
+        },
+        {
+          item:{
+            key:'status',
+            title:'单据状态',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "documents_status", // 字典名
+            disabled:true,
+          },
+      
+        },
+        // {
+        //   item:{
+        //     key:'reviewedByName',
+        //     title:'最后审核人',
+        //   },
+        //   attr:{
+        //     is: "el-input",
+        //     disabled:true,
+        //   },
+      
+        // },
+        // {
+        //   item:{
+        //     key:'approvalTime',
+        //     title:'最后审核时间',
+        //   },
+        //   attr:{
+        //     is: "el-date-picker",
+        //     valueFormat: "yyyy-MM-dd HH:mm:ss",
+        //     disabled:true,
+        //   },
+      
+        // },
+        
+      ].map(({ item, attr }) => ({
+        attr,
+        item: { ...item, hidden: true, span: item.span || 6 },
+      })),
+    },
+  ]
+
+  const MaterialColums = [
+    {
+      item:{
+        key:'name',
+        title:'物料',
+      },
+      attr:{
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "MATERIAL_PARAM",
+        dataMapping: {
+          classifyId: 'classifyId',
+          classifyName: 'classifyIdName',
+          isMedicine: 'isMedicine',
+          unitId: 'unitId',
+          unitName: 'unitIdName',
+          packExplain: 'packExplain',
+          isInventoryStatus: 'isInventoryStatus',
+          manufacturerId: 'manufacturerId',
+          manufacturerName: 'manufacturerIdName',
+          deliveryPeriod: 'deliveryPeriod',
+          expiryDateManagerment: 'expiryDateManagerment',
+          registrant: 'registrant',
+          minOrderQty: 'minOrderQty',
+          expiryUnitId: 'expiryUnitId',
+          productionPermit: 'productionPermit',
+          minPackQty: 'minPackQty',
+          usefulLife: 'usefulLife',
+          storageCondition: 'storageCondition',
+          minBatchQty: 'minBatchQty',
+          usefulLifeUnitId: 'usefulLifeUnitId',
+          transportationCondition: 'transportationCondition',
+          materialRate: 'materialRate',
+          materialRateName: 'materialRateName',
+          nearOnsetManagerment: 'nearOnsetManagerment',
+          originPlace: 'originPlace',
+          originPlaceName: 'originPlaceName',
+          purchasingOrganization: 'purchasingOrganization',
+          purchasingOrganizationName: 'purchasingOrganizationName',
+          recentWarningPeriod: 'recentWarningPeriod',
+          brand:'brand',
+          puPersonnelId:'puPersonnelId',
+          puPersonnelName:'puPersonnelIdName',
+        },
+      },
+    },
+  ]
+
+  return { TabColumns, MaterialColums }
+}
+

+ 771 - 0
src/views/material/requisition/details/index.vue

@@ -0,0 +1,771 @@
+<script>
+import useColumns from "./columns";
+import {
+  addReq,
+  getReqDetail,
+  editReq,
+  saveAndToOa,
+  betchSubmit,
+} from "@/api/requisition/basic";
+import { REFER } from "@/components/popover-select/api/index";
+export default {
+  name: "AddRequsition",
+  props: {
+    dict: {
+      type: [Object, Array],
+    },
+    addType: {
+      type: String,
+      default: "add",
+    },
+  },
+  components: {
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    ElPopoverTreeSelect: () =>
+      import("@/components/popover-tree-select/index.vue"),
+  },
+  data() {
+    const {
+      MaterialColums,
+      TabColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+
+    let rules = TabColumns.reduce((pre, cur) => {
+      pre = {
+        ...pre,
+        ...this.$init.rules([...cur.TableColumns]),
+      };
+      return pre;
+    }, {});
+    const sysMaterialApply = this.$init.params([
+      ...TabColumns.find(({ item }) => item.key === "sysMaterialApply")
+        .TableColumns,
+    ]);
+    const sysMaterialMedcineApply = this.$init.params([
+      ...TabColumns.find(({ item }) => item.key === "sysMaterialMedcineApply")
+        .TableColumns,
+    ]);
+    const applyBillInfo = this.$init.params([
+      ...TabColumns.find(({ item }) => item.key === "applyBillInfo")
+        .TableColumns,
+    ]);
+    const materialReference = this.$init.params([...MaterialColums]);
+    return {
+      width: "100%",
+      visible: false,
+      loading: false,
+      rules,
+      params: {
+        sysMaterialApply: sysMaterialApply,
+        sysMaterialMedcineApply: sysMaterialMedcineApply,
+        sysMaterialMedcineItemApply: [],
+        applyBillInfo: applyBillInfo,
+      },
+      // 维护物料类别
+      maintenanceMaterialType: {
+        drugName: "",
+        drugCode: "",
+        drugId: "",
+      },
+      // 物料参考
+      materialReference: materialReference,
+      materialColums: MaterialColums[0],
+      tabName: tabName,
+      TabColumns: TabColumns,
+      count: 0,
+      delDemandItemList: [],
+    };
+  },
+  computed: {
+    title: {
+      get() {
+        const { addType } = this;
+        if (addType === "add") {
+          return "新 增";
+        }
+        if (addType === "edit") {
+          return "编 辑";
+        }
+        if (addType === "see") {
+          return "查 看";
+        }
+      },
+      set() {},
+    },
+  },
+  watch: {
+    "params.sysMaterialApply.isMedicine": {
+      handler: async function (nVal, oVal) {
+        this.params.sysMaterialMedcineApply.isDrug = nVal === "0" ? "2" : "";
+        if (nVal === "2") {
+          // 维护物料类别
+          try {
+            let { code, rows } = await REFER({
+              type: "MEDICINE_DRUG",
+              search: "其他非医疗器械",
+              isPage: false,
+            });
+
+            if (code == 200) {
+              console.log(rows, "rows");
+              let { id, code, name } = rows[0];
+              this.params.sysMaterialMedcineItemApply = [
+                {
+                  drugName: name,
+                  drugCode: code,
+                  drugId: id,
+                },
+              ];
+            }
+          } catch (error) {}
+        }
+      },
+    },
+    "params.sysMaterialApply.expiryDateManagerment": {
+      handler: function (nVal, oVal) {
+        if (nVal === "0") {
+          this.rules.expiryUnitId = [
+            {
+              required: true,
+              message: "效期单位",
+              trigger: "change",
+            },
+          ];
+          this.rules.usefulLife = [
+            {
+              required: true,
+              message: "有效期",
+              trigger: "change",
+            },
+          ];
+          this.rules.usefulLifeUnitId = [
+            {
+              required: true,
+              message: "有效期至单位",
+              trigger: "change",
+            },
+          ];
+          this.rules.recentWarningPeriod = [
+            {
+              required:
+                this.params.sysMaterialApply.nearOnsetManagerment === "0",
+              message: "近效期预警天数",
+              trigger: "change",
+            },
+          ];
+        } else {
+          this.rules.expiryUnitId = null;
+          this.rules.usefulLife = null;
+          this.rules.usefulLifeUnitId = null;
+          this.rules.recentWarningPeriod = null;
+          this.params.sysMaterialApply.nearOnsetManagerment = "2";
+        }
+        this.count++;
+      },
+    },
+    "params.sysMaterialApply.nearOnsetManagerment": {
+      handler: function (nVal, oVal) {
+        if (nVal === "0") {
+          this.rules.recentWarningPeriod = [
+            {
+              required:
+                this.params.sysMaterialApply.expiryDateManagerment === "0",
+              message: "近效期预警天数",
+              trigger: "change",
+            },
+          ];
+        } else {
+          this.rules.recentWarningPeriod = null;
+        }
+        this.count++;
+      },
+    },
+  },
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    beforeOpen() {
+      let { name, nickName, deptId, deptName, orgId, orgName } =
+        this.$store.state.user;
+      if (this.addType === "add") {
+        this.params.sysMaterialApply.isMedicine = "0";
+        this.params.sysMaterialApply.storageCondition = "MED2001";
+        this.params.sysMaterialApply.isInventoryStatus = "0";
+        this.params.sysMaterialApply.transportationCondition = "MED3003";
+        this.params.sysMaterialApply.isEnable = "0";
+        this.params.sysMaterialApply.materialRateName = "专票13%";
+        this.params.sysMaterialApply.materialRate = "1001A11000000000TPTF";
+        this.params.sysMaterialApply.proposerId = name;
+        this.params.sysMaterialApply.proposerName = nickName;
+        this.params.sysMaterialApply.orgId = "";
+        this.params.sysMaterialApply.orgName = "德荣集团";
+        this.params.sysMaterialApply.expiryDateManagerment = "0";
+        this.params.sysMaterialApply.nearOnsetManagerment = "0";
+        //
+        this.params.sysMaterialMedcineApply.dosageFrom = "0001A11000000000BX7Z";
+        this.params.sysMaterialMedcineApply.dosageFromName = "其他";
+      }
+      if (this.addType === "see") {
+        this.TabColumns = this.TabColumns.map((tab) => {
+          return {
+            ...tab,
+            TableColumns: tab.TableColumns.map(({ item, attr }) => {
+              return {
+                item: { ...item },
+                attr: {
+                  ...attr,
+                  disabled: true,
+                },
+              };
+            }),
+          };
+        });
+      }
+    },
+
+    //
+    async fetchItem(prop) {
+      console.log(prop, "prop----------------");
+      try {
+        // try
+        this.loading = true;
+
+        let { code, data } = await getReqDetail(prop.id);
+
+        if (code == 200) {
+          this.params = data;
+          // 复制
+          if (this.addType === "add") {
+            this.copyEmpty();
+          }
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+
+    // 复制清空值
+    copyEmpty() {
+      const { id, name, nickName } = this.$store.state.user;
+      let {
+        sysMaterialApply,
+        sysMaterialMedcineApply,
+        sysMaterialMedcineItemApply,
+      } = this.params;
+      // 基本信息
+      sysMaterialApply["id"] = "";
+      sysMaterialApply["code"] = "";
+      sysMaterialApply["billCode"] = "";
+      sysMaterialApply["diCode"] = "";
+      sysMaterialApply["healthCode"] = "";
+      sysMaterialApply["proposerName"] = nickName;
+      sysMaterialApply["proposerId"] = name;
+      // 医药属性
+      sysMaterialMedcineApply["id"] = "";
+      // 维护物料类别
+      sysMaterialMedcineItemApply.length &&
+        (this.params.sysMaterialMedcineItemApply =
+          sysMaterialMedcineItemApply.map((item) => {
+            return {
+              ...item,
+              id: "",
+            };
+          }));
+      // 单据信息
+      this.params.applyBillInfo = {
+        ...this.$init.params([
+          ...this.TabColumns.find(({ item }) => item.key === "applyBillInfo")
+            .TableColumns,
+        ]),
+        auditTime: "",
+      };
+    },
+
+    //
+    async hide() {
+      const {
+        TabColumns,
+        TabColumns: [
+          {
+            item: { key: tabName },
+          },
+        ],
+      } = useColumns();
+      this.visible = false;
+      this.$emit("success");
+      this.tabName = tabName;
+      this.TabColumns = TabColumns;
+      this.params = {
+        sysMaterialApply: this.$init.params([
+          ...TabColumns.find(({ item }) => item.key === "sysMaterialApply")
+            .TableColumns,
+        ]),
+        sysMaterialMedcineApply: this.$init.params([
+          ...TabColumns.find(
+            ({ item }) => item.key === "sysMaterialMedcineApply"
+          ).TableColumns,
+        ]),
+        sysMaterialMedcineItemApply: [],
+        applyBillInfo: this.$init.params([
+          ...TabColumns.find(({ item }) => item.key === "applyBillInfo")
+            .TableColumns,
+        ]),
+      };
+    },
+    //
+    async useRowAdd(prop) {
+      let { open } = this.$refs.materialTypeTree[0];
+      open();
+      // const { TableColumns } = this.TabColumns.find(
+      //   ({ item: { key } }) => key === prop
+      // );
+      // this.params[prop].push({
+      //   delFlag: "0",
+      //   ...this.$init.params(TableColumns),
+      // });
+    },
+    //
+    async useRowRemove(prop, scope) {
+      scope.row.delFlag = "2";
+
+      let delList = [];
+
+      delList = this.params[prop].filter((item) => {
+        return item.delFlag == "2";
+      });
+      this.params[prop] = this.params[prop].filter((item) => {
+        return item.delFlag == "0";
+      });
+      this.delDemandItemList.push(...delList);
+    },
+    // saveParams
+    handleParams() {
+      let list = [];
+
+      let {
+        sysMaterialApply: { isMedicine },
+        sysMaterialMedcineItemApply,
+      } = this.params;
+
+      list.push(...sysMaterialMedcineItemApply, ...this.delDemandItemList);
+
+      // 深拷贝一下参数对象
+      let param = JSON.parse(JSON.stringify(this.params));
+      param.sysMaterialMedcineItemApply = list;
+
+      if (isMedicine === "0" && !sysMaterialMedcineItemApply.length) {
+        return this.$modal.notifyWarning("医药物料需要维护物料类别!");
+      }
+      console.log(param, "param最终保存传输的值");
+      return param;
+    },
+    // 保存
+    async useSave() {
+      try {
+        this.loading = true;
+        let params = await this.handleParams();
+        if (params) {
+          let { code, msg } =
+            this.addType === "add"
+              ? await addReq(params)
+              : await editReq(params);
+          code == 200 && this.hide();
+          this.$notify({
+            type: code == 200 ? "success" : "error",
+            message: msg,
+          });
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 提交
+    async useSubmit() {
+      try {
+        this.loading = true;
+        let params = await this.handleParams();
+        if (params) {
+          let { code, msg } = await betchSubmit({ ids: [Number(params.id)] });
+          code == 200 && this.hide();
+          this.$notify({
+            type: code == 200 ? "success" : "error",
+            message: msg,
+          });
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 保存并提交
+    async saveSubmit() {
+      try {
+        this.loading = true;
+        let params = await this.handleParams();
+        if (params) {
+          let { code, msg } = await saveAndToOa(params);
+          code == 200 && this.hide();
+          this.$notify({
+            type: code == 200 ? "success" : "error",
+            message: msg,
+          });
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
+
+    materialTypeChange(tabName) {
+      let { drugId } = this.maintenanceMaterialType;
+
+      let isExist = this.params[tabName].find((item) => item.drugId === drugId);
+
+      if (isExist) {
+        this.$message.warning({
+          message: "请勿重复选择",
+        });
+      } else {
+        this.params[tabName].push({
+          ...this.maintenanceMaterialType,
+          delFlag: "0",
+        });
+      }
+    },
+    // 物料参考
+    openMaterialReference() {
+      let { open } = this.$refs.materialPopoverSelect[0];
+      open();
+    },
+    materialReferenceChange(prop, { source }) {
+      console.log(prop, "prop");
+      console.log(source, "source");
+      this.params.sysMaterialApply = {
+        ...this.params.sysMaterialApply,
+        ...source,
+      };
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<template>
+  <el-drawer
+    class="detailsRequsition"
+    v-bind="$attrs"
+    v-on="$listeners"
+    v-loading="loading"
+    :visible.sync="visible"
+    :size="width"
+    :show-close="false"
+    destroy-on-close
+    @close="hide"
+    @open="beforeOpen"
+  >
+    <div
+      slot="title"
+      style="display: flex; justify-content: space-between; align-items: center"
+    >
+      <h3>{{ title }}</h3>
+      <div>
+        <el-button
+          v-if="addType !== 'see'"
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSave"
+          >保 存</el-button
+        >
+        <el-button
+          v-if="
+            addType !== 'see' &&
+            (params.sysMaterialApply.status == '0' ||
+              params.sysMaterialApply.status == '3')
+          "
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="saveSubmit"
+          >保存并提交</el-button
+        >
+        <el-button
+          v-if="
+            addType === 'see' &&
+            (params.sysMaterialApply.status == '0' ||
+              params.sysMaterialApply.status == '3')
+          "
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSubmit"
+          >提交</el-button
+        >
+        <el-button :size="$attrs.size" :loading="loading" @click="hide"
+          >取 消</el-button
+        >
+      </div>
+    </div>
+
+    <el-tabs
+      v-model="tabName"
+      style="margin: 0 16px"
+      type="border-card"
+      :key="count"
+    >
+      <el-tab-pane
+        v-for="(
+          { item, TableColumns: columns, attr: { is } }, index
+        ) in TabColumns"
+        :key="index"
+        :label="item.title"
+        :name="item.key"
+        lazy
+      >
+        <!--  -->
+        <component
+          v-if="is === 'el-super-form' && visible"
+          :is="is"
+          v-model="params[item.key]"
+          :dict="dict"
+          :rules="rules"
+          :size="$attrs.size"
+          :columns="columns"
+          :ref="tabName"
+          label-width="166px"
+          label-position="right"
+          style="padding: 0px 18px"
+        >
+          <!-- 物料名称 -->
+          <template slot="name" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="addType === 'see'"
+              style="width: 100%"
+            >
+              <el-button
+                slot="append"
+                icon="el-icon-search"
+                @click="openMaterialReference"
+              >
+                <el-popover-select-v2
+                  ref="materialPopoverSelect"
+                  v-show="false"
+                  title="物料"
+                  v-model="materialReference.name"
+                  :source.sync="materialReference"
+                  v-bind="materialColums.attr"
+                  style="width: 100%"
+                  @change="materialReferenceChange"
+                >
+                </el-popover-select-v2>
+              </el-button>
+            </component>
+          </template>
+          <!-- 药品 -->
+          <template slot="isDrug" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="
+                params.sysMaterialApply.isMedicine !== '0' || addType === 'see'
+              "
+            >
+              <!-- @change="Change({ ...scope, selectData: $event })" -->
+              <el-option
+                v-for="item in dict.type[scope.attr.dictName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </component>
+          </template>
+          <!-- 效期管理:expiryDateManagerment
+             近效期管理:nearOnsetManagerment -->
+          <!-- 有效期 -->
+          <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="
+                params.sysMaterialApply.expiryDateManagerment !== '0' ||
+                addType === 'see'
+              "
+              style="width: 100%"
+            ></component>
+          </template>
+          <!-- 效期单位 -->
+          <template slot="expiryUnitId" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="
+                params.sysMaterialApply.expiryDateManagerment !== '0' ||
+                addType === 'see'
+              "
+            >
+              <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="usefulLifeUnitId" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="
+                params.sysMaterialApply.expiryDateManagerment !== '0' ||
+                addType === 'see'
+              "
+            >
+              <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="recentWarningPeriod" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="
+                params.sysMaterialApply.expiryDateManagerment !== '0' ||
+                addType === 'see'
+              "
+              style="width: 100%"
+            ></component>
+          </template>
+
+          <!-- 生产厂家/代理人 -->
+          <template slot="manufacturerName" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              copy
+              readonly
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              :disabled="addType === 'see'"
+              style="width: 100%"
+            ></component>
+          </template>
+        </component>
+
+        <!--  -->
+        <component
+          v-if="is === 'el-super-ux-table'"
+          :is="is"
+          v-model="params[item.key]"
+          :dict="dict"
+          :height="420"
+          :ref="tabName"
+          :columns="columns"
+          :size="$attrs.size"
+        >
+          <ux-table-column
+            fixed="right"
+            title="操作"
+            width="120"
+            align="center"
+          >
+            <template slot="header" slot-scope="scope">
+              <el-button
+                v-if="tabName === 'sysMaterialMedcineItemApply'"
+                type="text"
+                :size="$attrs.size"
+                :disabled="addType === 'see'"
+                @click="useRowAdd(tabName)"
+              >
+                增行
+                <el-popover-tree-select
+                  ref="materialTypeTree"
+                  v-show="false"
+                  v-model="maintenanceMaterialType.drugName"
+                  :source.sync="maintenanceMaterialType"
+                  referName="MEDICINE_DRUG"
+                  valueKey="name"
+                  :dataMapping="{
+                    drugCode: 'code',
+                    drugId: 'id',
+                  }"
+                  :defaultProps="{
+                    label: function (data, node) {
+                      return data.code + '' + data.name;
+                    },
+                    children: 'children',
+                  }"
+                  @change="materialTypeChange(tabName)"
+                ></el-popover-tree-select>
+              </el-button>
+            </template>
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                :size="$attrs.size"
+                :disabled="addType === 'see'"
+                @click.native.prevent="useRowRemove(tabName, scope)"
+              >
+                删除
+              </el-button>
+              <!-- <AmendantRecord
+                v-if="
+                  tabName === 'materialBasic' &&
+                  addType === 'edit' &&
+                  scope.row.id
+                "
+                v-model="scope.row"
+              ></AmendantRecord> -->
+            </template>
+          </ux-table-column>
+        </component>
+      </el-tab-pane>
+    </el-tabs>
+  </el-drawer>
+</template>
+
+<style scoped lang="scss">
+::v-deep.detailsRequsition .el-drawer__header {
+  margin: 0;
+  padding: 0 16px;
+}
+</style>

+ 14 - 0
src/views/material/requisition/dicts.js

@@ -0,0 +1,14 @@
+import { initDicts } from "@/utils/init.js";
+const modules = require.context("./", true, /columns.js$/);
+const columns = [];
+modules.keys().forEach((fileName) => {
+  const data = modules(fileName).default();
+  for (const key in data) {
+    if (key === "TabColumns") {
+      columns.push(...data[key].map((item) => item.TableColumns).flat());
+    } else {
+      columns.push(...data[key]);
+    }
+  }
+});
+export const dicts = initDicts(columns);

+ 504 - 363
src/views/material/requisition/index copy.vue

@@ -1,411 +1,552 @@
 <template>
   <div class="requisition" v-loading="failLoad">
     <div class="applyList" v-if="isList">
-      <el-row :gutter="10" class="mb10">
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">单据编码</span>
-          <el-input
-            v-model="queryParams.billCode"
-            size="small"
-            placeholder="请输入单据编码查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
+      <el-card
+        :body-style="{
+          height: '100%',
+          padding: 0,
+          display: 'flex',
+          'flex-direction': 'column',
+        }"
+      >
+        <el-super-search
+          v-model="params"
+          :size="size"
+          :dict="dict"
+          :columns="SearchColumns"
+          @reset="reset"
+          @submit="getList"
+        ></el-super-search>
 
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
-          <el-input
-            v-model="queryParams.name"
-            size="small"
-            placeholder="请输入物料名称查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
-
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">单据状态</span>
-          <el-select
-            v-model="queryParams.status"
-            size="small"
-            placeholder="请选择单据状态"
-            clearable
-            style="width: 240px">
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value">
-            </el-option>
-          </el-select>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
-        </el-col>
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>高级查询</el-button>
-        </el-col> -->
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="reset">重置</el-button>
-        </el-col>
-
-      </el-row>
-
-      <el-row :gutter="10" class="mb10">
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain
-                     @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载
-          </el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button size="small" @click="handleImport">批量导入</el-button>
-        </el-col>
-        <!-- 导入弹窗 -->
-        <el-dialog 
-          title="批量导入" 
-          :visible.sync="importData.show" 
-          width="35%" 
-          center
-          :before-close="handlefileDialogColse"
+        <el-row
+          :gutter="10"
+          class="mb10"
+          type="flex"
+          justify="end"
+          style="margin-top: 15px"
         >
-          <div class="mb-import">
-            <el-upload 
-              accept=".xls, .xlsx" 
-              ref="upload" 
-              action="#" 
-              :on-remove="handleFileRemove"
-              :file-list="importData.list" 
-              :auto-upload="false" 
-              :on-change="handleChangeFile" 
-              :limit="1"
-              style="text-align: center;"
+          <el-col :span="1.5">
+            <el-button type="primary" :size="size" plain @click="newAdd"
+              >新增</el-button
             >
-              <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-              <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
-            </el-upload>
-
-          </div>
-          <span slot="footer">
-        <el-button @click="handleImportData('cancal')">取 消</el-button>
-        <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
-      </span>
-        </el-dialog>
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>导入</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>导出</el-button>
-        </el-col> -->
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>批量提交</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>批量删除</el-button>
-        </el-col> -->
-      </el-row>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              :size="size"
+              :disabled="checkedList.length != 1"
+              @click="handleCopy"
+              >复制</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              :size="size"
+              plain
+              @click="
+                download(
+                  '/system/apply/material/download',
+                  {},
+                  '申请单模板.xlsx'
+                )
+              "
+              >模板下载
+            </el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button-group>
+              <el-button :size="size" @click="handleImport">批量导入</el-button>
+              <!-- <el-button  
+            :size="size"
+              @click="handleDownload" 
+              v-hasPermi="['system:apply:export']"
+            >批量导出</el-button> -->
+              <el-button :size="size" @click="handleBatchSubmit"
+                >批量提交</el-button
+              >
+            </el-button-group>
+          </el-col>
+          <!-- 导入弹窗 -->
+          <el-dialog
+            title="批量导入"
+            :visible.sync="importData.show"
+            width="35%"
+            center
+            :before-close="handlefileDialogColse"
+          >
+            <div class="mb-import">
+              <el-upload
+                accept=".xls, .xlsx"
+                ref="upload"
+                action="#"
+                :on-remove="handleFileRemove"
+                :file-list="importData.list"
+                :auto-upload="false"
+                :on-change="handleChangeFile"
+                :limit="1"
+                style="text-align: center"
+              >
+                <el-button slot="trigger" size="small" type="primary"
+                  >选取文件</el-button
+                >
+                <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
+              </el-upload>
+            </div>
+            <span slot="footer">
+              <el-button @click="handleImportData('cancal')">取 消</el-button>
+              <el-button type="primary" @click="handleImportData('confirm')"
+                >确 定</el-button
+              >
+            </span>
+          </el-dialog>
+        </el-row>
 
-      <el-card>
-        <el-table
-          :data="tableList"
-          class="request-table"
-          fit
-          max-height="680"
+        <el-super-ux-table
+          v-model="tableList"
+          :dict="dict"
+          :columns="TableColumns"
+          :size="size"
+          pagination
+          index
+          checkbox
+          convenitentOperation
+          :page="pageStatus"
+          storage-key="MaterialRequisitionSuperTable"
+          @pagination="getList"
+          @row-dblclick="check"
           @selection-change="handleSelectionChange"
           @select="handleSelect"
         >
-          <el-table-column type="selection" width="45"></el-table-column>
-          <el-table-column label="序号" align="center" type="index" width="50"/>
-          <el-table-column label="所属组织" align="center" width="200" prop="orgName"/>
-          <el-table-column label="单据编码" align="center" width="200" prop="billCode"/>
-          <el-table-column label="申请人" align="center" prop="createName"/>
-          <el-table-column label="申请时间" align="center" width="150" prop="createTime"/>
-          <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug"/>
-          <!-- <el-table-column label="物料编码" align="center" width="150" prop="materialCode" /> -->
-          <el-table-column label="物料名称" align="center" width="150" prop="name"/>
-          <el-table-column label="创建人" align="center" prop="createName"/>
-          <el-table-column label="创建时间" align="center" width="150" prop="createTime"/>
-          <el-table-column label="最后修改人" align="center" width="120" prop="updateName"/>
-          <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime"/>
-          <el-table-column
+          <ux-table-column
             fixed="right"
-            label="操作"
+            title="操作"
             align="center"
             width="180"
           >
             <template slot-scope="scope">
-              <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
-              <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text"
-                         size="small">编辑
-              </el-button>
-              <!-- <el-button @click="commit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">提交</el-button> -->
-              <el-button type="text" size="small" @click="deleteRow(scope.row)"
-                         v-if="scope.row.status == 0 || scope.row.status == 3">删除
-              </el-button>
+              <el-button type="text" :size="size" @click.stop="check(scope.row)"
+                >查看</el-button
+              >
+              <el-button
+                @click.stop="edit(scope.row)"
+                v-if="scope.row.status == 0 || scope.row.status == 3"
+                type="text"
+                :size="size"
+                >编辑</el-button
+              >
+              <el-button
+                @click.stop="jumpFlow(scope.row)"
+                v-if="scope.row.oaId && scope.row.oaId != ''"
+                type="text"
+                :size="size"
+                >流程跳转</el-button
+              >
+              <el-button
+                type="text"
+                :size="size"
+                @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-table>
-
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :page-sizes="[5, 10, 15, 20]"
-          :page-size=queryParams.pageSize
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="total"
-          style="text-align: center;">
-        </el-pagination>
+          </ux-table-column>
+        </el-super-ux-table>
       </el-card>
     </div>
 
-    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"
-               v-if="!isList"/>
+    <component
+      :is="isComponent"
+      v-model="isList"
+      :pageStu="page"
+      :disable="disable"
+      :row="rowDetail"
+      @refresh="getList"
+      v-if="!isList"
+    />
   </div>
 </template>
 
 <script>
-  import addReq from './add.vue';
-  import {getReqList, delReq, importData, fileImport} from '@/api/requisition/basic';
-  import {saveAs} from "file-saver";
-  import { blobValidate } from "@/utils/ruoyi";
+import addReq from "./add.vue";
+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";
+import { initDicts } from "@/utils/init.js";
 
-  export default {
-    name: 'requisition',
-    components: {
-      addReq
-    },
-    data() {
-      return {
-        failLoad: false,
-        tableList: [],
-        queryParams: {
-          billCode: '',
-          name: '',
-          status: '',
-          pageNum: 1,
-          pageSize: 10
+export default {
+  name: "requisition",
+  dicts: [...initDicts([...SearchColumns, ...TableColumns]), "oa_templete_id"],
+  components: {
+    addReq,
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
+  },
+  data() {
+    const params = this.$init.params(SearchColumns);
+    return {
+      failLoad: false,
+      tableList: [],
+      size: "mini",
+      params: params,
+      SearchColumns: SearchColumns,
+      TableColumns: TableColumns,
+      pageStatus: { pageNum: 1, pageSize: 50, total: 0 },
+      queryParams: {
+        billCode: "",
+        name: "",
+        status: "",
+        pageNum: 1,
+        pageSize: 10,
+      },
+      options: [
+        {
+          value: 0,
+          label: "未提交",
         },
-        options: [{
-          value: 0, label: '未提交'
-        }, {
-          value: 1, label: '审批中'
-        }, {
-          value: 2, label: '已完成'
-        }, {
-          value: 3, label: '已驳回'
-        },],
-        total: 0,
-        // isComponent
-        isComponent: 'addReq',
-        isList: true,
-        // 页面状态
-        page: '',
-        rowDetail: {},
-        disable: false,
-        checkedList: [],
-        importData: {
-          show: false,
-          list: []
+        {
+          value: 1,
+          label: "审批中",
         },
-      }
+        {
+          value: 2,
+          label: "已完成",
+        },
+        {
+          value: 3,
+          label: "已驳回",
+        },
+      ],
+      total: 0,
+      // isComponent
+      isComponent: "addReq",
+      isList: true,
+      // 页面状态
+      page: "",
+      rowDetail: {},
+      disable: false,
+      checkedList: [],
+      importData: {
+        show: false,
+        list: [],
+      },
+    };
+  },
+  created() {},
+  mounted() {
+    this.params.billCode = this.$route.query.billCode;
+    this.getList(this.queryParams);
+  },
+  methods: {
+    // 操作提示弹窗
+    handleConfirmTips(success) {
+      this.$confirm("是否继续此操作?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          success();
+        })
+        .catch(() => {});
     },
-    created() {
+    // 批量提交
+    async handleBatchSubmit() {
+      let filterList = this.checkedList.filter(
+        (item) => !(item.status === "0" || item.status === "3")
+      );
 
-    },
-    mounted() {
-      this.getList(this.queryParams)
-    },
-    methods: {
-      reset() {
-        this.queryParams.billCode = ''
-        this.queryParams.name = ''
-        this.queryParams.status = ''
-        this.queryParams.pageNum = 1
-        this.getList(this.queryParams)
-      },
-      newAdd() {
-        this.isList = false
-        this.isComponent = 'addReq'
-        this.page = 'add'
-        this.disable = false
-      },
-      // 复制
-      handleCopy() {
-        this.isList = false;
-        this.isComponent = 'addReq';
-        this.page = 'copy';
-        this.rowDetail = this.checkedList[0];
-        this.disable = false;
-      },
-      // 导入
-      handleImport() {
-        this.importData.show = true
-      },
-      // 删除文件
-      handleFileRemove(file, fileList) {
-        console.log('删除文件', file, 'file', fileList, 'fileList');
-        this.importData.list = fileList;
-      },
-      // 文件发生改变
-      handleChangeFile(file, fileList) {
-        this.importData.list = fileList;
-      },
-      // 导入弹窗操作
-      handleImportData(type) {
-        switch (type) {
-          // 取消
-          case 'cancal':
-            this.importData.list = [];
-            this.importData.show = false;
-            break;
-          // 确认
-          case 'confirm':
-            if (this.importData.list.length) {
+      console.log(filterList, "filterList", this.checkedList.length);
 
-              let formData = new FormData();
+      if (!filterList.length && this.checkedList.length) {
+        this.handleConfirmTips(async () => {
+          try {
+            this.failLoad = true;
 
-              formData.append('file', this.importData.list[0].raw);
-              importData(formData).then(res => {
-                if (res.code == 200) {
-                  this.importData.show = false;
-                  this.importData.list = [];
-                  if (res.data.flag) {
-                    this.failLoad = true;
-                    console.log(res.data.datas)
-                    let param = {failDatas: res.data.datas}
-                    if (null != param) {
+            let ids = this.checkedList.map((item) => Number(item.id));
 
-                      fileImport(param).then(res => {
-                        console.log('res',res)
-                        const isBlob = blobValidate(res);
-                        if (isBlob) {
-                          const blob = new Blob([res]);
-                          saveAs(blob, '导入失败的物料申请单数据.xlsx');
-                        }
-                        this.failLoad = false;
-                      })
-                    }
-                  }
-                  this.$message({
-                    message: res.data.msg,
-                    type: res.data.flag ? 'warning' : 'success'
-                  });
-                } else {
-                  this.$message({
-                    message: res.msg,
-                    type: res.code == 200 ? 'success' : 'warning'
-                  });
-                }
-              })
-            } else {
-              this.$message({
-                message: '请上传文件之后在确认!',
-                type: 'warning'
-              });
+            let { code, msg } = await betchSubmit({ ids });
+
+            if (code == 200) {
+              this.reset();
             }
-            break;
-        }
-      },
-      handlefileDialogColse(done){
-        this.importData.list = [];
-        done();
-      },
-      // Select框
-      handleSelect(selection, row) {
 
-        this.checkedList = selection;
+            this.$notify({
+              title: code == 200 ? msg : "error",
+              type: code == 200 ? "success" : "error",
+              message: code == 200 ? "" : msg,
+            });
+          } catch (error) {
+          } finally {
+            this.failLoad = false;
+          }
+        });
+      } else {
+        this.$notify.warning({
+          title: "警告",
+          message: "存在不符合提交条件数据或未选择数据!",
+        });
+      }
+    },
 
-        console.log(this.checkedList, 'this.checkedList');
+    async jumpFlow(row) {
+      const { name } = this.$store.state.user;
 
-      },
-      getList(val) {
-        console.log('val', val)
-        getReqList(val).then(res => {
-          if (res.code === 200) {
-            this.tableList = res.rows
-            this.total = res.total
-          }
-        })
-        this.checkedList = [];
-      },
-      // 表格内状态栏判断值
-      statusJug(row) {
-        if (row.status == 0) {
-          return '未提交'
-        } else if (row.status == 1) {
-          return '审批中'
-        } else if (row.status == 2) {
-          return '已完成'
-        } else if (row.status == 3) {
-          return '已驳回'
+      try {
+        let { code, msg, oaUrl } = await toOA(name, row.oaId);
+
+        if (code == 200) {
+          window.open(oaUrl);
         }
-      },
-      //
-      handleSelectionChange() {
+      } catch (error) {
+      } finally {
+      }
+    },
 
-      },
-      check(row) {
-        console.log('查看详情', row)
-        this.isList = false
-        this.isComponent = 'addReq'
-        this.page = 'check'
-        this.rowDetail = row
-        this.disable = true
-      },
-      edit(row) {
-        console.log('修改先加载详情', row)
-        this.isList = false
-        this.isComponent = 'addReq'
-        this.page = 'edit'
-        this.rowDetail = row
-        this.disable = false
-      },
-      commit(row) {
-        console.log('row', row)
-      },
-      deleteRow(row) {
-        this.$confirm('是否删除此条数据?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          delReq(row.id).then(res => {
+    reset() {
+      // this.queryParams.billCode = ''
+      // this.queryParams.name = ''
+      // this.queryParams.status = ''
+      // this.queryParams.pageNum = 1
+      this.pageStatus.pageNum = 1;
+      this.pageStatus.pageSize = 10;
+      this.params = this.$init.params(SearchColumns);
+      this.getList(this.queryParams);
+    },
+    newAdd() {
+      this.isList = false;
+      this.isComponent = "addReq";
+      this.page = "add";
+      this.disable = false;
+    },
+    // 复制
+    handleCopy() {
+      this.isList = false;
+      this.isComponent = "addReq";
+      this.page = "copy";
+      this.rowDetail = this.checkedList[0];
+      this.disable = false;
+    },
+    // 导入
+    handleImport() {
+      this.importData.show = true;
+    },
+    // 导出
+    handleDownload() {
+      let params = {
+        ...this.params,
+      };
+      this.download(
+        "/system/apply/material/export",
+        { ...params },
+        `物料申请单${new Date().getTime()}.xlsx`
+      );
+    },
+    // 删除文件
+    handleFileRemove(file, fileList) {
+      // console.log('删除文件', file, 'file', fileList, 'fileList');
+      this.importData.list = fileList;
+    },
+    // 文件发生改变
+    handleChangeFile(file, fileList) {
+      this.importData.list = fileList;
+    },
+    // 导入弹窗操作
+    handleImportData(type) {
+      switch (type) {
+        // 取消
+        case "cancal":
+          this.importData.list = [];
+          this.importData.show = false;
+          break;
+        // 确认
+        case "confirm":
+          if (this.importData.list.length) {
+            let formData = new FormData();
+
+            formData.append("file", this.importData.list[0].raw);
+            importData(formData).then((res) => {
+              if (res.code == 200) {
+                this.importData.show = false;
+                this.importData.list = [];
+                if (res.data.flag) {
+                  this.failLoad = true;
+                  // console.log(res.data.datas)
+                  let param = { failDatas: res.data.datas };
+                  if (null != param) {
+                    fileImport(param).then((res) => {
+                      console.log("res", res);
+                      const isBlob = blobValidate(res);
+                      if (isBlob) {
+                        const blob = new Blob([res]);
+                        saveAs(blob, "导入失败的物料申请单数据.xlsx");
+                      }
+                      this.failLoad = false;
+                      this.reset();
+                    });
+                  }
+                }
+                this.$message({
+                  message: res.data.msg,
+                  type: res.data.flag ? "warning" : "success",
+                });
+              } else {
+                this.$message({
+                  message: res.msg,
+                  type: res.code == 200 ? "success" : "warning",
+                });
+              }
+            });
+          } else {
+            this.$message({
+              message: "请上传文件之后在确认!",
+              type: "warning",
+            });
+          }
+          break;
+      }
+    },
+    handlefileDialogColse(done) {
+      this.importData.list = [];
+      done();
+    },
+    // Select框
+    handleSelect(selection, row) {
+      this.checkedList = selection;
+
+      // console.log(this.checkedList, 'this.checkedList');
+    },
+    getList(val) {
+      // console.log('val', val)
+      this.failLoad = true;
+
+      getReqList({ ...this.params, ...this.pageStatus }).then((res) => {
+        this.failLoad = false;
+        if (res.code === 200) {
+          this.tableList = res.rows;
+          // this.total = res.total;
+          this.pageStatus.total = res.total;
+        }
+      });
+      // this.checkedList = [];
+    },
+    // 表格内状态栏判断值
+    statusJug(row) {
+      if (row.status == 0) {
+        return "未提交";
+      } else if (row.status == 1) {
+        return "审批中";
+      } else if (row.status == 2) {
+        return "已完成";
+      } else if (row.status == 3) {
+        return "已驳回";
+      }
+    },
+    //
+    handleSelectionChange(selection) {
+      this.checkedList = selection;
+    },
+    check(row) {
+      console.log("xxxx", this.dict.type);
+      // console.log('查看详情', row)
+      this.isList = false;
+      this.isComponent = "addReq";
+      this.page = "check";
+      this.rowDetail = row;
+      this.disable = true;
+    },
+    edit(row) {
+      // console.log('修改先加载详情', row)
+      this.isList = false;
+      this.isComponent = "addReq";
+      this.page = "edit";
+      this.rowDetail = row;
+      this.disable = false;
+    },
+    commit(row) {
+      // console.log('row', row)
+    },
+    deleteRow(row) {
+      this.$confirm("是否删除此条数据?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          delReq(row.id).then((res) => {
             if (res.code === 200) {
               this.$message({
                 message: res.msg,
-                type: 'success'
+                type: "success",
               });
-              this.getList(this.queryParams)
+              this.getList(this.queryParams);
             }
-          })
-        }).catch(() => {
+          });
         })
-      },
-      handleSizeChange(val) {
-        console.log(`每页 ${val} 条`);
-        this.queryParams.pageSize = val
-        this.getList(this.queryParams)
-      },
-      handleCurrentChange(val) {
-        console.log(`当前页: ${val}`);
-        this.queryParams.pageNum = val
-        this.getList(this.queryParams)
+        .catch(() => {});
+    },
+    // handleSizeChange(val) {
+    //   console.log(`每页 ${val} 条`);
+    //   this.queryParams.pageSize = val
+    //   this.getList(this.queryParams)
+    // },
+    // handleCurrentChange(val) {
+    //   console.log(`当前页: ${val}`);
+    //   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.billCode,
+          billMaker: row.createBy,
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
+        }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.getList(this.queryParams);
       }
-    }
-  }
+    },
+  },
+};
 </script>
 
 <style scoped lang="scss">
-  .requisition {
-    height: calc(100vh - 84px);
-    padding: 12px;
-    box-sizing: border-box;
-  }
+.requisition {
+  // height: calc(100vh - 84px);
+  // padding: 12px;
+  // box-sizing: border-box;
+}
+.el-card {
+  width: calc(100% - 32px);
+  height: calc(100vh - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
+}
 </style>

+ 258 - 448
src/views/material/requisition/index.vue

@@ -1,180 +1,5 @@
-<template>
-  <div class="requisition" v-loading="failLoad">
-    <div class="applyList" v-if="isList">
-      <el-card
-        :body-style="{
-          height: '100%',
-          padding: 0,
-          display: 'flex',
-          'flex-direction': 'column',
-        }"
-      >
-        <el-super-search
-          v-model="params"
-          :size="size"
-          :dict="dict"
-          :columns="SearchColumns"
-          @reset="reset"
-          @submit="getList"
-        ></el-super-search>
-
-        <el-row
-          :gutter="10"
-          class="mb10"
-          type="flex"
-          justify="end"
-          style="margin-top: 15px"
-        >
-          <el-col :span="1.5">
-            <el-button type="primary" :size="size" plain @click="newAdd"
-              >新增</el-button
-            >
-          </el-col>
-          <el-col :span="1.5">
-            <el-button
-              :size="size"
-              :disabled="checkedList.length != 1"
-              @click="handleCopy"
-              >复制</el-button
-            >
-          </el-col>
-          <el-col :span="1.5">
-            <el-button
-              type="primary"
-              :size="size"
-              plain
-              @click="
-                download(
-                  '/system/apply/material/download',
-                  {},
-                  '申请单模板.xlsx'
-                )
-              "
-              >模板下载
-            </el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button-group>
-              <el-button :size="size" @click="handleImport">批量导入</el-button>
-              <!-- <el-button  
-            :size="size"
-              @click="handleDownload" 
-              v-hasPermi="['system:apply:export']"
-            >批量导出</el-button> -->
-              <el-button :size="size" @click="handleBatchSubmit"
-                >批量提交</el-button
-              >
-            </el-button-group>
-          </el-col>
-          <!-- 导入弹窗 -->
-          <el-dialog
-            title="批量导入"
-            :visible.sync="importData.show"
-            width="35%"
-            center
-            :before-close="handlefileDialogColse"
-          >
-            <div class="mb-import">
-              <el-upload
-                accept=".xls, .xlsx"
-                ref="upload"
-                action="#"
-                :on-remove="handleFileRemove"
-                :file-list="importData.list"
-                :auto-upload="false"
-                :on-change="handleChangeFile"
-                :limit="1"
-                style="text-align: center"
-              >
-                <el-button slot="trigger" size="small" type="primary"
-                  >选取文件</el-button
-                >
-                <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
-              </el-upload>
-            </div>
-            <span slot="footer">
-              <el-button @click="handleImportData('cancal')">取 消</el-button>
-              <el-button type="primary" @click="handleImportData('confirm')"
-                >确 定</el-button
-              >
-            </span>
-          </el-dialog>
-        </el-row>
-
-        <el-super-ux-table
-          v-model="tableList"
-          :dict="dict"
-          :columns="TableColumns"
-          :size="size"
-          pagination
-          index
-          checkbox
-          convenitentOperation
-          :page="pageStatus"
-          storage-key="MaterialRequisitionSuperTable"
-          @pagination="getList"
-          @row-dblclick="check"
-          @selection-change="handleSelectionChange"
-          @select="handleSelect"
-        >
-          <ux-table-column
-            fixed="right"
-            title="操作"
-            align="center"
-            width="180"
-          >
-            <template slot-scope="scope">
-              <el-button type="text" :size="size" @click.stop="check(scope.row)"
-                >查看</el-button
-              >
-              <el-button
-                @click.stop="edit(scope.row)"
-                v-if="scope.row.status == 0 || scope.row.status == 3"
-                type="text"
-                :size="size"
-                >编辑</el-button
-              >
-              <el-button
-                @click.stop="jumpFlow(scope.row)"
-                v-if="scope.row.oaId && scope.row.oaId != ''"
-                type="text"
-                :size="size"
-                >流程跳转</el-button
-              >
-              <el-button
-                type="text"
-                :size="size"
-                @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>
-          </ux-table-column>
-        </el-super-ux-table>
-      </el-card>
-    </div>
-
-    <component
-      :is="isComponent"
-      v-model="isList"
-      :pageStu="page"
-      :disable="disable"
-      :row="rowDetail"
-      @refresh="getList"
-      v-if="!isList"
-    />
-  </div>
-</template>
-
 <script>
-import addReq from "./add.vue";
+import useColumns from "./columns";
 import {
   getReqList,
   delReq,
@@ -186,100 +11,138 @@ import {
 } from "@/api/requisition/basic";
 import { saveAs } from "file-saver";
 import { blobValidate } from "@/utils/ruoyi";
-import { SearchColumns, TableColumns } from "./columns";
-import { initDicts } from "@/utils/init.js";
-
+import { dicts } from "./dicts";
 export default {
   name: "requisition",
-  dicts: [...initDicts([...SearchColumns, ...TableColumns]), "oa_templete_id"],
+  dicts: [...dicts, "oa_templete_id"],
   components: {
-    addReq,
+    DetailsRequsition: () => import("./details/index.vue"),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    BatchImport: () => import("@/components/BatchImport/index.vue"),
   },
   data() {
+    const { SearchColumns, TableColumns } = useColumns();
+    const page = this.$init.page();
     const params = this.$init.params(SearchColumns);
     return {
-      failLoad: false,
-      tableList: [],
+      loading: false,
       size: "mini",
+      page: page,
       params: params,
+      tableData: [],
+      selectData: [],
       SearchColumns: SearchColumns,
       TableColumns: TableColumns,
-      pageStatus: { pageNum: 1, pageSize: 50, total: 0 },
-      queryParams: {
-        billCode: "",
-        name: "",
-        status: "",
-        pageNum: 1,
-        pageSize: 10,
-      },
-      options: [
-        {
-          value: 0,
-          label: "未提交",
-        },
-        {
-          value: 1,
-          label: "审批中",
-        },
-        {
-          value: 2,
-          label: "已完成",
-        },
-        {
-          value: 3,
-          label: "已驳回",
-        },
-      ],
-      total: 0,
-      // isComponent
-      isComponent: "addReq",
-      isList: true,
-      // 页面状态
-      page: "",
-      rowDetail: {},
-      disable: false,
-      checkedList: [],
-      importData: {
-        show: false,
-        list: [],
-      },
+      addType: "add",
     };
   },
   created() {},
   mounted() {
     this.params.billCode = this.$route.query.billCode;
-    this.getList(this.queryParams);
+    this.useQuery(this.params, this.page);
   },
   methods: {
-    // 操作提示弹窗
-    handleConfirmTips(success) {
-      this.$confirm("是否继续此操作?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          success();
-        })
-        .catch(() => {});
+    async useQuery(prop, page) {
+      try {
+        this.loading = true;
+
+        let { code, rows, total } = await getReqList({ ...prop, ...page });
+
+        if (code == 200) {
+          this.tableData = rows;
+          this.page.total = total;
+        }
+      } catch (error) {
+        console.log(error);
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 打开详细
+    openDetails(option, prop) {
+      this.addType = option;
+
+      let { setVisible, fetchItem } = this.$refs.detailsRequsition;
+
+      setVisible(true);
+
+      prop && fetchItem(prop);
+    },
+    //
+    handleDbclick(prop) {
+      this.openDetails("see", prop);
+    },
+
+    handleSelectionChange(selection) {
+      this.selectData = selection;
+    },
+    // 流程跳转
+    async jumpFlow(row) {
+      const { name } = this.$store.state.user;
+
+      try {
+        let { code, msg, oaUrl } = await toOA(name, row.oaId);
+
+        if (code == 200) {
+          window.open(oaUrl);
+        }
+      } catch (error) {
+      } finally {
+      }
+    },
+    //流程收回
+    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.billCode,
+          billMaker: row.createBy,
+        });
+        if (code === 200) {
+          this.$emit("success");
+          this.$notify.success(msg);
+        }
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.getList(this.queryParams);
+      }
+    },
+    // 删行
+    deleteRow(row) {
+      this.handleConfirmTips(async () => {
+        try {
+          let { code } = await delReq(row.id);
+
+          if (res.code === 200) {
+            this.$message.success(res.msg);
+            this.useQuery(this.params, this.page);
+          }
+        } catch (error) {}
+      });
+    },
+    reset() {
+      this.page = this.$init.page();
+      this.params = this.$init.params(SearchColumns);
+      this.useQuery(this.params, this.page);
     },
     // 批量提交
-    async handleBatchSubmit() {
-      let filterList = this.checkedList.filter(
+    batchSubmit() {
+      let filterList = this.selectData.filter(
         (item) => !(item.status === "0" || item.status === "3")
       );
 
-      console.log(filterList, "filterList", this.checkedList.length);
-
-      if (!filterList.length && this.checkedList.length) {
+      if (!filterList.length && this.selectData.length) {
         this.handleConfirmTips(async () => {
           try {
             this.failLoad = true;
 
-            let ids = this.checkedList.map((item) => Number(item.id));
+            let ids = this.selectData.map((item) => Number(item.id));
 
             let { code, msg } = await betchSubmit({ ids });
 
@@ -299,249 +162,196 @@ export default {
         });
       } else {
         this.$notify.warning({
-          title: "警告",
           message: "存在不符合提交条件数据或未选择数据!",
         });
       }
     },
+    // 导入
+    async handelImport(fileList) {
+      let formData = new FormData();
 
-    async jumpFlow(row) {
-      const { name } = this.$store.state.user;
+      formData.append("file", fileList[0].raw);
+
+      let { setVisible } = this.$refs.batchImport;
+
+      setVisible(false);
 
       try {
-        let { code, msg, oaUrl } = await toOA(name, row.oaId);
+        this.loading = true;
+        let { code, msg, data } = await importData(formData);
 
         if (code == 200) {
-          window.open(oaUrl);
+          // 存在导入失败的数据
+          data.flag && (await this.exportfail(data.datas));
+
+          this.$notify({
+            message: data.msg,
+            type: data.flag ? "warning" : "success",
+          });
+        } else {
+          this.$notify({
+            message: msg,
+            type: code == 200 ? "success" : "warning",
+          });
         }
       } catch (error) {
       } finally {
+        this.loading = false;
       }
     },
+    // 导出失败数据
+    async exportfail(prop) {
+      try {
+        this.loading = true;
 
-    reset() {
-      // this.queryParams.billCode = ''
-      // this.queryParams.name = ''
-      // this.queryParams.status = ''
-      // this.queryParams.pageNum = 1
-      this.pageStatus.pageNum = 1;
-      this.pageStatus.pageSize = 10;
-      this.params = this.$init.params(SearchColumns);
-      this.getList(this.queryParams);
-    },
-    newAdd() {
-      this.isList = false;
-      this.isComponent = "addReq";
-      this.page = "add";
-      this.disable = false;
-    },
-    // 复制
-    handleCopy() {
-      this.isList = false;
-      this.isComponent = "addReq";
-      this.page = "copy";
-      this.rowDetail = this.checkedList[0];
-      this.disable = false;
-    },
-    // 导入
-    handleImport() {
-      this.importData.show = true;
-    },
-    // 导出
-    handleDownload() {
-      let params = {
-        ...this.params,
-      };
-      this.download(
-        "/system/apply/material/export",
-        { ...params },
-        `物料申请单${new Date().getTime()}.xlsx`
-      );
-    },
-    // 删除文件
-    handleFileRemove(file, fileList) {
-      // console.log('删除文件', file, 'file', fileList, 'fileList');
-      this.importData.list = fileList;
-    },
-    // 文件发生改变
-    handleChangeFile(file, fileList) {
-      this.importData.list = fileList;
-    },
-    // 导入弹窗操作
-    handleImportData(type) {
-      switch (type) {
-        // 取消
-        case "cancal":
-          this.importData.list = [];
-          this.importData.show = false;
-          break;
-        // 确认
-        case "confirm":
-          if (this.importData.list.length) {
-            let formData = new FormData();
+        let res = await fileImport({ failDatas: prop });
 
-            formData.append("file", this.importData.list[0].raw);
-            importData(formData).then((res) => {
-              if (res.code == 200) {
-                this.importData.show = false;
-                this.importData.list = [];
-                if (res.data.flag) {
-                  this.failLoad = true;
-                  // console.log(res.data.datas)
-                  let param = { failDatas: res.data.datas };
-                  if (null != param) {
-                    fileImport(param).then((res) => {
-                      console.log("res", res);
-                      const isBlob = blobValidate(res);
-                      if (isBlob) {
-                        const blob = new Blob([res]);
-                        saveAs(blob, "导入失败的物料申请单数据.xlsx");
-                      }
-                      this.failLoad = false;
-                      this.reset();
-                    });
-                  }
-                }
-                this.$message({
-                  message: res.data.msg,
-                  type: res.data.flag ? "warning" : "success",
-                });
-              } else {
-                this.$message({
-                  message: res.msg,
-                  type: res.code == 200 ? "success" : "warning",
-                });
-              }
-            });
-          } else {
-            this.$message({
-              message: "请上传文件之后在确认!",
-              type: "warning",
-            });
-          }
-          break;
-      }
-    },
-    handlefileDialogColse(done) {
-      this.importData.list = [];
-      done();
-    },
-    // Select框
-    handleSelect(selection, row) {
-      this.checkedList = selection;
+        const isBlob = blobValidate(res);
 
-      // console.log(this.checkedList, 'this.checkedList');
-    },
-    getList(val) {
-      // console.log('val', val)
-      this.failLoad = true;
+        if (isBlob) {
+          const blob = new Blob([res]);
+
+          await saveAs(blob, "导入失败的物料申请单数据.xlsx");
 
-      getReqList({ ...this.params, ...this.pageStatus }).then((res) => {
-        this.failLoad = false;
-        if (res.code === 200) {
-          this.tableList = res.rows;
-          // this.total = res.total;
-          this.pageStatus.total = res.total;
+          this.reset();
         }
-      });
-      // this.checkedList = [];
-    },
-    // 表格内状态栏判断值
-    statusJug(row) {
-      if (row.status == 0) {
-        return "未提交";
-      } else if (row.status == 1) {
-        return "审批中";
-      } else if (row.status == 2) {
-        return "已完成";
-      } else if (row.status == 3) {
-        return "已驳回";
+      } catch (error) {
+      } finally {
+        this.loading = false;
       }
     },
-    //
-    handleSelectionChange(selection) {
-      this.checkedList = selection;
-    },
-    check(row) {
-      console.log("xxxx", this.dict.type);
-      // console.log('查看详情', row)
-      this.isList = false;
-      this.isComponent = "addReq";
-      this.page = "check";
-      this.rowDetail = row;
-      this.disable = true;
-    },
-    edit(row) {
-      // console.log('修改先加载详情', row)
-      this.isList = false;
-      this.isComponent = "addReq";
-      this.page = "edit";
-      this.rowDetail = row;
-      this.disable = false;
+    // 模板下载,
+    handleTemDownload() {
+      this.download("/system/apply/material/download", {}, "申请单模板.xlsx");
     },
-    commit(row) {
-      // console.log('row', row)
-    },
-    deleteRow(row) {
-      this.$confirm("是否删除此条数据?", "提示", {
+    // 操作提示弹窗
+    handleConfirmTips(success) {
+      this.$confirm("是否继续此操作?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
       })
         .then(() => {
-          delReq(row.id).then((res) => {
-            if (res.code === 200) {
-              this.$message({
-                message: res.msg,
-                type: "success",
-              });
-              this.getList(this.queryParams);
-            }
-          });
+          success();
         })
         .catch(() => {});
     },
-    // handleSizeChange(val) {
-    //   console.log(`每页 ${val} 条`);
-    //   this.queryParams.pageSize = val
-    //   this.getList(this.queryParams)
-    // },
-    // handleCurrentChange(val) {
-    //   console.log(`当前页: ${val}`);
-    //   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.billCode,
-          billMaker: row.createBy,
-        });
-        if (code === 200) {
-          this.$emit("success");
-          this.$notify.success(msg);
-        }
-      } catch (err) {
-        console.error(err);
-      } finally {
-        this.getList(this.queryParams);
-      }
-    },
   },
 };
 </script>
 
+<template>
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
+    }"
+  >
+    <el-super-search
+      v-model="params"
+      :size="size"
+      :dict="dict"
+      :columns="SearchColumns"
+      @reset="reset"
+      @submit="useQuery(params, page)"
+    ></el-super-search>
+
+    <el-row :gutter="24" type="flex" justify="end" style="margin: 16px 0 12px">
+      <el-col :span="24" style="text-align: right">
+        <el-button-group style="margin-left: 10px">
+          <el-button :size="size" type="primary" @click="openDetails('add')"
+            >新增</el-button
+          >
+          <el-button
+            :size="size"
+            :disabled="selectData.length !== 1"
+            @click="openDetails('add', selectData[0])"
+            >复制</el-button
+          >
+        </el-button-group>
+        <el-button-group style="margin: 0 10px">
+          <el-button :size="size" @click="batchSubmit">批量提交</el-button>
+        </el-button-group>
+        <BatchImport
+          ref="batchImport"
+          @import="handelImport"
+          @temDownload="handleTemDownload"
+          :fileSize="2"
+        ></BatchImport>
+      </el-col>
+    </el-row>
+
+    <el-super-ux-table
+      v-model="tableData"
+      :dict="dict"
+      :columns="TableColumns"
+      :size="size"
+      pagination
+      index
+      checkbox
+      convenitentOperation
+      :page="page"
+      storage-key="MaterialRequisitionSuperTable"
+      @pagination="useQuery(params, page)"
+      @row-dblclick="handleDbclick"
+      @selection-change="handleSelectionChange"
+    >
+      <ux-table-column fixed="right" title="操作" align="center" width="180">
+        <template slot-scope="scope">
+          <el-button
+            type="text"
+            :size="size"
+            @click.stop="openDetails('see', scope.row)"
+            >查看</el-button
+          >
+          <el-button
+            @click.stop="openDetails('edit', scope.row)"
+            v-if="scope.row.status == 0 || scope.row.status == 3"
+            type="text"
+            :size="size"
+            >编辑</el-button
+          >
+          <el-button
+            @click.stop="jumpFlow(scope.row)"
+            v-if="scope.row.oaId && scope.row.oaId != ''"
+            type="text"
+            :size="size"
+            >流程跳转</el-button
+          >
+          <el-button
+            type="text"
+            :size="size"
+            @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' && scope.row.oaId && scope.row.oaId != ''
+            "
+            type="text"
+            :size="size"
+            @click.stop="handleBack(scope.row)"
+            >流程收回</el-button
+          >
+        </template>
+      </ux-table-column>
+    </el-super-ux-table>
+
+    <details-requsition
+      ref="detailsRequsition"
+      :addType="addType"
+      :dict="dict"
+      :size="size"
+      @success="useQuery(params, page)"
+    ></details-requsition>
+  </el-card>
+</template>
+
 <style scoped lang="scss">
-.requisition {
-  // height: calc(100vh - 84px);
-  // padding: 12px;
-  // box-sizing: border-box;
-}
 .el-card {
   width: calc(100% - 32px);
   height: calc(100vh - 32px);

+ 0 - 1816
src/views/purchase/PurchaseDemandList/add_bak.vue

@@ -1,1816 +0,0 @@
-<template>
-  <div id="addDemandList">
-  <el-card style="position: relative;">
-    <span>基本信息</span>
-    <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto" :show-message="false">
-      <el-row :gutter="10">
-        <el-col :span="1.5">
-          <el-form-item label="业务类型" prop="billType" :rules="{ required: true, message: '请选择业务类型', trigger: 'blur' }">
-            <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="mini" style="width: 200px">
-              <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-form-item label="需求客户">
-            <el-select clearable size="mini" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
-              <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-form-item label="需求人员">
-              <el-select clearable size="mini" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
-                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
-              </el-select>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-form-item label="需求部门">
-            <el-select clearable v-model="basicForm.demandDept" size="mini" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
-              <el-option
-                v-for="item in deptOptions"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id">
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-form-item label="需求计划" prop="planType" :rules="{ required: true, message: '请选择需求计划', trigger: 'blur' }">
-            <el-select :disabled="sonDisable" v-model="basicForm.planType" size="mini" style="width: 200px" @change="changeplanType()">
-              <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-form-item label="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
-            <el-date-picker
-              v-model="basicForm.demandDate"
-              disabled
-              clearable
-              type="date"
-              value-format="yyyy-MM-dd"
-              @change="changeDemandDate"
-              size="mini"
-              style="width: 200px"
-            >
-            </el-date-picker>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-form-item label="制单日期" prop="createTime">
-            <el-date-picker
-              v-model="basicForm.createTime"
-              disabled
-              clearable
-              type="date"
-              value-format="yyyy-MM-dd"
-              size="mini"
-              style="width: 200px"
-            >
-            </el-date-picker>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-form-item label="是否客户指定">
-            <el-select clearable @change="isCustomer" v-model="basicForm.isCustomerSpecified" :disabled="sonDisable" size="mini" style="width: 200px">
-              <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-form-item label="备注">
-            <el-input
-              v-model.trim="basicForm.remark"
-              size="mini"
-              :disabled="sonDisable"
-              clearable
-              style="width: 200px"
-            />
-          </el-form-item>
-        </el-col>
-
-        <!-- <el-col :span="1.5">
-          <el-form-item label="需求客户名称">
-            <el-input disabled v-model="basicForm.customerName" size="mini" style="width: 200px"></el-input>
-          </el-form-item>
-        </el-col> -->
-
-        <el-col :span="1.5">
-          <el-form-item label="需求单号">
-            <el-input
-              v-model="basicForm.code"
-              size="mini"
-              disabled
-              style="width: 200px"
-            />
-          </el-form-item>
-         </el-col>
-
-        <!-- <el-col :span="1.5">
-            <el-form-item label="组织" prop="org" :rules="{ required: true, message: '请选择组织', trigger: 'blur' }">
-              <el-select clearable size="mini" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
-                <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-         </el-col> -->
-
-         <el-col :span="1.5">
-            <el-form-item label="单据状态">
-              <el-select disabled v-model="basicForm.status" size="mini" style="width: 200px">
-                <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-
-         <el-col :span="1.5">
-            <el-form-item label="客户负责人">
-              <el-select disabled size="mini" v-model="basicForm.customerPrincipal" style="width: 200px">
-                <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
-              </el-select>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="1.5">
-            <el-form-item label="单据来源">
-              <el-select v-model="basicForm.source" disabled size="mini" style="width: 200px">
-                <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-         </el-col>
-      </el-row>
-
-
-    
-      <div class="btn_grooup">
-        <span>明细信息</span>
-        <div>
-        <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
-        <el-button type="primary" size="mini" v-if="!sonDisable" @click.stop="adjustPl">批量调整</el-button>
-        <el-button type="primary" size="mini" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
-        </div>
-      </div>
-
-      <el-table
-          v-loading="loading"
-          :data="basicForm.puDemandItemList"
-          fit
-          border
-          highlight-current-row
-          :cell-style="{ borderColor: '#c0c0c0' }"
-          :header-cell-style="{ borderColor: '#c0c0c0' }"
-          class="exporttable"
-          height="410"
-          max-height="410"
-          style="font-size: 12px;"
-          @selection-change="handleSelectionChange"
-          @row-click="rowSelect"
-          :cell-class-name="cellClassName"
-          :row-key="getRowKeys"
-          ref="table"
-          v-el-table-infinite-scroll="load"
-          :infinite-scroll-disabled="loadDisabled"
-        >
-          <el-table-column show-overflow-tooltip type="selection" :reserve-selection="true" 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" prop="rowNo" fixed="left">
-            <template slot-scope="scope">
-              {{ scope.row.rowNo = scope.$index + 1 + "0" }}
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
-          <el-table-column show-overflow-tooltip label="需求客户" align="center"  prop="demandCustomerName" width="180px"/>
-          <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" :formatter="hangStatus" width="100px"/>
-          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="220px" :render-header="addRedStar" fixed="left">
-            <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :show-message="false" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.materialCode" @paste.native="pasteMe($event, scope, scope.$index)">
-                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
-                </el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="物料名称" align="center"  prop="materialName" width="200px" fixed="left"/>
-          <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" width="230px"/>
-          <el-table-column show-overflow-tooltip label="最小包装" align="center"  prop="minPackage" width="100px"/>
-          <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="150px" :render-header="addRedStar">
-            <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :show-message="false" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)" @paste.native="pasteMe($event, scope, scope.$index)"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="紧急标识" align="center" prop="isUrgency" width="100px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-switch
-                  v-model="scope.row.isUrgency"
-                  :disabled="sonDisable"
-                  active-value="Y"
-                  inactive-value="N"
-                  active-color="#13ce66"
-                  inactive-color="#a1a3a9">
-                </el-switch>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="收货仓库" align="center"  prop="deliveryWarehouseName" width="200px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.$index, '选择收货仓库')">
-                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseCangKu(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库', scope.row.puOrg)"></el-button>
-                </el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="收货货位" align="center"  prop="deliveryAllocationName" width="200px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.$index, '选择收货货位')">
-                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
-                </el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="月均销量" align="center"  prop="averageQtyMonth" width="100px"/>
-          <el-table-column show-overflow-tooltip label="需求可用周期" align="center"  prop="demandPeriod" width="120px"/>
-          <el-table-column show-overflow-tooltip label="业务备注" align="center"  prop="remark" width="150px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.remark"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="物料一级分类" align="center" prop="materialClassifyOneName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="物料二级分类" align="center" prop="materialClassifyTwoName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="物料三级分类" align="center" prop="materialClassifyThreeName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="物料四级分类" align="center" prop="materialClassifyFourName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="最小批量" align="center"  prop="minBatch" width="100px"/>
-          <el-table-column show-overflow-tooltip label="最小订货量" align="center"  prop="minOrderQty" width="120px"/>
-          <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="100px"/>
-          <!-- <el-table-column show-overflow-tooltip label="采购员" align="center"  prop="buyer"/> -->
-          <el-table-column show-overflow-tooltip label="采购周期" align="center"  prop="puPeriod" width="120px"/>
-          <el-table-column show-overflow-tooltip label="交货日期" align="center"  prop="deliveryDate" width="230px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-date-picker
-                  v-model="scope.row.deliveryDate"
-                  :disabled="sonDisable"
-                  clearable
-                  type="date"
-                  size="mini"
-                  value-format="yyyy-MM-dd"
-                  :picker-options="pickerOptionsEnd"
-                  placeholder="选择日期">
-                </el-date-picker>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="有效期" align="center"  prop="expiry" width="100px"/>
-          <el-table-column show-overflow-tooltip label="有效期单位" align="center"  prop="expiryUnit" width="100px"/>
-          <el-table-column show-overflow-tooltip label="安全库存" align="center"  prop="safeStock" width="100px"/>
-          <el-table-column show-overflow-tooltip label="注册人" align="center"  prop="registrant" width="100px"/>
-          <el-table-column show-overflow-tooltip label="预留比例" align="center" prop="reservedProportion" width="120px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-select clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedProportion" @change="getYLSL(scope)" @clear="cleanYLSL(scope)">
-                  <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="预留周期" align="center" prop="reservedPeriod" width="120px">
-            <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'reservedPeriod'" :rules="{ required: scope.row.reservedProportion && scope.row.reservedProportion !== '' , message: '请填写预留周期', trigger: 'blur' }">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedPeriod"></el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="预留数量" align="center"  prop="reservedQty" width="120px"/>
-          <el-table-column show-overflow-tooltip label="集团预测分类" align="center"  prop="forecastClassify" width="120px"/>
-          <el-table-column show-overflow-tooltip label="近一月需求" align="center"  prop="onemonthAvgVolume" width="100px"/>
-          <el-table-column show-overflow-tooltip label="近三月需求" align="center"  prop="threemonthAvgVolume" width="100px"/>
-          <el-table-column show-overflow-tooltip label="采购在途" align="center"  prop="puFreight" width="100px"/>
-          <el-table-column show-overflow-tooltip label="补单标识" align="center"  prop="isReplenishment" width="100px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-switch
-                  v-model="scope.row.isReplenishment"
-                  disabled
-                  active-value="Y"
-                  inactive-value="N"
-                  active-color="#13ce66"
-                  inactive-color="#a1a3a9">
-                </el-switch>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="补单供应商" align="center"  prop="additionalSupplierName" width="200px" :render-header="anotherRedStar">
-            <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'additionalSupplierName'" :rules="{ required: isBDXQ, message: '请选择补单供应商', trigger: 'blur' }">
-                <el-input clearable :disabled="sonDisable || BDZT" size="mini" v-model="scope.row.additionalSupplierName" @clear="clearHang(scope.$index, '选择补单供应商')" @paste.native="pasteMe($event, scope, scope.$index)">
-                  <el-button size="mini" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
-                </el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="lastStockOrgName" width="180px"></el-table-column>
-          <el-table-column show-overflow-tooltip label="末级供应仓库" align="center"  prop="lastWarehouseName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="末级供应货位" align="center"  prop="lastAllocationName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="中心仓可用量" align="center"  prop="centralWarehouseQty" width="120px"/>
-          <el-table-column show-overflow-tooltip label="调拨状态" align="center"  prop="statusAllot" width="100px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-switch
-                  v-model="scope.row.statusAllot"
-                  :disabled="sonDisable"
-                  active-value="Y"
-                  inactive-value="N"
-                  active-color="#13ce66"
-                  inactive-color="#a1a3a9">
-                </el-switch>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="调拨单号" align="center"  prop="allotCode"></el-table-column>
-          <el-table-column show-overflow-tooltip label="调拨占有量" align="center"  prop="allotQty" width="100px"/>
-          <el-table-column show-overflow-tooltip label="最终净需求量" align="center"  prop="resDemandQty" width="120px"/>
-          <el-table-column show-overflow-tooltip label="最终采购执行数量" align="center"  prop="executeQty" width="150px">
-            <template slot-scope="scope">
-              {{ scope.row.executeQty ? scope.row.executeQty : 0 }}
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.$index, '选择收货地址')" @paste.native="pasteMe($event, scope, scope.$index)">
-                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
-                </el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="联系人" align="center"  prop="contacts"/>
-          <el-table-column show-overflow-tooltip label="联系人电话" align="center"  prop="contactsPhone" width="150px"/>
-          <el-table-column show-overflow-tooltip label="详细地址" align="center"  prop="address" width="200px"/>
-          <el-table-column show-overflow-tooltip label="价格类型" align="center"  prop="priceType" width="120px">
-            <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :show-message="false" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
-                <el-select clearable :disabled="sonDisable" size="mini" v-model="scope.row.priceType">
-                  <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip label="是否客户指定" align="center"  prop="isCustomerSpecified" width="120px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-switch
-                  v-model="scope.row.isCustomerSpecified"
-                  disabled
-                  active-value="Y"
-                  inactive-value="N"
-                  active-color="#13ce66"
-                  inactive-color="#a1a3a9">
-                </el-switch>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <!-- <el-table-column show-overflow-tooltip label="批号锁定标识" align="center" prop="isBatchLock" width="100px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                  <el-switch
-                    v-model="scope.row.isBatchLock"
-                    :disabled="sonDisable"
-                    active-value="Y"
-                    inactive-value="N"
-                    active-color="#13ce66"
-                    inactive-color="#a1a3a9">
-                  </el-switch>
-              </el-form-item>
-            </template>
-          </el-table-column> -->
-          <el-table-column show-overflow-tooltip label="采购备注" align="center"  prop="updateCause" width="150px"/>
-          <el-table-column show-overflow-tooltip label="可用量" align="center"  prop="availableQty"/>
-
-          <el-table-column
-            fixed="right"
-            label="操作"
-            align="center"
-            >
-          <template slot-scope="scope">
-            <el-button type="text" size="mini" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-    </el-form>
-      <div class="btn_group">
-        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2') && basicForm.flowId">流程跳转</el-button>
-        <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
-        <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check' && row.status == '0'">编辑</el-button>
-        <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
-        <el-button type="primary" size="mini"  @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
-        <el-button size="mini" plain @click="back">返回</el-button>
-      </div>
-  </el-card>
-
-      <Reserved v-if="dialog.config" :isVisible="dialog.config" :info="row" @updateReserved="updateReserved"/>
-
-      <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
-
-      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
-
-
-    <!-- 批量调整参数 -->
-    <el-dialog title="批量调整" :visible.sync="adjust.open" @close="closeEvent" width="38%">
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">价格类型</el-col>
-        <el-col :span="14">
-        <el-select class="pltzIpt" clearable size="mini" v-model="adjust.priceType">
-          <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
-          </el-option>
-        </el-select>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">采购员</el-col>
-        <el-col :span="14">
-        <el-select class="pltzIpt" clearable size="mini" v-model="adjust.purchaseMan" @focus="chooseOrg('CONTACTS_PARAM', true, '采购员')">
-          <el-option v-for="item in purchaseManOptions" :key="item.id" :label="item.name" :value="item.code" />
-        </el-select>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">收货仓库</el-col>
-        <el-col :span="14">
-        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.warehouseName" @focus="chooseOrg('WAREHOUSE_PARAM', true, '收货仓库')">
-          <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('WAREHOUSE_PARAM', true, '收货仓库')"></el-button>
-        </el-input>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">收货货位</el-col>
-        <el-col :span="14">
-        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.allocationName" @focus="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)">
-          <el-button size="mini" slot="append" icon="el-icon-more" @click="adjustHuoWei('ALLOCATION_PARAM', true, '收货货位', adjust.warehouse)"></el-button>
-        </el-input>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">业务备注</el-col>
-        <el-col :span="14">
-          <el-input class="pltzIpt" clearable size="mini" v-model="adjust.remark"/>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">收货地址</el-col>
-        <el-col :span="14">
-          <el-input class="pltzIpt" clearable size="mini" v-model="adjust.deliveryAddressName">
-            <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('ADDRESS_PARAM', true, '收货地址')"></el-button>
-          </el-input>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">收货地址编码</el-col>
-        <el-col :span="14">
-          <el-input class="pltzIpt" disabled clearable size="mini" v-model="adjust.deliveryAddress"/>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">联系人</el-col>
-        <el-col :span="14">
-          <el-input class="pltzIpt" disabled clearable size="mini" v-model="adjust.contacts"/>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">联系人电话</el-col>
-        <el-col :span="14">
-          <el-input class="pltzIpt" disabled clearable size="mini" v-model="adjust.contactsPhone"/>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 10px;">
-        <el-col :span="6" class="pltzTxt">详细地址</el-col>
-        <el-col :span="14">
-          <el-input class="pltzIpt" disabled clearable size="mini" v-model="adjust.address"/>
-        </el-col>
-      </el-row>
-      <div slot="footer">
-      <el-button size="mini" type="primary" @click="confirmAdjust">确 认</el-button>
-      <el-button size="mini" @click="adjust.open = false">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import Reserved from './reserved.vue'
-import Refers from '@/components/Refers/refers.vue'
-import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan, toOA } from '@/api/purchase/purchaseDemand.js'
-// 用于回显参照框数据
-import {getRefer} from '@/api/purchase/basic.js'
-// 明细行选择物料参照
-import popDialog from '@/components/PopDialog/index.vue'
-import ElTableInfiniteScroll from "el-table-infinite-scroll";
-export default {
-  directives: {
-    "el-table-infinite-scroll": ElTableInfiniteScroll,
-  },
-  name: 'addDemandList',
-  props: ['pageStu','row', 'disable'],
-  dicts: ['sys_processing_mode', 'sys_plan_type', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
-  components: {
-    Reserved,
-    Refers,
-    popDialog
-  },
-  model: {
-    prop: 'isList',
-    event: 'jugislist'
-  },
-  data() {
-    return {
-      loading: true,
-      // 不能直接改变props传来的值
-      sonPageStu: this.pageStu,
-      sonDisable: this.disable,
-      // BDZT是补单供应商是否可以编辑条件
-      BDZT: true,
-      dialog: {
-        config: false
-      },
-      basicForm: {
-        code: '',
-        org: '',
-        orgName: '',
-        demandBusinessType: '1',
-        status: '0',
-        customer: '',
-        customerName: '',
-        customerCode: '',
-        customerPrincipal: '',
-        demandPersonal: '',
-        demandPersonalName: '',
-        demandDept: '',
-        demandDeptName: '',
-        planType: 'ZJH',
-        demandDate: '',
-        source: '4',
-        billType: 'ZQBH',
-        isCustomerSpecified: 'N',
-        isProcess: '',
-        isMonthleyCalculate: '',
-        createTime: this.parseTime(new Date().getTime()),
-        remark: '',
-        puDemandItemList: []
-      },
-      delDemandItemList: [],
-      options: [{
-        value: 'Y', label: '是',
-      }, {
-        value: 'N', label: '否'
-      }],
-      basicRules: {},
-      tableList: [],
-      referCondition: {
-        type: '',
-        isPage: true,
-        title: '',
-      },
-      // referCondition: {
-      //   type: '',
-      //   isPage: true,
-      //   title: '',
-      // },
-      tableIndex: null,
-      ids: [],
-      orgOptions: [],
-      manOptions: [],
-      personOptions: [],
-      deptOptions: [],
-      customerOptions: [],
-      pickerOptionsEnd: {
-        disabledDate: (time) => {
-          return time.getTime() < new Date(this.basicForm.demandDate).getTime() - 8.64e7
-        }
-      },
-      isBDXQ: false,
-      isYl: false,
-      // 批量调整参数
-      adjust: {
-        open: false,
-        priceType: '',
-        purchaseMan: '',
-        purchaseManName: '',
-        warehouse: '',
-        warehouseName: '',
-        allocation: '',
-        allocationName: '',
-        remark:'',
-        deliveryAddress: '',
-        deliveryAddressName: '',
-        contacts: '',
-        contactsPhone: '',
-        address: ''
-      },
-      purchaseManOptions: [],
-      sonModel: {
-        rowNo: null,
-        contacts: null,
-        id: null,
-        demandId: null,
-        status: null,
-        materialCategory: null,
-        buyer: null,
-        buyerName: null,
-        mateiralClassifyOne: null,
-        materialClassifyOneName: null,
-        materialClassifyTwo: null,
-        materialClassifyTwoName: null,
-        materialClassifyThree: null,
-        materialClassifyThreeName: null,
-        materialClassifyFour: null,
-        materialClassifyFourName: null,
-        materialCode: null,
-        material: null,
-        materialName: null,
-        classifyId: null,
-        specification: null,
-        unit: null,
-        unitName: null,
-        manufacturerName: null,
-        registrant: null,
-        puPeriod: null,
-        expiryUnit: null,
-        expiry: null,
-        minPackage: null,
-        minOrderQty: null,
-        minBatch: null,
-        safeStock: null,
-        averageQtyMonth: null,
-        qty: null,
-        adjustmentPersonal: null,
-        adjustmentTime: null,
-        manualRegulation: null,
-        updateCause: null,
-        reservedProportion: null,
-        reservedPeriod: null,
-        reservedQty: null,
-        demandPeriod: null,
-        forecastClassify: null,
-        onemonthAvgVolume: null,
-        threemonthAvgVolume: null,
-        puFreight: null,
-        deliveryDate: null,
-        isUrgency: 'N',
-        isReplenishment: 'N',
-        isBatchLock: 'N',
-        isCustomerSpecified: '',
-        remark: null,
-        puRemark: null,
-        lastWarehouseQty: null,
-        resDemandQty: null,
-        lastWarehouse: null,
-        lastWarehouseName: null,
-        deliveryWarehouse: null,
-        deliveryWarehouseName: null,
-        lastAllocation: null,
-        lastAllocationName: null,
-        deliveryAllocation: null,
-        deliveryAllocationName: null,
-        passageOn: null,
-        puOrg: null,
-        purOrgName: null,
-        lastStockQty: null,
-        superiorCenterQty: null,
-        superiorAllotQty: null,
-        availableQty: null,
-        statusAllot: 'N',
-        additionalSupplier: null,
-        additionalSupplierName: null,
-        periodUnit: null,
-        demandCustomer: null,
-        demandCustomerName: null,
-        lastStockOrg: null,
-        lastStockOrgName: null,
-        superiorStockOrg: null,
-        superiorStockOrgName: null,
-        allotCode: null,
-        deliveryAddress: null,
-        deliveryAddressName: null,
-        contacts: null,
-        contactsPhone: null,
-        address: null,
-        source: null,
-        priceType: 'order',
-        puManagerApprover: null,
-        puManagerApproverName: null,
-        processTime: null,
-        affirmer: null,
-        tenantId: null,
-        revision: null,
-        createBy: null,
-        createByName: null,
-        createTime: null,
-        updateBy: null,
-        updateByName: null,
-        updateTime: null,
-        delFlag: 0,
-        // 新增字段
-        model: null,
-        storageCondition: null,
-        transportationCondition: null,
-      },
-      // 无限滚动配置
-      loadDisabled: true,
-      page: 0,
-      total: 5,
-    }
-  },
-  created() {
-    if(this.pageStu == 'check') {
-      console.log('数据', this.row)
-      this.getDetails(this.row)
-    } else if(this.pageStu == 'edit') {
-      this.getDetails(this.row)
-    } else if (this.pageStu == 'add') {
-      // 新增时判断需求日期
-      this.dafaultDate()
-      this.loading = false
-      this.basicForm.demandPersonal = this.$store.state.user.name
-      this.basicForm.demandPersonalName = this.$store.state.user.nickName
-      this.basicForm.demandDept = this.$store.state.user.deptId
-      this.basicForm.demandDeptName = this.$store.state.user.deptName
-      if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
-      if (this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
-    }
-  },
-  methods: {
-    // 默认需求日期根据当天星期几判断
-    dafaultDate() {
-      // 获取当前时间
-      let date = new Date()
-      //获取当前时间的年份转为字符串
-      let year = date.getFullYear().toString()  
-      //获取月份,由于月份从0开始,此处要加1,判断是否小于10,如果是在字符串前面拼接'0'
-      let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : (date.getMonth() + 1).toString()  //'04'
-      //获取天,判断是否小于10,如果是在字符串前面拼接'0'
-      let da = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate().toString()  //'12'
-      let today = year + '-' + month + '-' + da
-      console.log('今天日期',today)
-      let weekDay = date.getDay()
-      console.log('今天星期几', weekDay)
-      // 改变需求计划的判断写这里面了
-      if (this.basicForm.planType == 'JJXQ') {
-        this.basicForm.demandDate = today
-      } else {
-        if (weekDay == 0) {this.basicForm.demandDate = this.getNextDate(today, 2)} 
-        else if (weekDay == 1) {this.basicForm.demandDate = this.getNextDate(today, 1)}
-        else if (weekDay == 2) {this.basicForm.demandDate = today}
-        else if (weekDay == 3) {this.basicForm.demandDate = this.getNextDate(today, 6)}
-        else if (weekDay == 4) {this.basicForm.demandDate = this.getNextDate(today, 5)}
-        else if (weekDay == 5) {this.basicForm.demandDate = this.getNextDate(today, 4)}
-        else if (weekDay == 6) {this.basicForm.demandDate = this.getNextDate(today, 3)}
-        // console.log(this.getNextDate(today, 2))
-      }
-    },
-    // 获取某天日期的下一天,默认为第二天 默认输出格式为yyyy-mm-dd
-    getNextDate(date, day = 1, format = '{y}-{m}-{d}') {
-      if (date) {
-        date = date.match(/\d+/g).join('-'); // 格式为2022年09月19日处理
-        const nDate = new Date(date);
-        nDate.setDate(nDate.getDate() + day);
- 
-        const formatObj = {
-          y: nDate.getFullYear(),
-          m: nDate.getMonth() + 1,
-          d: nDate.getDate(),
-        };
-        return format.replace(/{([ymd])+}/g, (result, key) => {
-          const value = formatObj[key];
-          return value.toString().padStart(2, '0');
-        });
-      } else {
-        console.log('date格式不正确');
-      }
-    },
-    // 改变需求计划改变需求日期
-    changeplanType() {
-      this.dafaultDate()
-    },
-    // 无限滚动加载配置
-    load() {
-      if (this.loadDisabled) return;
-      this.page++;
-      if (this.page <= this.total) {
-        this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.concat(this.basicForm.puDemandItemList);
-      }
-      if (this.page === this.total) {
-        this.loadDisabled = true;
-      }  
-    },
-    // 改变单据日期时清空子表的调拨日期
-    changeDemandDate() {
-      this.basicForm.puDemandItemList.forEach(item => {
-        item.deliveryDate = null
-      })
-    },
-    // 更改业务类型调整明细行内补单或紧急标识
-    changeBillType() {
-      if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
-        this.isBDXQ = true
-        this.BDZT = false
-        this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
-      } else {
-        this.isBDXQ = false
-        this.BDZT = true
-        this.basicForm.puDemandItemList.forEach(item => {
-          item.isReplenishment = 'N'
-          item.additionalSupplier = null
-          item.additionalSupplierName = null
-        })
-      }
-      if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
-        this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
-      } else {
-        this.basicForm.puDemandItemList.forEach(item => { item.isUrgency = 'N' })
-      }
-    },
-    // 改变是否客户指定
-    isCustomer() {
-      if (this.basicForm.isCustomerSpecified == 'Y' && this.basicForm.puDemandItemList.length != 0) {
-        this.basicForm.puDemandItemList.forEach(item => {item.isCustomerSpecified = 'Y'})
-      } else {
-        this.basicForm.puDemandItemList.forEach(item => {item.isCustomerSpecified = 'N'})
-      }
-    },
-    hangStatus(row) {
-      switch (row.status) {
-        case '0':
-          return '需补货'
-        case '1':
-          return '待计划确认'
-        case '2':
-          return '计划已确认'
-        case '3':
-          return '计划已审核'
-        case '4':
-          return '行关闭'
-        case '5':
-          return '总供应可满足'
-      }
-    },
-    // 获取预留数量
-    getYLSL(scope) {
-      if (scope.row.reservedProportion) {
-        scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
-      }
-      // 如果选择预留比例,预留周期必填
-      // if(scope.row.reservedQty && scope.row.reservedQty !== 0) {
-      //   this.isYl = true
-      // } else {
-      //   this.isYl = false
-      // }
-    },
-    // 清空
-    cleanYLSL(scope) {
-      scope.row.reservedQty = ''
-      scope.row.reservedPeriod = ''
-    },
-    copy() {
-      this.$modal.notifySuccess("复制成功");
-      this.sonPageStu = 'add'
-      this.sonDisable = false
-      // this.getDetails(this.row)
-      this.basicForm.id = ''
-      this.basicForm.code = ''
-      this.basicForm.createBy = ''
-      this.basicForm.source = '4'
-      this.basicForm.isCustomerSpecified = 'N'
-      this.basicForm.demandPersonal = this.$store.state.user.name
-      this.basicForm.demandPersonalName = this.$store.state.user.nickName
-      this.basicForm.demandDept = this.$store.state.user.deptId
-      this.basicForm.demandDeptName = this.$store.state.user.deptName
-      // 复制时判断需求日期
-      this.dafaultDate()
-      if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
-      if (this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
-      this.basicForm.puDemandItemList.forEach(item => {
-        item.status = ''
-        item.buyerName = ''
-        item.buyer = ''
-        item.reservedProportion = ''
-        item.reservedPeriod = ''
-        item.reservedQty = ''
-        item.averageQtyMonth = ''
-        item.demandPeriod = ''
-        item.forecastClassify = ''
-        item.onemonthAvgVolume = ''
-        item.threemonthAvgVolume = ''
-        item.puFreight = ''
-        item.superiorAllotQty = ''
-        item.resDemandQty = ''
-        item.executeQty = ''
-        item.deliveryWarehouseName = ''
-        item.deliveryWarehouse = ''
-        item.deliveryAllocationName = ''
-        item.deliveryAllocation = ''
-        item.lastWarehouseName = ''
-        item.lastAllocationName = ''
-        item.availableQty = ''
-        item.lastStockOrgName = ''
-        item.centralWarehouseQty = ''
-        item.allotCode = ''
-        item.allotQty = ''
-        item.deliveryAddress = ''
-        item.deliveryAddressName = ''
-        item.contacts = ''
-        item.contactsPhone = ''
-        item.address = ''
-        item.statusAllot = 'N'
-      })
-    },
-    editPage() {
-      this.sonPageStu = 'edit'
-      this.sonDisable = false
-    },
-    handleData() {
-      console.log('222')
-      // 复制新增把id,需求单号,创建人置为空,子表去掉id
-      this.basicForm.id = ''
-      this.basicForm.code = ''
-      this.basicForm.createBy = ''
-      this.basicForm.source = '4'
-      if (this.basicForm.puDemandItemList.length !== 0) {
-        this.basicForm.puDemandItemList.forEach(item => {
-          if (item.id) {
-            delete item.id
-          }
-          if (item.demandId) {
-            delete item.demandId
-          }
-          if (item.allotCode) {
-            delete item.allotCode
-          }
-        })
-      }
-    },
-    async save() {
-      if(this.basicForm.puDemandItemList.length !== 0) {
-        this.$refs['basic'].validate((valid, obj) => {
-          if(valid) {
-            this.$modal.loading("保存中...");
-            if(this.sonPageStu == 'add') {
-              this.handleData()
-              addDemand(this.basicForm).then(res => {
-                console.log(333)
-                if (res.code === 200) {
-                  this.$modal.notifySuccess(res.msg);
-                  this.$modal.closeLoading();
-                  this.back()
-                }
-              }).catch(err => {
-                this.$modal.closeLoading();
-              })
-            } else if (this.sonPageStu == 'edit') {
-              let list = []
-              list.push(...this.basicForm.puDemandItemList, ...this.delDemandItemList)
-              // 深拷贝一下参数对象
-              let param = JSON.parse(JSON.stringify(this.basicForm))
-              console.log('深拷贝对象',param);
-              param.puDemandItemList = list
-              // this.basicForm.puDemandItemList.push(...this.delDemandItemList)
-              editDemand(param).then(res => {
-                if (res.code === 200) {
-                  this.$modal.notifySuccess(res.msg);
-                  this.$modal.closeLoading();
-                  this.back()
-                }
-              }).catch(err => {
-                this.$modal.closeLoading();
-              })
-            }
-          } else {
-            // 校验加弹窗
-            const jiaoyan = []
-            for(let key in obj) {
-              jiaoyan.push(obj[key][0].message);
-            }
-            this.$modal.notifyWarning(jiaoyan[0]);
-            return false
-          }
-        })
-      } else {
-        this.$modal.notifyWarning("明细信息不能为空!");
-      }
-    },
-    submit() {
-      this.$modal.loading("提交中...");
-      submitDemand(this.basicForm).then(res => {
-        if (res.code === 200) {
-          this.$modal.notifySuccess("提交成功");
-          this.$modal.closeLoading();
-          this.back()
-        }
-      }).catch(err => {
-        this.$modal.closeLoading();
-      })
-    },
-    // 增行
-    addLine() {
-      const newLine = {...this.sonModel}
-      newLine.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
-      newLine.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
-      newLine.demandCustomer = this.basicForm.customer
-      newLine.demandCustomerName = this.basicForm.customerName
-      this.basicForm.puDemandItemList.push(newLine)
-      // 补单需求状态改变
-      if (this.basicForm.billType == 'BDXQ') {
-        this.BDZT = false
-      } else {
-        this.BDZT = true
-      }
-    },
-    delLine(index, row) {
-      console.log('删除行:', index)
-      console.log('改变行:', row)
-      row.delFlag = '2'
-      let delList = []
-      delList = this.basicForm.puDemandItemList.filter(item => {
-        return item.delFlag == '2'
-      })
-      this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
-        return item.delFlag == '0'
-      })
-      this.delDemandItemList.push(...delList)
-      console.log('删除的数组',this.delDemandItemList)
-    },
-    back() {
-      console.log('打印人员信息看看', this.$store.state)
-      this.$emit('jugislist', true)
-      this.$emit('refresh')
-    },
-    // 如果需要回显则调用详情接口
-    getDetails(row) {
-      getDemandDetail(row.id).then(res => {
-        if (res.code === 200) {
-          // this.basicForm = res.data
-          let reciveForm = res.data
-          let params = {...{id: row.id}, ...{pageNum:1, pageSize: 10}}
-          getDemandSonDetail(params).then(res => {
-            if (res.code === 200) {
-              reciveForm.puDemandItemList = res.data
-              console.log('reciveForm',reciveForm)
-              this.basicForm = reciveForm
-              if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
-              if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
-              if(this.basicForm.customerPrincipal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.customerPrincipal, '客户负责人') }
-              if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
-              if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
-              // 详情时将收货仓库id赋值给stordocId
-              // 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
-              if(this.basicForm.billType == 'BDXQ') {
-                 this.BDZT = false
-                 this.isBDXQ = true
-              } else {
-                 this.BDZT = true
-                 this.isBDXQ = false
-              }
-            }
-          }).then(() => {
-            this.loading = false
-          }).catch(err => {
-            this.loading = false
-          })
-        }
-      })
-    },
-    // 单元格标红
-    cellClassName({row, column, rowIndex, columnIndex}) {
-      if(this.basicForm.isCustomerSpecified == 'N' && column.label == '需求可用周期' && Number(row.demandPeriod) > 1.5 && Number(row.qty) > Number(row.minOrderQty)) {
-        return 'success-row';
-      }
-    },
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item =>{
-        return item.id
-      })
-      console.log('选中数组', this.ids)
-    },
-    rowSelect(row) {
-      this.$refs.table.toggleRowSelection(row);
-    },
-    // 点击预留单展示
-    showReserved() {
-      this.dialog.config = true
-    },
-    // 修改是否让页面显示与隐藏的事件
-	  updateReserved (val) {
-      this.dialog.config = val
-    },
-    // 回显参照框
-    reBackRefer(type, id, title) {
-      getRefer({type: type, id: id}).then(res => {
-        if(type == 'ORG_PARAM') {
-          this.orgOptions = res.rows
-        }
-        if (type == 'CUSTOMER_PARAM') {
-          this.customerOptions = res.rows
-        }
-        if (type == 'CONTACTS_PARAM' && title == '需求人员') {
-          this.personOptions = res.rows
-        }
-        if (type == 'CONTACTS_PARAM' && title == '客户负责人') {
-          this.manOptions = res.rows
-        }
-        if (type == 'DEPT_PARAM') {
-          this.deptOptions = res.rows
-        }
-      })
-    },
-    chooseOrg(type, isPage, title) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.$refs.refer.init(this.referCondition)
-    },
-    selectionsToInput(selection) {
-      if(this.referCondition.type == 'ORG_PARAM' && this.referCondition.title == '选择组织') {
-        this.orgOptions = selection
-        this.basicForm.org = selection[0].id
-        this.basicForm.orgName = selection[0].name
-      }
-      if(this.referCondition.type == 'CUSTOMER_PARAM' && this.referCondition.title == '选择客户') {
-        this.customerOptions = selection
-        this.basicForm.customer = selection[0].id
-        this.basicForm.customerName = selection[0].name
-        this.basicForm.customerCode = selection[0].code
-        if(this.basicForm.puDemandItemList.length !== 0) {
-          this.basicForm.puDemandItemList.forEach(item => {
-            item.demandCustomerName = this.basicForm.customerName
-            item.demandCustomer = this.basicForm.customer
-            item.status = ''
-            item.buyerName = ''
-            item.buyer = ''
-            item.reservedProportion = ''
-            item.reservedPeriod = ''
-            item.reservedQty = ''
-            item.averageQtyMonth = ''
-            item.demandPeriod = ''
-            item.forecastClassify = ''
-            item.onemonthAvgVolume = ''
-            item.threemonthAvgVolume = ''
-            item.puFreight = ''
-            item.superiorAllotQty = ''
-            item.resDemandQty = ''
-            item.executeQty = ''
-            item.deliveryWarehouseName = ''
-            item.deliveryWarehouse = ''
-            item.deliveryAllocationName = ''
-            item.deliveryAllocation = ''
-            item.lastWarehouseName = ''
-            item.lastAllocationName = ''
-            item.availableQty = ''
-            item.lastStockOrgName = ''
-            item.centralWarehouseQty = ''
-            item.allotCode = ''
-            item.deliveryAddress = ''
-            item.deliveryAddressName = ''
-            item.contacts = ''
-            item.contactsPhone = ''
-            item.address = ''
-          })
-        }
-      }
-      if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '需求人员') {
-        this.personOptions = selection
-        this.basicForm.demandPersonal = selection[0].code
-        this.basicForm.demandPersonalName = selection[0].name
-      }
-      if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '采购员') {
-        this.purchaseManOptions = selection
-        this.adjust.purchaseMan = selection[0].code
-        this.adjust.purchaseManName = selection[0].name
-      }
-      if(this.referCondition.type == 'WAREHOUSE_PARAM' && this.referCondition.title == '收货仓库') {
-        this.adjust.warehouse = selection[0].id
-        this.adjust.warehouseName = selection[0].name
-        this.adjust.allocation = ''
-        this.adjust.allocationName = ''
-      }
-      if(this.referCondition.type == 'ALLOCATION_PARAM' && this.referCondition.title == '收货货位') {
-        this.adjust.allocation = selection[0].id
-        this.adjust.allocationName = selection[0].name
-      }
-      if(this.referCondition.type == 'ADDRESS_PARAM' && this.referCondition.title == '收货地址') {
-        this.adjust.deliveryAddressName = selection[0].name
-        this.adjust.deliveryAddress = selection[0].code
-        this.adjust.contacts = selection[0].contactsName
-        this.adjust.contactsPhone = selection[0].contactsPhone
-        this.adjust.address = selection[0].address
-      }
-      if(this.referCondition.type == 'DEPT_PARAM') {
-        this.deptOptions = selection
-        this.basicForm.demandDept = selection[0].id
-        this.basicForm.demandDeptName = selection[0].name
-      }
-      if(this.referCondition.title == '选择收货仓库') {
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = selection[0].id
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = selection[0].name
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
-      }
-      if(this.referCondition.title == '选择收货货位') {
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = selection[0].id
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
-      }
-      if(this.referCondition.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
-      }
-      if(this.referCondition.title == '选择收货地址') {
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = selection[0].code
-        this.basicForm.puDemandItemList[this.tableIndex].contacts = selection[0].contactsName
-        this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = selection[0].contactsPhone
-        this.basicForm.puDemandItemList[this.tableIndex].address = selection[0].address
-      }
-    },
-    // 粘贴来的数据
-    async pasteMe(e, scope, index) {
-      this.$modal.loading("正在处理数据...");
-      e.preventDefault() //阻止默认粘贴事件
-      let source = e.clipboardData.getData("Text");
-      console.log('scope', scope.column.property)
-      // 首先对源头进行解析
-      let rows = source.split("\r\n"); // 拆成一个数组
-      // 数组去除空字符串
-      rows = rows.filter(item => {
-        return item && item.trim()
-      })
-
-      if (rows.length < 100) {
-        // 粘贴物料编码
-        if(scope.column.property == 'materialCode') {
-          await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
-            this.$modal.closeLoading();
-            if (res.code === 200) {
-              let rowList = res.rows
-              let newLine = []
-              for (let i = 0; i<rowList.length; i++) {
-                let line = {...this.sonModel}
-                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
-                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
-                line.demandCustomer = this.basicForm.customer
-                line.demandCustomerName = this.basicForm.customerName
-                line.materialCode = rowList[i].code
-                line.material = rowList[i].id
-                line.materialName = rowList[i].name
-                line.classifyId = rowList[i].classifyId
-                line.materialClassifyOneName = rowList[i].oneClass
-                line.materialClassifyTwoName = rowList[i].twoClass
-                line.materialClassifyThreeName = rowList[i].threeClass
-                line.materialClassifyFourName = rowList[i].fourClass
-                line.specification = rowList[i].specification
-                line.model = rowList[i].model
-                line.unit = rowList[i].unitId
-                line.unitName = rowList[i].unitIdName
-                line.registrant = rowList[i].registrant
-                line.manufacturerName = rowList[i].manufacturerIdName
-                line.puPeriod = rowList[i].deliveryPeriod
-                line.expiry = rowList[i].usefulLife
-                line.expiryUnit = rowList[i].expiryUnitIdName
-                // line.minPackage = rowList[i].usefulLife
-                line.minPackage = rowList[i].minPackQty
-                line.minOrderQty = rowList[i].minOrderQty
-                line.minBatch = rowList[i].minBatchQty
-                line.safeStock = rowList[i].safeStock
-                line.purOrgName = rowList[i].purchasingOrganizationName
-                line.puOrg = rowList[i].purchasingOrganization
-                // 物料存储条件和运输条件
-                line.transportationCondition = rowList[i].transportationCondition
-                line.storageCondition = rowList[i].storageCondition
-                newLine.push(line)
-                console.log('临时数组', newLine)
-              }
-              // 删除指定下标
-              this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
-            }
-          }).then(() => {
-            this.$refs.table.doLayout()
-          }).catch(err => {
-            this.$modal.closeLoading();
-          })
-        // 粘贴实际业务需求量
-        }else if(scope.column.property == 'qty') {
-          console.log('复制内容:', rows)
-          let newLine = []
-          if(this.basicForm.puDemandItemList.length <= 1) {
-            for (let i = 0; i<rows.length; i++) {
-              let line = {...this.sonModel}
-              line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
-              line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
-              line.demandCustomer = this.basicForm.customer
-              line.demandCustomerName = this.basicForm.customerName
-              line.qty = rows[i]
-              newLine.push(line)
-            }
-            // 删除指定下标
-            this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
-            this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-            this.$refs.table.doLayout()
-            this.$modal.closeLoading();
-          } else {
-            for(let i = index , j = 0; i < this.basicForm.puDemandItemList.length; i++, j++) {
-              this.basicForm.puDemandItemList[i].qty = rows[j]
-            }
-            this.$refs.table.doLayout()
-            this.$modal.closeLoading();
-          }
-        // 粘贴补单供应商
-        }else if(scope.column.property == 'additionalSupplierName') {
-          await getRefer({ type: 'SUPPLIER_PARAM', searchList: rows }).then(res => {
-            this.$modal.closeLoading();
-            if (res.code === 200) {
-              let rowList = res.rows
-              let newLine = []
-              for (let i = 0; i<rowList.length; i++) {
-                let line = {...this.sonModel}
-                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
-                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
-                line.demandCustomer = this.basicForm.customer
-                line.demandCustomerName = this.basicForm.customerName
-                line.additionalSupplier = rowList[i].id
-                line.additionalSupplierName = rowList[i].name
-                newLine.push(line)
-                console.log('临时数组', newLine)
-              }
-              if(this.basicForm.puDemandItemList.length <= 1) {
-                // 删除指定下标
-                this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
-                this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
-              } else {
-                for(let i = index , j = 0; i < this.basicForm.puDemandItemList.length; i++, j++) {
-                  this.basicForm.puDemandItemList[i].additionalSupplier = newLine[j].additionalSupplier
-                  this.basicForm.puDemandItemList[i].additionalSupplierName = newLine[j].additionalSupplierName
-                }
-                this.$refs.table.doLayout()
-                this.$modal.closeLoading();
-              }
-            }
-          }).then(() => {
-            this.$refs.table.doLayout()
-          }).catch(err => {
-            this.$modal.closeLoading();
-          })
-        }else if(scope.column.property == 'deliveryAddressName') {
-          await getRefer({ type: 'ADDRESS_PARAM', searchList: rows }).then(res => {
-           this.$modal.closeLoading();
-            if (res.code === 200) {
-              let rowList = res.rows
-              let newLine = []
-              for (let i = 0; i<rowList.length; i++) {
-                let line = {...this.sonModel}
-                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
-                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
-                line.demandCustomer = this.basicForm.customer
-                line.demandCustomerName = this.basicForm.customerName
-                line.deliveryAddressName = rowList[i].name
-                line.deliveryAddress = rowList[i].code
-                line.contacts = rowList[i].contactsName
-                line.contactsPhone = rowList[i].contactsPhone
-                line.address = rowList[i].address
-                newLine.push(line)
-                console.log('临时数组', newLine)
-              }
-              if(this.basicForm.puDemandItemList.length <= 1) {
-                // 删除指定下标
-                this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
-                this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
-              } else {
-                for(let i = index , j = 0; i < this.basicForm.puDemandItemList.length; i++, j++) {
-                  this.basicForm.puDemandItemList[i].deliveryAddressName = newLine[j].deliveryAddressName
-                  this.basicForm.puDemandItemList[i].deliveryAddress = newLine[j].deliveryAddress
-                  this.basicForm.puDemandItemList[i].contacts = newLine[j].contacts
-                  this.basicForm.puDemandItemList[i].contactsPhone = newLine[j].contactsPhone
-                  this.basicForm.puDemandItemList[i].address = newLine[j].address
-                }
-                this.$refs.table.doLayout()
-                this.$modal.closeLoading();
-              }
-            }
-          }).then(() => {
-            this.$refs.table.doLayout()
-          }).catch(err => {
-            this.$modal.closeLoading();
-          })
-        }
-
-      } else {
-        this.$modal.notifyWarning("复制长度不能超过100!");
-        this.$modal.closeLoading();
-      }
-    },
-    // 明细行选择物料编码带出数据
-    chooseMaterial(index) {
-      console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
-      this.tableIndex = index
-      // 传0只展示同步NC了的物料
-      this.$refs.materialRefer.init(0)
-    },
-    selectMaterial(selection) {
-      console.log('选中的物料', selection)
-      if (selection.length <= 1) {
-      // 选择新物料时先清空行内其他信息
-      this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
-      this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
-      this.basicForm.puDemandItemList[this.tableIndex].reservedQty = null
-      this.basicForm.puDemandItemList[this.tableIndex].qty = null
-      this.basicForm.puDemandItemList[this.tableIndex].deliveryDate = null
-      this.basicForm.puDemandItemList[this.tableIndex].remark = null
-      this.basicForm.puDemandItemList[this.tableIndex].resDemandQty = null
-      this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = null
-      this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = null
-      this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
-      this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
-      this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = null
-      this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = null
-      this.basicForm.puDemandItemList[this.tableIndex].periodUnit = null
-      this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = null
-      this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = null
-      this.basicForm.puDemandItemList[this.tableIndex].contacts = null
-      this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = null
-      this.basicForm.puDemandItemList[this.tableIndex].address = null
-      this.basicForm.puDemandItemList[this.tableIndex].priceType = 'order'
-      this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = null
-      this.basicForm.puDemandItemList[this.tableIndex].lastWarehouse = null
-      this.basicForm.puDemandItemList[this.tableIndex].lastAllocation = null
-      this.basicForm.puDemandItemList[this.tableIndex].lastAllocationName = null
-      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOne = null
-      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwo = null
-      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThree = null
-      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFour = null
-      this.basicForm.puDemandItemList[this.tableIndex].lastStockOrg = null
-      this.basicForm.puDemandItemList[this.tableIndex].lastStockOrgName = null
-      this.basicForm.puDemandItemList[this.tableIndex].buyer = null
-      this.basicForm.puDemandItemList[this.tableIndex].buyerName = null
-      // 通过选择物料查询采购员
-      queryMan(selection[0].id).then(res => {
-        if(res.code === 200 && res.rows.length !== 0) {
-          this.basicForm.puDemandItemList[this.tableIndex].buyer = res.rows[0].buyer
-          this.basicForm.puDemandItemList[this.tableIndex].buyerName = res.rows[0].buyerName
-        }
-      })
-      this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
-      this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
-      this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
-      this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
-      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
-      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
-      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass
-      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFourName = selection[0].fourClass
-      this.basicForm.puDemandItemList[this.tableIndex].specification = selection[0].specification
-      this.basicForm.puDemandItemList[this.tableIndex].model = selection[0].model
-      this.basicForm.puDemandItemList[this.tableIndex].unit = selection[0].unitId
-      this.basicForm.puDemandItemList[this.tableIndex].unitName = selection[0].unitIdName
-      this.basicForm.puDemandItemList[this.tableIndex].registrant = selection[0].registrant
-      this.basicForm.puDemandItemList[this.tableIndex].manufacturerName = selection[0].manufacturerIdName
-      this.basicForm.puDemandItemList[this.tableIndex].puPeriod = selection[0].deliveryPeriod
-      this.basicForm.puDemandItemList[this.tableIndex].expiry = selection[0].usefulLife
-      this.basicForm.puDemandItemList[this.tableIndex].expiryUnit = selection[0].expiryUnitIdName
-      // this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].usefulLife
-      this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].minPackQty
-      this.basicForm.puDemandItemList[this.tableIndex].minOrderQty = selection[0].minOrderQty
-      this.basicForm.puDemandItemList[this.tableIndex].minBatch = selection[0].minBatchQty
-      this.basicForm.puDemandItemList[this.tableIndex].safeStock = selection[0].safeStock
-      this.basicForm.puDemandItemList[this.tableIndex].purOrgName = selection[0].purchasingOrganizationName
-      this.basicForm.puDemandItemList[this.tableIndex].puOrg = selection[0].purchasingOrganization
-      // 物料存储条件和运输条件
-      this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
-      this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
-      // 选中骨科耗材时候的物料,需求客户不必填
-      } else {
-        console.log('xxxxx', selection)
-        let newLine = []
-        for (let i = 0;i<selection.length;i++) {
-          let line = {...this.sonModel}
-          line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
-          line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
-          line.demandCustomer = this.basicForm.customer
-          line.demandCustomerName = this.basicForm.customerName
-                // 通过选择物料查询采购员
-          queryMan(selection[i].id).then(res => {
-            if (res.code === 200 && res.rows.length !== 0) {
-              line.buyer = res.rows[0].buyer
-              line.buyerName = res.rows[0].buyerName
-            }
-          })
-          line.materialCode = selection[i].code
-          line.material = selection[i].id
-          line.materialName = selection[i].name
-          line.classifyId = selection[i].classifyId
-          line.materialClassifyOneName = selection[i].oneClass
-          line.materialClassifyTwoName = selection[i].twoClass
-          line.materialClassifyThreeName = selection[i].threeClass
-          line.materialClassifyFourName = selection[i].fourClass
-          line.specification = selection[i].specification
-          line.model = selection[i].model
-          line.unit = selection[i].unitId
-          line.unitName = selection[i].unitIdName
-          line.registrant = selection[i].registrant
-          line.manufacturerName = selection[i].manufacturerIdName
-          line.puPeriod = selection[i].deliveryPeriod
-          line.expiry = selection[i].usefulLife
-          line.expiryUnit = selection[i].expiryUnitIdName
-          // line.minPackage = selection[i].usefulLife
-          line.minPackage = selection[i].minPackQty
-          line.minOrderQty = selection[i].minOrderQty
-          line.minBatch = selection[i].minBatchQty
-          line.safeStock = selection[i].safeStock
-          line.purOrgName = selection[i].purchasingOrganizationName
-          line.puOrg = selection[i].purchasingOrganization
-          // 物料存储条件和运输条件
-          line.transportationCondition = selection[i].transportationCondition
-          line.storageCondition = selection[i].storageCondition
-          // this.basicForm.puDemandItemList.push(line)
-          newLine.push(line)
-        }
-        // 删除指定下标
-        this.basicForm.puDemandItemList.splice(this.tableIndex,1,...newLine)
-        // this.basicForm.puDemandItemList.splice(this.tableIndex,1)
-      }
-    },
-    // 明细行选择参照
-    chooseDept(index, type, isPage, title) {
-      this.tableIndex = index
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.$refs.refer.init(this.referCondition)
-    },
-    // 明细行选择仓库需要先确认采购组织
-    chooseCangKu(index, type, isPage, title, pkOrg) {
-      this.tableIndex = index
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      if(pkOrg) {
-        this.referCondition.pkOrg = pkOrg
-        this.$refs.refer.init(this.referCondition)
-      } else {
-        this.$modal.notifyWarning("请先确认默认采购组织");
-      }
-    },
-    // 明细行选择货位先确认仓库
-    choosehuoWei(index, type, isPage, title, stordocId) {
-      this.tableIndex = index
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      // 选择收货货位前先选择收货仓库
-      if(stordocId) {
-        this.referCondition.stordocId = stordocId
-        this.$refs.refer.init(this.referCondition)
-      } else {
-        this.$modal.notifyWarning("请先选择收货仓库");
-      }
-    },
-    // 明细行清空收货仓库,货位,收货地址档案等
-    clearHang(index, title) {
-      if (title == '选择收货仓库') {
-        this.basicForm.puDemandItemList[index].deliveryWarehouseName = null
-        this.basicForm.puDemandItemList[index].deliveryWarehouse = null
-        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
-        this.basicForm.puDemandItemList[index].deliveryAllocation = null
-      }
-      if (title == '选择收货货位') {
-        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
-        this.basicForm.puDemandItemList[index].deliveryAllocation = null
-      }
-      if (title == '选择收货地址') {
-        this.basicForm.puDemandItemList[index].deliveryAddressName = null
-        this.basicForm.puDemandItemList[index].deliveryAddress = null
-        this.basicForm.puDemandItemList[index].contacts = null
-        this.basicForm.puDemandItemList[index].contactsPhone = null
-        this.basicForm.puDemandItemList[index].address = null
-      }
-      if (title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[index].additionalSupplierName = null
-        this.basicForm.puDemandItemList[index].additionalSupplier = null
-      }
-    },
-    // 清除需求客户将明细行内也清空
-    cleanCustomer() {
-      this.basicForm.customer = ''
-      this.basicForm.customerName = ''
-      this.basicForm.customerCode = ''
-      if (this.basicForm.puDemandItemList.length !== 0) {
-        this.basicForm.puDemandItemList.forEach(item => {
-          item.demandCustomerName = ''
-          item.demandCustomer = ''
-          item.status = ''
-          item.buyerName = ''
-          item.buyer = ''
-          item.reservedProportion = ''
-          item.reservedPeriod = ''
-          item.reservedQty = ''
-          item.averageQtyMonth = ''
-          item.demandPeriod = ''
-          item.forecastClassify = ''
-          item.onemonthAvgVolume = ''
-          item.threemonthAvgVolume = ''
-          item.puFreight = ''
-          item.superiorAllotQty = ''
-          item.resDemandQty = ''
-          item.executeQty = ''
-          item.deliveryWarehouseName = ''
-          item.deliveryWarehouse = ''
-          item.deliveryAllocationName = ''
-          item.deliveryAllocation = ''
-          item.lastWarehouseName = ''
-          item.lastAllocationName = ''
-          item.availableQty = ''
-          item.lastStockOrgName = ''
-          item.centralWarehouseQty = ''
-          item.allotCode = ''
-          item.deliveryAddress = ''
-          item.deliveryAddressName = ''
-          item.contacts = ''
-          item.contactsPhone = ''
-          item.address = ''
-        })
-      }
-    },
-    // 批量调整
-    adjustPl() {
-      if(this.ids.length == 0) {
-        this.$modal.notifyWarning('请至少选择一项数据进行操作!')
-      } else {
-        this.adjust.open = true
-      }
-    },
-    // 批量调整确认
-    confirmAdjust() {
-      console.log('data', this.adjust)
-      this.basicForm.puDemandItemList.forEach(item => {
-        this.ids.some(val => {
-          if(val == item.id) {
-            if(this.adjust.purchaseMan) {
-              item.buyer = this.adjust.purchaseMan
-              item.buyerName = this.adjust.purchaseManName
-            }
-            if(this.adjust.priceType) {
-              item.priceType = this.adjust.priceType
-            }
-            if(this.adjust.warehouseName) {
-              item.deliveryWarehouse = this.adjust.warehouse
-              item.deliveryWarehouseName = this.adjust.warehouseName
-              item.deliveryAllocation = this.adjust.allocation
-              item.deliveryAllocationName = this.adjust.allocationName
-            }
-            // if(this.adjust.allocationName) {
-            //   item.deliveryAllocation = this.adjust.allocation
-            //   item.deliveryAllocationName = this.adjust.allocationName
-            // }
-            if(this.adjust.remark) {
-              item.remark = this.adjust.remark
-            }
-            if(this.adjust.deliveryAddressName) {
-              item.deliveryAddressName = this.adjust.deliveryAddressName
-              item.deliveryAddress = this.adjust.deliveryAddress
-              item.contacts = this.adjust.contacts
-              item.contactsPhone = this.adjust.contactsPhone
-              item.address = this.adjust.address
-            }
-          }
-          this.adjust.open = false
-        })
-      })
-    },
-    // 批量调整选择货位
-    adjustHuoWei(type, isPage, title, stordocId) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      // 选择收货货位前先选择收货仓库
-      if (stordocId) {
-        this.referCondition.stordocId = stordocId
-        this.$refs.refer.init(this.referCondition)
-      } else {
-        this.$modal.notifyWarning("请先选择收货仓库");
-      }
-    },
-    // 关闭清空批量调整数据
-    closeEvent() {
-      this.adjust =  {
-        open: false,
-        priceType: '',
-        purchaseMan: '',
-        purchaseManName: '',
-        warehouse: '',
-        warehouseName: '',
-        allocation: '',
-        allocationName: '',
-        remark: '',
-        deliveryAddress: '',
-        deliveryAddressName: '',
-        contacts: '',
-        contactsPhone: '',
-        address: ''
-      }
-    },
-    // 必选标识
-    addRedStar(h, { column }) {
-      return [
-        h('span', { style: 'color: #F56C6C' }, '*'),
-        h('span', ' ' + column.label)
-      ];
-    },
-    // 表格表头标星
-    anotherRedStar(h, { column }) {
-      if(this.isBDXQ) {
-      return [
-        h('span', { style: 'color: #F56C6C' }, '*'),
-        h('span', ' ' + column.label)
-      ];
-      } else {
-       return [
-          h('span', ' ' + column.label)
-        ]; 
-      }
-    },
-    // 流程跳转
-    jumpOA() {
-      toOA(this.$store.state.user.name, this.basicForm.flowId).then(res => {
-        if(res.code === 200) {
-          window.open(res.oaUrl)
-        }
-      })
-    },
-    // 解决表格选中了又自动取消的问题
-    getRowKeys(row) {
-      return row.id
-    },
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.btn_group {
-  // width: 100%;
-  // margin: 20px 0;
-  display: flex;
-  justify-content: space-between;
-  position: absolute;
-  top: 10px;right: 20px;
-
-}
-.btn_grooup {
-  margin-bottom: 10px;
-  display: flex;
-  justify-content: space-between;
-}
-.hang {
-  margin: auto;
-}
-.hang ::v-deep .el-form-item__content{
-  margin-left: 0px !important;
-}
-// .el-table ::v-deep .el-form-item__error{
-//   padding-top: 0;
-//   top: 70%
-// }
-.el-table ::v-deep .success-row {
-  background: #f11616;
-}
-::v-deep .el-table__row > td {
-  border-right: none;
-}
-.pltzTxt{
-  text-align: right;
-  font-size: medium;
-  padding-right: 2%;
-}
-.pltzIpt{
-  width: 90%;
-}
-</style>

+ 874 - 0
src/views/purchase/PurchaseDemandList/index-bak.vue

@@ -0,0 +1,874 @@
+<template>
+  <div id="PurchaseDemandList">
+    <div v-if="isList">
+      <el-card style="position: relative;">
+        <el-form class="search_area" label-width="100px">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="需求单号">
+                <el-input
+                  v-model.trim="queryParams.code"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="需求客户">
+                <el-select clearable size="mini" v-model="queryParams.customer" @focus="chooseOrg('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
+                  <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="是否客户指定">
+                <el-select clearable v-model="queryParams.isCustomerSpecified" size="mini" style="width: 200px" placeholder="请选择">
+                  <el-option
+                    v-for="item in options"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="需求人员">
+                <el-select clearable size="mini" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :span="1.5"> -->
+              <!-- <el-form-item label="" label-width="20px"> -->
+                <div style="position: absolute;top: 3px;right: 10px;">
+                  <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+                  <el-button size="mini" plain @click="resetList">重置</el-button>
+                </div>
+              <!-- </el-form-item> -->
+            <!-- </el-col> -->
+          </el-row>
+        <CollapseTransition>
+          <div v-show="expanded">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="单据来源">
+                <el-select clearable v-model="queryParams.source" size="mini" style="width: 200px">
+                  <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="业务类型">
+                <el-select clearable v-model="queryParams.billType" size="mini" style="width: 200px">
+                  <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="需求部门">
+                <el-select clearable v-model="queryParams.demandDept" size="mini" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+                  <el-option
+                    v-for="item in deptOptions"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="需求日期">
+                <el-date-picker
+                  v-model="queryParams.demandDate"
+                  type="date"
+                  clearable
+                  value-format="yyyy-MM-dd"
+                  size="mini"
+                  style="width: 200px"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="物料编码">
+                <el-input
+                  v-model.trim="queryParams.materialCode"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="单据状态">
+                <el-select clearable v-model="queryParams.status" size="mini" style="width: 200px">
+                  <el-option v-for=" dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="需求计划">
+                <el-select clearable v-model="queryParams.planType" size="mini" style="width: 200px">
+                  <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <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-date-picker>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-row>
+            <el-col :span="1.5">
+              <el-form-item label="补单供应商">
+                <el-select clearable size="mini" v-model="queryParams.additionalSupplier" @focus="chooseOrg('SUPPLIER_PARAM', true, '供应商')" style="width: 200px">
+                  <el-option v-for="item in supplierOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          </div>
+        </CollapseTransition>
+        </el-form>
+        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
+
+        
+        <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
+
+          <el-dropdown size="mini" @command="handleCommand">
+            <el-button size="mini" type="primary" style="margin-left: 10px;">
+              导入<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="数据导入">数据导入</el-dropdown-item>
+              <el-dropdown-item command="模板下载">模板下载</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+
+          <el-dropdown size="mini" @command="handleExport">
+            <el-button size="mini" type="primary" style="margin: 0 10px;">
+              导出<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="选中导出">选中导出</el-dropdown-item>
+              <el-dropdown-item command="全部导出">全部导出</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+
+          <el-button type="primary" size="mini" @click="delItems">删除</el-button>
+          <!-- <el-button type="primary" size="mini">打印</el-button> -->
+        </div>
+        
+        <el-table
+          v-loading="loading"
+          :data="tableList" 
+          fit
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          max-height="410"
+          border
+          highlight-current-row
+          style="font-size: 12px;"
+          @selection-change="handleSelectionChange"
+          @row-click="rowSelect"
+          @row-dblclick="doubleClick"
+          ref="tables"
+        >
+          <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="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"/>
+          <el-table-column show-overflow-tooltip label="业务类型" align="center" width="120" prop="billType" :formatter="formatterBillType"/>
+          <!-- <el-table-column show-overflow-tooltip label="是否特殊需求" align="center" width="150" prop="isSpeical" /> -->
+          <el-table-column show-overflow-tooltip label="需求人员" align="center" prop="demandPersonalName" />
+          <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName" width="150"/>
+          <el-table-column show-overflow-tooltip label="需求部门" align="center" prop="demandDeptName" width="150"/>
+          <!-- <el-table-column show-overflow-tooltip label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
+          <!-- <el-table-column show-overflow-tooltip label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
+          <el-table-column show-overflow-tooltip label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
+          <el-table-column show-overflow-tooltip label="当前审批人" align="center" width="120" prop="approveUser" />
+          <el-table-column show-overflow-tooltip label="备注" align="center" width="150" prop="remark" />
+          <el-table-column
+          fixed="right"
+          label="操作"
+          align="center"
+          width="180"
+          >
+          <template slot-scope="scope">
+            <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 == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="deleteids(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+        </el-table>
+
+        <el-pagination
+          background
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 20, 50, 100, 200, 500]"
+          :page-size="50"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=total>
+        </el-pagination>
+      </el-card>
+    </div>
+
+    <!-- 用户导入对话框 -->
+    <el-dialog title="数据导入" :visible.sync="upload.open" width="400px">
+      <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="handleFileUploadProgress"
+      :on-success="handleFileSuccess"
+      :on-error="errorFile"
+      :auto-upload="false"
+      drag
+      >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
+      <!-- <div class="el-upload__tip" slot="tip">
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+      </div> -->
+      <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer">
+      <el-button size="mini" type="primary" @click="submitFileForm">确 定</el-button>
+      <el-button size="mini" @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 模板下载新增参数 -->
+    <el-dialog title="需求模板下载" :visible.sync="download.open" @close="clearDownload" width="400px">
+      <el-row style="margin-bottom: 20px;">
+        <span style="margin-right: 10px;">需求计划</span>
+        <el-select size="mini" v-model="download.planType">
+          <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+          </el-option>
+        </el-select>
+      </el-row>
+      <el-row style="margin-bottom: 20px;">
+        <span style="margin-right: 10px;">需求客户</span>
+        <el-select clearable size="mini" v-model="download.customer" @clear="download.customer = ''" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')">
+          <el-option v-for="item in mBcustomer" :key="item.id" :label="item.name" :value="item.code" />
+        </el-select>
+      </el-row>
+      <el-row style="margin-bottom: 20px;">
+        <span style="margin-right: 10px;">供应仓库</span>
+        <el-select clearable size="mini" v-model="download.warehouse" @clear="cleanMb" @focus="chooseOrg('WAREHOUSE_PARAM', true, '选择仓库')">
+          <el-option v-for="item in mBwarehouse" :key="item.id" :label="item.name" :value="item.code" />
+        </el-select>
+      </el-row>
+      <el-row style="margin-bottom: 20px;">
+        <span style="margin-right: 10px;">供应货位</span>
+        <el-select clearable size="mini" v-model="download.cargoSpace" @clear="download.cargoSpace = ''" @focus="mbHuowei('ALLOCATION_PARAM', true, '选择货位', download.warehouseId)">
+          <el-option v-for="item in mBcargoSpace" :key="item.id" :label="item.name" :value="item.code" />
+        </el-select>
+      </el-row>
+      <el-row style="margin-bottom: 20px;">
+        <span style="margin-right: 10px;">品类选择</span>
+        <el-select
+        v-model="download.category"
+        size="mini"
+        clearable
+        @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
+        >
+          <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.code" />
+        </el-select>
+      </el-row>
+      <div slot="footer">
+      <el-button size="mini" type="primary" @click="mbDownload">模板下载</el-button>
+      <el-button size="mini" @click="download.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="searchList"/>
+  
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
+  </div>
+</template>
+
+<script>
+// 导入的token
+import { getToken } from "@/utils/auth";
+import Add from './add.vue'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/sigleTreeRefer.vue'
+import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+// 流程收回
+import { rebacktWork } from '@/api/purchase/workSpace.js'
+import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand, confirmSubmit } from '@/api/purchase/purchaseDemand.js'
+export default {
+  name: 'PurchaseDemandList',
+  components: {
+    Add,
+    CollapseTransition,
+    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', 'oa_templete_id'],
+  data() {
+    return {
+      loading: true,
+      // 导入参数
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "数据导入",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 1,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/pu/demand/import"
+      },
+      // 模板下载参数
+      download: {
+        open: false,
+        planType: 'ZJH',
+        customer: '',
+        warehouse: '',
+        warehouseId: '',
+        cargoSpace: '',
+        category: ''
+      },
+      mBcustomer: [],
+      mBwarehouse: [],
+      mBcargoSpace: [],
+      classOptions: [],
+      // 下拉收起配置
+      expanded: false,
+      // 页面配置
+      isList: true,
+      // 页面状态
+      page: '',
+      queryParams: {
+        code: this.$route.query.billCode,
+        customer: '',
+        isCustomerSpecified: '',
+        demandPersonal: '',
+        source: '',
+        planType: '',
+        billType: '',
+        demandDept: '',
+        demandDate: '',
+        remark: '',
+        createTimeString: '',
+        materialCode: '',
+        status: '',
+        additionalSupplier: '',
+        pageNum: 1,
+        pageSize: 50
+      },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
+      options: [{
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
+      }],
+      customerOptions: [],
+      personOptions: [],
+      deptOptions: [],
+      supplierOptions: [],
+      tableList: [],
+      total: 0,
+      rowDetail: {},
+      disable: false,
+      ids: []
+    }
+  },
+  created() {
+    this.getList(this.queryParams)
+  },
+  methods: {
+    // 格式化表格内容
+    formatterPlanType(row) {
+      switch(row.planType){
+        case 'ZJH':
+          return '周计划'
+        case 'YJH':
+          return '月计划'
+        case 'JJXQ':
+          return '紧急计划'
+      }
+    },
+    formatterStatus(row) {
+      switch(row.status){
+        case '0':
+          return '未提交'
+        case '1':
+          return '审批中'
+        case '2':
+          return '已完成'
+        case '3':
+          return '已驳回'
+        case '9':
+          return '已回退'
+      }
+    },
+    formatterBillType(row) {
+      switch (row.billType) {
+        case 'ZQBH':
+          return '周期备货'
+        case 'FXXQ':
+          return '分销需求'
+        case 'TSXQ':
+          return '特殊采购需求'
+        case 'BDXQ':
+          return '补单需求'
+        case 'JJXQ':
+          return '紧急需求单'
+        case 'XPXQ':
+          return '新品需求'
+        case 'HZBM':
+          return '合作部门需求'
+        case 'DZBH':
+          return '大宗备货'
+        case 'XZCG':
+          return '行政类采购'
+      }
+    },
+    formatterSource(row) {
+      switch (row.source) {
+        case '1':
+          return '手工导入'
+        case '2':
+          return '按客户计算'
+        case '3':
+          return '按仓库计算'
+        case '4':
+          return '手工新增'
+      }
+    },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        code: '',
+        customer: '',
+        isCustomerSpecified: '',
+        demandPersonal: '',
+        source: '',
+        planType: '',
+        billType: '',
+        demandDept: '',
+        demandDate: '',
+        remark: '',
+        createTimeString: '',
+        materialCode: '',
+        status: '',
+        additionalSupplier: '',
+        pageNum: 1,
+        pageSize: 50
+      }
+      this.getList(this.queryParams)
+    },
+    getList(params){
+      getDemandList(params).then(res => {
+        if (res.code === 200) {
+          this.tableList = res.rows
+          this.total = res.total
+        }
+      }).then(() => {
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
+      })
+    },
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.ids = selection.map(item => item.id)
+      console.log('选中数组', this.ids.join())
+    },
+    mbDownload() {
+      this.$modal.loading("正在下载模板,请稍后...");
+      downLoadDemand(this.download).then(res => {
+        this.$modal.closeLoading();
+        const blob = new Blob([res], {
+          type: "application/vnd.ms-excel;charset=UTF-8",
+        });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+        const downloadElement = document.createElement("a"); //创建a标签
+        const href = window.URL.createObjectURL(blob); // 创建下载的链接
+        // var temp = res.headers["content-disposition"]; 
+        // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+        // var name = fileName.split(";")[0]; //切割成文件名
+        downloadElement.href = href;  //下载地址
+        downloadElement.download = '采购需求单模板'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); // 点击下载
+        document.body.removeChild(downloadElement); // 下载完成移除元素
+        window.URL.revokeObjectURL(href); // 释放blob对象
+        this.download.open = false
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 关闭模板下载弹窗清空参数
+    clearDownload() {
+      // 模板下载参数
+      this.download =  {
+        open: false,
+        planType: 'ZJH',
+        customer: '',
+        warehouse: '',
+        warehouseId: '',
+        cargoSpace: '',
+        category: ''
+      }
+    },
+    handleCommand(command) {
+      // alert(command)
+      if(command == '模板下载') {
+        this.download.open = true
+      }
+      if (command == '数据导入') {
+        this.upload.title = "用户导入"
+        this.upload.open = true
+      }
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+      this.$modal.loading("正在导入数据,请稍后...");
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.$modal.closeLoading();
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList(this.queryParams);
+    },
+    errorFile(err) {
+      this.$modal.closeLoading();
+      this.$modal.notifyError("文件已变动,请重新上传");
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    handleExport(command) {
+      if(command == '选中导出') {
+        if (this.ids.length == 0) {
+          this.$modal.notifyWarning("请选中至少一条数据");
+        } else {
+          this.$modal.loading("正在导出数据,请稍后...");
+          let param = {all: false, ids: this.ids}
+          exportDemand(param).then(res => {
+            this.$modal.closeLoading();
+            const blob = new Blob([res], {
+              type: "application/vnd.ms-excel;charset=UTF-8",
+            });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+            const downloadElement = document.createElement("a"); //创建a标签
+            const href = window.URL.createObjectURL(blob); // 创建下载的链接
+            // var temp = res.headers["content-disposition"]; 
+            // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+            // var name = fileName.split(";")[0]; //切割成文件名
+            downloadElement.href = href;  //下载地址
+            downloadElement.download = '采购需求单选中导出' + this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+            document.body.appendChild(downloadElement);
+            downloadElement.click(); // 点击下载
+            document.body.removeChild(downloadElement); // 下载完成移除元素
+            window.URL.revokeObjectURL(href); // 释放blob对象
+          }).catch(err => {
+            this.$modal.closeLoading();
+          })
+        }
+      } else {
+        this.$modal.loading("正在导出数据,请稍后...");
+        let param2 = {all: true}
+        exportDemand(param2).then(res => {
+          this.$modal.closeLoading();
+          const blob = new Blob([res], {
+            type: "application/vnd.ms-excel;charset=UTF-8",
+          });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+          const downloadElement = document.createElement("a"); //创建a标签
+          const href = window.URL.createObjectURL(blob); // 创建下载的链接
+          // var temp = res.headers["content-disposition"]; 
+          // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+          // var name = fileName.split(";")[0]; //切割成文件名
+          downloadElement.href = href;  //下载地址
+          downloadElement.download = '采购需求单全部导出' + this.parseTime(new Date().getTime()) + ".xlsx"; 
+          document.body.appendChild(downloadElement);
+          downloadElement.click(); // 点击下载
+          document.body.removeChild(downloadElement); // 下载完成移除元素
+          window.URL.revokeObjectURL(href); // 释放blob对象
+        }).catch(err => {
+          this.$modal.closeLoading();
+        })
+      }
+    },
+    addDivision() {
+      this.isList = false
+      this.page = 'add'
+      this.disable = false
+    },
+    check(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
+    doubleClick(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
+    // 表格选中数据
+    rowSelect(row) {
+      this.$refs.tables.toggleRowSelection(row);
+    },
+    edit(row) {
+      this.isList = false
+      this.page = 'edit'
+      this.rowDetail = row
+      this.disable = false
+    },
+    commit(row) {
+      console.log('row', row)
+      this.$modal.loading("提交中...");
+      submitDemand(row).then(res => {
+        if (res.code === 200) {
+          this.$modal.notifySuccess("提交成功");
+          this.$modal.closeLoading();
+          this.getList(this.queryParams)
+        }
+        if (res.code === 233) {
+          this.$modal.confirm(res.msg).then(function() {
+            // 确认
+          }).then(() => {
+            confirmSubmit(row).then(res => {
+              if (res.code === 200) {
+                this.$modal.notifySuccess("提交成功");
+                this.$modal.closeLoading();
+                this.getList(this.queryParams)
+              }
+            }).catch(err => {
+              this.$modal.closeLoading();
+            })
+            // 取消
+          }).catch(() => {
+            this.$modal.closeLoading();
+          })
+          this.$modal.closeLoading();
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 流程收回
+    reback(row) {
+      this.$modal.loading("收回中...");
+      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("收回成功");
+          this.$modal.closeLoading();
+          this.getList(this.queryParams)
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 行内删除
+    deleteids(row) {
+      console.log('row', row)
+      this.$modal.confirm('确定删除选择数据?').then(() => {
+        delDemand(row.id).then(res => {
+          if (res.code === 200) {
+            this.$modal.notifySuccess("删除成功");
+            this.getList(this.queryParams)
+          }
+        })
+        }).catch(() => {})
+    },
+    // 批量删除按钮
+    delItems() {
+      if(this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        let param = this.ids.join()
+        this.$modal.confirm('确认删除选中数据?').then(() => {
+        delDemand(param).then(res => {
+          if (res.code === 200) {
+            this.$modal.notifySuccess("删除成功");
+            this.getList(this.queryParams)
+          }
+        })
+        }).catch(() => {})
+      }
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+    drop() {
+      this.expanded = !this.expanded
+    },
+    // 搜索区参照选择
+    chooseOrg(type, isPage, title, stordocId) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      // 搜索区选择客户
+      if (this.referCondition.type == 'CUSTOMER_PARAM' && this.referCondition.title == '需求客户') {
+        this.customerOptions = selection
+        this.queryParams.customer = selection[0].id
+      }
+      // 模板内选择客户
+      if (this.referCondition.type == 'CUSTOMER_PARAM' && this.referCondition.title == '选择客户') {
+        this.mBcustomer = selection
+        this.download.customer = selection[0].code
+      }
+      // 模板内选择仓库
+      if (this.referCondition.type == 'WAREHOUSE_PARAM' && this.referCondition.title == '选择仓库') {
+        this.mBwarehouse = selection
+        this.download.warehouse = selection[0].code
+        this.download.warehouseId = selection[0].id
+      }
+      // 模板内选择货位
+      if (this.referCondition.type == 'ALLOCATION_PARAM' && this.referCondition.title == '选择货位') {
+        this.mBcargoSpace = selection
+        this.download.cargoSpace = selection[0].code
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.personOptions = selection
+        this.queryParams.demandPersonal = selection[0].code
+      }
+      if (this.referCondition.type == 'DEPT_PARAM') {
+        this.deptOptions = selection
+        this.queryParams.demandDept = selection[0].id
+      }
+      if (this.referCondition.type == 'SUPPLIER_PARAM') {
+        this.supplierOptions = selection
+        this.queryParams.additionalSupplier = selection[0].id
+      }
+    },
+    mbHuowei(type, isPage, title, stordocId) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      if(stordocId) {
+        this.referCondition.stordocId = stordocId
+        this.$refs.refer.init(this.referCondition)
+      } else {
+        this.$modal.notifyWarning("请先选择仓库")
+      }
+    },
+    cleanMb() {
+      this.download.warehouse = ''
+      this.download.warehouseId = ''
+    },
+    // 搜索区树形选择
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      this.download.category = selection.code
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+#PurchaseDemandList {
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.lines {
+  margin-top: 0;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+::v-deep .el-table__row > td {
+  border-right: none;
+}
+ ::v-deep .el-card .el-form-item {
+  margin-bottom: 10px;
+}
+</style>
+<style>
+.exporttable {
+  border: solid 1px #c0c0c0;
+}
+.el-table .el-table__header-wrapper th {
+  font-size: 14px;
+}
+</style>

+ 58 - 31
src/views/purchase/PurchaseDemandList/index.vue

@@ -180,43 +180,44 @@
           <!-- <el-button type="primary" size="mini">打印</el-button> -->
         </div>
         
-        <el-table
+        <el-super-ux-table
           v-loading="loading"
-          :data="tableList" 
-          fit
-          :cell-style="{ borderColor: '#c0c0c0' }"
-          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          v-model="tableList"
+          :columns="TableColumns"
+          size="mini"
+          :dict="dict"
+          index
+          checkbox
           class="exporttable"
-          max-height="410"
+          :height=410
           border
           highlight-current-row
+          convenitentOperation
+          storage-key="PurchaseDemandList"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
           @row-click="rowSelect"
           @row-dblclick="doubleClick"
           ref="tables"
         >
-          <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="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"/>
-          <el-table-column show-overflow-tooltip label="业务类型" align="center" width="120" prop="billType" :formatter="formatterBillType"/>
-          <!-- <el-table-column show-overflow-tooltip label="是否特殊需求" align="center" width="150" prop="isSpeical" /> -->
-          <el-table-column show-overflow-tooltip label="需求人员" align="center" prop="demandPersonalName" />
-          <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName" width="150"/>
-          <el-table-column show-overflow-tooltip label="需求部门" align="center" prop="demandDeptName" width="150"/>
-          <!-- <el-table-column show-overflow-tooltip label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
-          <!-- <el-table-column show-overflow-tooltip label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
-          <el-table-column show-overflow-tooltip label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
-          <el-table-column show-overflow-tooltip label="当前审批人" align="center" width="120" prop="approveUser" />
-          <el-table-column show-overflow-tooltip label="备注" align="center" width="150" prop="remark" />
-          <el-table-column
+          <!-- <ux-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
+          <ux-table-column show-overflow-tooltip title="序号" type="index" align="center" width="50px" fixed="left"/>
+          <ux-table-column show-overflow-tooltip title="需求单号" align="center" width="170" field="code"/>
+          <ux-table-column show-overflow-tooltip title="需求日期" align="center" width="100" field="demandDate"/>
+          <ux-table-column show-overflow-tooltip title="制单日期" align="center" width="100" field="createTime"/>
+          <ux-table-column show-overflow-tooltip title="需求计划" align="center" width="120" field="planType" :formatter="formatterPlanType"/>
+          <ux-table-column show-overflow-tooltip title="审批结束日期" align="center" width="120" field="approverFinishTime"/>
+          <ux-table-column show-overflow-tooltip title="单据状态" align="center" field="status" :formatter="formatterStatus"/>
+          <ux-table-column show-overflow-tooltip title="业务类型" align="center" width="120" field="billType" :formatter="formatterBillType"/>
+          <ux-table-column show-overflow-tooltip title="需求人员" align="center" field="demandPersonalName" />
+          <ux-table-column show-overflow-tooltip title="需求客户" align="center" field="customerName" width="150"/>
+          <ux-table-column show-overflow-tooltip title="需求部门" align="center" field="demandDeptName" width="150"/>
+          <ux-table-column show-overflow-tooltip title="单据来源" align="center" field="source" width="120" :formatter="formatterSource"/>
+          <ux-table-column show-overflow-tooltip title="当前审批人" align="center" width="120" field="approveUser" />
+          <ux-table-column show-overflow-tooltip title="备注" align="center" width="150" field="remark" /> -->
+          <ux-table-column
           fixed="right"
-          label="操作"
+          title="操作"
           align="center"
           width="180"
           >
@@ -227,8 +228,8 @@
             <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>
-        </el-table>
+        </ux-table-column>
+        </el-super-ux-table>
 
         <el-pagination
           background
@@ -342,7 +343,8 @@ export default {
     Add,
     CollapseTransition,
     Refers,
-    TreeRefers
+    TreeRefers,
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
   },
   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() {
@@ -419,7 +421,31 @@ export default {
       total: 0,
       rowDetail: {},
       disable: false,
-      ids: []
+      ids: [],
+      TableColumns: [
+        { item: { key: "code", title: "需求单号", width: 150 }, attr: {} },
+        { item: { key: "demandDate", title: "需求日期", width: 150 }, attr: {} },
+        { item: { key: "createTime", title: "制单日期", width: 150 }, attr: {} },
+        { item: { key: "planType", title: "需求计划", width: 150 }, attr: { is: "el-dict-tag", dictName: "sys_plan_type" } },
+        { item: { key: "approverFinishTime", title: "审批结束日期", width: 150 }, attr: {} },
+        { item: { key: "status", title: "单据状态", width: 150 }, attr: { is: "el-dict-tag", dictName: "sys_status" } },
+        { item: { key: "billType", title: "业务类型", width: 150 }, attr: { is: "el-dict-tag", dictName: "sys_business" } },
+        { item: { key: "demandPersonalName", title: "需求人员", width: 150 }, attr: {} },
+        { item: { key: "customerName", title: "需求客户", width: 150 }, attr: {} },
+        { item: { key: "demandDeptName", title: "需求部门", width: 150 }, attr: {} },
+        { item: { key: "source", title: "单据来源", width: 150 }, attr: { is: "el-dict-tag", dictName: "sys_bill_source" } },
+        { item: { key: "approveUser", title: "当前审批人", width: 150 }, attr: {} },
+        { item: { key: "remark", title: "备注", width: 150 }, attr: {} },
+      ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
+  })),
     }
   },
   created() {
@@ -664,7 +690,8 @@ export default {
     },
     // 表格选中数据
     rowSelect(row) {
-      this.$refs.tables.toggleRowSelection(row);
+
+      this.$refs.tables.toggleRowSelection([{row: row}]);
     },
     edit(row) {
       this.isList = false

+ 24 - 168
src/views/purchase/apply/add/index.vue

@@ -352,262 +352,118 @@
 
           } else if(scope.column.property == 'taxPrice') {
             console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
+            // let newLine = []
+            // const {TabColumns} = this;
+            // const {TableColumns} = TabColumns.find(
+            //   ({item: {key}}) => key === prop
+            // );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.taxPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].taxPrice = rows[0]
+              // for (let i = 0; i<rows.length; i++) {
+              //   let line = {...this.$init.params(TableColumns)}
+              //   line.taxPrice = rows[i]
+              //   newLine.push(line)
+              // }
+              // // 删除指定下标
+              // this.params[prop].splice(index,this.params[prop].length - index,...newLine)
+              // this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].taxPrice = rows[j]
               }
               // this.$refs.table.doLayout()
-              console.log(this.params[prop])
+              // console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } 

+ 24 - 168
src/views/purchase/apply/copy/index.vue

@@ -398,262 +398,118 @@
 
           } else if(scope.column.property == 'taxPrice') {
             console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
+            // let newLine = []
+            // const {TabColumns} = this;
+            // const {TableColumns} = TabColumns.find(
+            //   ({item: {key}}) => key === prop
+            // );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.taxPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].taxPrice = rows[0]
+              // for (let i = 0; i<rows.length; i++) {
+              //   let line = {...this.$init.params(TableColumns)}
+              //   line.taxPrice = rows[i]
+              //   newLine.push(line)
+              // }
+              // // 删除指定下标
+              // this.params[prop].splice(index,this.params[prop].length - index,...newLine)
+              // this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].taxPrice = rows[j]
               }
               // this.$refs.table.doLayout()
-              console.log(this.params[prop])
+              // console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } 

+ 24 - 168
src/views/purchase/apply/edit/index.vue

@@ -414,262 +414,118 @@
 
           } else if(scope.column.property == 'taxPrice') {
             console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
+            // let newLine = []
+            // const {TabColumns} = this;
+            // const {TableColumns} = TabColumns.find(
+            //   ({item: {key}}) => key === prop
+            // );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.taxPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].taxPrice = rows[0]
+              // for (let i = 0; i<rows.length; i++) {
+              //   let line = {...this.$init.params(TableColumns)}
+              //   line.taxPrice = rows[i]
+              //   newLine.push(line)
+              // }
+              // // 删除指定下标
+              // this.params[prop].splice(index,this.params[prop].length - index,...newLine)
+              // this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].taxPrice = rows[j]
               }
               // this.$refs.table.doLayout()
-              console.log(this.params[prop])
+              // console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice1') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice1 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice1 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice1 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'supplierName2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.supplierName2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].supplierName2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].supplierName2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'bidPrice2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.bidPrice2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].bidPrice2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].bidPrice2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } else if(scope.column.property == 'unitPrice2') {
-            console.log('复制内容:', rows)
-            let newLine = []
-            const {TabColumns} = this;
-            const {TableColumns} = TabColumns.find(
-              ({item: {key}}) => key === prop
-            );
             if(this.params[prop].length <= 1) {
-              for (let i = 0; i<rows.length; i++) {
-                let line = {...this.$init.params(TableColumns)}
-                line.unitPrice2 = rows[i]
-                newLine.push(line)
-              }
-              // 删除指定下标
-              this.params[prop].splice(index,this.params[prop].length - index,...newLine)
-              this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
-              // this.$refs.table.doLayout()
+              this.params[prop][index].unitPrice2 = rows[0]
               this.$modal.closeLoading();
             } else {
               for(let i = index , j = 0; i < this.params[prop].length; i++, j++) {
                 this.params[prop][i].unitPrice2 = rows[j]
               }
-              // this.$refs.table.doLayout()
-              console.log(this.params[prop])
               this.$modal.closeLoading();
             }
           } 

+ 180 - 38
src/views/purchase/equipmentData/add.vue

@@ -6,16 +6,15 @@
         <el-row :gutter="10">
 
           <el-col :span="1.5">
-            <el-form-item label="物料编码" prop="materialCode">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.materialCode">
-                <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial()"></el-button>
+            <el-form-item label="通用名称" prop="commonName">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.commonName">
               </el-input>
             </el-form-item>
           </el-col>
 
           <el-col :span="1.5">
-            <el-form-item label="物料名称" prop="materialName">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.materialName">
+            <el-form-item label="注册名" prop="registrationName">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.registrationName">
               </el-input>
             </el-form-item>
           </el-col>
@@ -28,8 +27,8 @@
           </el-col>
 
           <el-col :span="1.5">
-            <el-form-item label="厂家名称" prop="deviceCategory">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.deviceCategory">
+            <el-form-item label="厂家名称" prop="factoryName">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.factoryName">
               </el-input>
             </el-form-item>
           </el-col>
@@ -42,13 +41,13 @@
           </el-col>
 
           <el-col :span="1.5">
-            <el-form-item label="价格" prop="price">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.price">
+            <el-form-item label="参考价格" prop="referencePrice">
+              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.referencePrice">
               </el-input>
             </el-form-item>
           </el-col>
 
-          <el-col :span="1.5">
+          <!-- <el-col :span="1.5">
             <el-form-item label="省份" prop="province">
               <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.province">
               </el-input>
@@ -74,24 +73,56 @@
               <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.afterSalesEngineer">
               </el-input>
             </el-form-item>
+          </el-col> -->
+        </el-row>
+
+        <el-row>
+          <el-col :span="1.5">
+            <el-form-item label="是否项目/厂家年度授权" prop="isProjectOrFactoryEmpower">
+              <el-checkbox true-label= '0' false-label= '2' v-model="basicForm.isProjectOrFactoryEmpower"></el-checkbox>
+            </el-form-item>
           </el-col>
+        </el-row>
 
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="文件上传" prop="fileIds">
+            <el-upload
+              class="upload-demo"
+              :action="url + basicForm.id"
+              :on-preview="handlePreview"
+              :on-success='handleSuccess'
+              :on-remove="handleRemove"
+              :before-remove="beforeRemove"
+              multiple
+              :limit="1"
+              :on-exceed="handleExceed"
+              :file-list="basicForm.fileIds">
+              <el-button size="small" type="primary">点击上传</el-button>
+              <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
+            </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
           <el-col :span="1.5">
             <el-form-item label="参数" prop="parameters">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
+              <el-input type="textarea" style="width: 400px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
               </el-input>
             </el-form-item>
           </el-col>
+        </el-row>
 
+        <el-row>
           <el-col :span="1.5">
-            <el-form-item label="备注" prop="parameters">
-              <el-input clearable :disabled="sonDisable" size="mini" v-model="basicForm.parameters">
+            <el-form-item label="备注" prop="remark">
+              <el-input type="textarea" style="width: 400px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.remark">
               </el-input>
             </el-form-item>
           </el-col>
-
-
         </el-row>
+
       </el-form>
 
       <div class="btn_group">
@@ -99,16 +130,68 @@
         <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
         <el-button size="mini" plain @click="back">返回</el-button>
       </div>
+
+      <div class="btn_grooup">
+        <span>明细信息</span>
+        <div>
+          <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
+          <el-button type="primary" size="mini" @click="delLines" v-if="!sonDisable">删行</el-button>
+        </div>
+      </div>
+
+      <ux-grid
+        :data="basicForm.sysMaterialDeviceOriginItemList"
+        border
+        :cell-style="{ borderColor: '#c0c0c0' }"
+        :header-cell-style="{ borderColor: '#c0c0c0' }"
+        class="exporttable"
+        height="410"
+        max-height="410"
+        style="font-size: 12px;"
+        @selection-change="handleSelectionChange"
+        ref="table"
+        show-header-overflow="tooltip"
+        show-overflow="tooltip"
+        keep-source
+        beautifyTable
+        :checkbox-config="{highlight: true, trigger: 'row'}"
+        :edit-config="{trigger: 'click', mode: 'row'}">
+      >
+          <ux-table-column resizable type="checkbox" width="50px" fixed="left"/>
+          <!-- <ux-table-column resizable title="序号" type="index" align="center" width="50px"/> -->
+          <ux-table-column resizable title="省份" align="center"  field="province" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.province"/>
+            </template>
+          </ux-table-column>
+
+          <ux-table-column resizable title="大区负责人" align="center"  field="largeZoneCommander" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.largeZoneCommander"/>
+            </template>
+          </ux-table-column>
+
+          <ux-table-column resizable title="业务经理" align="center"  field="serviceManager" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.serviceManager"/>
+            </template>
+          </ux-table-column>
+
+          <ux-table-column resizable title="售后工程师" align="center"  field="afterSalesEngineer" edit-render>
+            <template v-slot:edit="scope">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.afterSalesEngineer"/>
+            </template>
+          </ux-table-column>
+      </ux-grid>
     </el-card>
 
-    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
   </div>
 </template>
 
 <script>
+import { addEquipment, getEquipmentDetail } from '@/api/purchase/equipmentData.js'
 export default {
   components: {
-    popDialog: () => import("@/components/PopDialog/index2.vue"),
   },
   props: ['pageStu','row', 'disable'],
   model: {
@@ -121,21 +204,29 @@ export default {
       sonPageStu: this.pageStu,
       sonDisable: this.disable,
       basicForm: {
-        materialCode: '',
-        materialName: '',
-        materialId: '',
+        id: '',
+        commonName: '',
+        registrationName: '',
         deviceCategory: '',
         factoryName: '',
         model: '',
-        price: '',
+        referencePrice: '',
         parameters: '',
-        province: '',
-        largeZoneCommander: '',
-        serviceManager: '',
-        afterSalesEngineer: '',
+        sysMaterialDeviceOriginItemList: [],
+        fileIds: [],
+        isProjectOrFactoryEmpower: '',
         remark: '',
       },
+      sonModal: {
+        province: null,
+        largeZoneCommander: null,
+        serviceManager: null,
+        afterSalesEngineer: null,
+      },
       basicRules: {},
+      ids:[],
+      delDemandItemList:[],
+      url: process.env.VUE_APP_BASE_API + '/device/origin/upload?deviceOriginId='
     }
   },
   created() {
@@ -149,25 +240,71 @@ export default {
     }
   },
   methods: {
-    getDetails() {
-
+    getDetails(row) {
+      getEquipmentDetail(row.id).then(res => {
+        if (res.code === 200) {
+          this.basicForm = res.data
+        }
+      })
     },
     editPage() {},
-    save() {},
+    async save() {
+      await addEquipment(this.basicForm).then(res => {
+        if(res.code === 200) {
+          this.$modal.alertSuccess("保存成功");
+          this.back()
+        }
+      })
+    },
     back() {
       this.$emit('jugislist', true)
       this.$emit('refresh')
     },
-    // 选择物料编码带出数据
-    chooseMaterial() {
-      // 传0只展示同步NC了的物料
-      this.$refs.materialRefer.init(0)
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item =>{
+        return item.id
+      })
+      console.log('选中数组', this.ids)
+    },
+    addLine() {
+      const newLine = {...this.sonModel}
+      this.basicForm.sysMaterialDeviceOriginItemList.push(newLine)
+    },
+    delLines() {
+      let delArr = this.$refs.table.getCheckboxRecords()
+      if (delArr.length !== 0) {
+        delArr.forEach(item => {
+          item.delFlag = '2'
+        })
+        console.log('kk',this.basicForm.sysMaterialDeviceOriginItemList)
+        let delList = []
+        delList = this.basicForm.sysMaterialDeviceOriginItemList.filter(item => {
+          return item.delFlag == '2'
+        })
+        this.basicForm.sysMaterialDeviceOriginItemList = this.basicForm.sysMaterialDeviceOriginItemList.filter(item => {
+          return item.delFlag == '0'
+        })
+        this.delDemandItemList.push(...delList)
+      } else {
+        this.$modal.notifyWarning('请至少选择一条明细!')
+      }
     },
-    selectMaterial(selection) {
-      console.log('选中的物料', selection)
-      this.basicForm.materialCode = selection[0].code
-      this.basicForm.materialName = selection[0].name
-      this.basicForm.materialId = selection[0].id
+    handleRemove(file, fileList) {
+      console.log(file, fileList);
+      this.basicForm.fileIds = []
+    },
+    handlePreview(file) {
+      console.log(file);
+    },
+    handleSuccess(response, file, fileList) {
+      console.log(response)
+      this.basicForm.fileIds = response.data
+    },
+    handleExceed(files, fileList) {
+      this.$message.warning(`当前限制选择1个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
+    },
+    beforeRemove(file, fileList) {
+      return this.$confirm(`确定移除 ${ file.name }?`);
     }
   }
 }
@@ -182,5 +319,10 @@ export default {
   position: absolute;
   top: 10px;right: 20px;
 
-}  
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: space-between;
+}
 </style>

+ 15 - 30
src/views/purchase/equipmentData/index.vue

@@ -8,27 +8,6 @@
       <!-- <span>设备产品数据库</span> -->
       <el-form class="search_area" label-width="100px">
         <el-row :gutter="10">
-          <el-col :span="1.5">
-            <el-form-item label="物料编码">
-                <el-input
-                  v-model.trim="params.materialCode"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                />
-              </el-form-item>
-          </el-col>
-
-          <el-col :span="1.5">
-            <el-form-item label="物料名称">
-                <el-input
-                  v-model.trim="params.materialName"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                />
-              </el-form-item>
-          </el-col>
 
           <el-col :span="1.5">
             <el-form-item label="设备类别">
@@ -74,7 +53,9 @@
           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> -->
+            <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
+            <el-button type="text" size="mini" @click="delItem(scope.row)">删除</el-button>
           </template>
         </ux-table-column>
       </el-super-ux-table>
@@ -119,7 +100,7 @@
 <script>
 // 导入的token
 import { getToken } from "@/utils/auth";
-import { getEquipmentDataList, downLoadMb } from '@/api/purchase/equipmentData.js'
+import { getEquipmentDataList, downLoadMb} from '@/api/purchase/equipmentData.js'
 export default {
   name: "equipmentData",
   dicts: [],
@@ -167,17 +148,14 @@ export default {
       selectData: [],
       // SearchColumns: SearchColumns,
       TableColumns: [
-        { item: { key: "materialCode", title: "物料编码", width: 150 }, attr: {} },
-        { item: { key: "materialName", title: "物料名称", width: 150 }, attr: {} },
+        { item: { key: "commonName", title: "通用名称", width: 150 }, attr: {} },
+        { item: { key: "registrationName", title: "注册名", width: 150 }, attr: {} },
         { item: { key: "deviceCategory", title: "设备类别", width: 150 }, attr: {} },
         { item: { key: "factoryName", title: "厂家名称", width: 150 }, attr: {} },
         { item: { key: "model", title: "型号", width: 150 }, attr: {} },
-        { item: { key: "price", title: "价格", width: 150 }, attr: {} },
+        { item: { key: "referencePrice", title: "参考价格", width: 150 }, attr: {} },
+        { item: { key: "isProjectOrFactoryEmpower", title: "是否项目/厂家年度授权", width: 150 }, attr: {} },
         { item: { key: "parameters", title: "参数", width: 150 }, attr: {} },
-        { item: { key: "province", title: "省份", width: 150 }, attr: {} },
-        { item: { key: "largeZoneCommander", title: "大区负责人", width: 150 }, attr: {} },
-        { item: { key: "serviceManager", title: "业务经理", width: 150 }, attr: {} },
-        { item: { key: "afterSalesEngineer", title: "售后工程师", width: 150 }, attr: {} },
         { item: { key: "remark", title: "备注", width: 150 }, attr: {} },
       ],
     }
@@ -261,6 +239,13 @@ export default {
       }
       this.useQuery(this.params, this.pageInfo)
     },
+    check(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
+    delItem(row) {},
   }
 }
 </script>

+ 2 - 2
src/views/purchase/purchase-order/column.js

@@ -260,7 +260,7 @@ const PurColumns = [
     },
   },
   { 
-    item:{ key: "redeployName", title: "转派人" , width:100 ,},
+    item:{ key: "redeployName", title: "转派人" , width:100 ,},
     attr:{
       isHidden:true,
     },
@@ -769,7 +769,7 @@ const CauseColumns = [
     },
   },
   { 
-    item:{ key: "redeployName", title: "转派人" , width: 100,},
+    item:{ key: "redeployName", title: "转派人" , width: 100,},
     attr:{
       isHidden:true,
     },

+ 28 - 14
src/views/purchase/task/columns.js

@@ -9,11 +9,11 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "existPrice", title: "是否有价格",width :100 },
+      item: { key: "existPrice", title: "是否有价格",width :90 },
       attr: { is: "el-dict-tag", dictName: "sys_true_false" },
     },
     {
-      item: { key: "materialCode", title: "物料编码",width :150 },
+      item: { key: "materialCode", title: "物料编码",width :120 },
       attr: {},
     },
     { item: { key: "materialName", title: "物料名称",width :150 }, attr: {} },
@@ -22,43 +22,57 @@ export default function useColumns() {
       item: { key: "manufacturerName", title: "生产厂家" ,width :100},
       attr: {},
     },
-    { item: { key: "unitName", title: "单位" ,width :100}, attr: {} },
-    { item: { key: "puQty", title: "采购数量",width :100 }, 
+    { item: { key: "unitName", title: "单位" ,width :60}, attr: {} },
+    { item: { key: "puQty", title: "采购数量",width :80 }, 
       attr: {
         isSummary:true,
       } 
     },
     {
-      item: { key: "executeQty", title: "已执行数量" ,width :100},
+      item: { key: "executeQty", title: "已执行数量" ,width :90},
       attr: {
         isSummary:true,
       },
     },
     {
-      item: { key: "residueQty", title: "未执行数量",width :100 },
+      item: { key: "residueQty", title: "未执行数量",width :90 },
       attr: {
         isSummary:true,
       },
     },
     {
-      item: { key: "closeQty", title: "关闭数量",width :100 },
+      item: { key: "closeQty", title: "关闭数量",width :80 },
       attr: {
         isSummary:true,
       },
     },
-    { item: { key: "buyerName", title: "采购员",width :100 }, attr: {} },
+    { item: { key: "buyerName", title: "采购员",width :80 }, attr: {} },
     {
       item: { key: "customerName", title: "收货客户",width :100 },
       attr: {},
     },
     { item: { key: "demandCode", title: "需求单号",width :150 }, attr: {} },
+    { item: { key: "isUrgency", title: "紧急程度",width :75 },
+      attr: { 
+        clearable: true,
+        is: "el-dict-tag", 
+        dictName: "urgency_degree" 
+      },
+    },
+    { item: { key: "isReplenishment", title: "补单标识",width :75 }, 
+      attr: { 
+        clearable: true,
+        is: "el-dict-tag", 
+        dictName: "sys_yes_no" 
+      },
+    },
     {
       item: { key: "assignSupplierName", title: "指定供应商" ,width :100},
       attr: {},
     },
     { item: { key: "code", title: "订单生成单号",width :160 }, attr: {} },
     { 
-      item: { key: "createTime", title: "创建时间",width :160 }, 
+      item: { key: "createTime", title: "创建时间",width:135 ,}, 
       attr: {} 
     },
     // {
@@ -71,8 +85,8 @@ export default function useColumns() {
     },
     { item: { key: "demandDate", title: "需求时间",width :100 }, attr: {} },
     {
-      item: { key: "isBack", title: "是否退回",width :100 },
-      attr: { is: "el-dict-tag", dictName: "sys_yes_no" ,width :100},
+      item: { key: "isBack", title: "是否退回",width :75 },
+      attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     { item: { key: "baskCause", title: "退回原因" ,width :100}, attr: {} },
     { item: { key: "backDate", title: "退回日期",width :100 }, attr: {} },
@@ -86,13 +100,13 @@ export default function useColumns() {
       attr: {},
     },
     { 
-      item:{ key: "redeployName", title: "转派人" , width:100 ,},
+      item:{ key: "redeployName", title: "转派人" , width:100 ,},
       attr:{
         isHidden:true,
       },
     },
     { 
-      item:{ key: "redeployDate", title: "转派时间" ,},
+      item:{ key: "redeployDate", title: "转派时间" ,width:135 ,},
       attr:{
         isHidden:true,
       },
@@ -277,7 +291,7 @@ export default function useColumns() {
       attr: { 
         clearable: true,
         is: "el-select", 
-        dictName: "sys_yes_no" 
+        dictName: "urgency_degree" 
       },
     },
     {

+ 2 - 2
vue.config.js

@@ -37,10 +37,10 @@ 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本地
+        target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
         // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //这是一个美女的本地