Przeglądaj źródła

Merge branch 'dev' of http://172.16.100.139/new-business/drp-web into dev

DongZ 1 rok temu
rodzic
commit
ff831a8351
32 zmienionych plików z 3468 dodań i 2750 usunięć
  1. 23 0
      src/api/business/ehr/wxworklogin.js
  2. 29 0
      src/components/popover-select-v2/index.vue
  3. 50 2
      src/components/popover-select/index.vue
  4. 1 1
      src/permission.js
  5. 5 0
      src/router/index.js
  6. 36 0
      src/views/business/ehr/ehrpm-entrance.vue
  7. 19 3
      src/views/business/ehr/pm/awaitMarkPm/detail.vue
  8. 5 1
      src/views/business/ehr/pm/awaitVerifyPm/detail.vue
  9. 8 11
      src/views/business/ehr/pm/finishMarkPm/detail.vue
  10. 8 11
      src/views/business/ehr/pm/finishVerifyPm/detail.vue
  11. 5 1
      src/views/business/ehr/pm/juniorPm/detail.vue
  12. 18 3
      src/views/business/ehr/pm/myPm/detail.vue
  13. 5 1
      src/views/business/ehr/pm/performance/detail.vue
  14. 1 2
      src/views/material/basicFile/details.vue
  15. 0 731
      src/views/material/basicFile/index-copy.vue
  16. 0 552
      src/views/material/requisition/index copy.vue
  17. 320 162
      src/views/monitor/job/index.vue
  18. 38 18
      src/views/monitor/job/log.vue
  19. 65 111
      src/views/purchase/DemandSummary/index.vue
  20. 887 254
      src/views/purchase/PurchaseDemandList/add.vue
  21. 193 0
      src/views/purchase/PurchaseDemandList/columns.js
  22. 14 0
      src/views/purchase/PurchaseDemandList/dicts.js
  23. 969 0
      src/views/purchase/PurchaseDemandList/index copy.vue
  24. 534 647
      src/views/purchase/PurchaseDemandList/index.vue
  25. 6 2
      src/views/purchase/apply/columns.js
  26. 1 0
      src/views/purchase/catalogue/columns.js
  27. 3 2
      src/views/purchase/catalogue/index.vue
  28. 195 193
      src/views/purchase/purchase-order/add/column.js
  29. 7 1
      src/views/purchase/purchase-order/add/index.vue
  30. 11 1
      src/views/purchase/purchase-order/edit/index.vue
  31. 4 1
      src/views/purchase/transferOrder/add.vue
  32. 8 39
      src/views/purchase/transferOrder/index.vue

+ 23 - 0
src/api/business/ehr/wxworklogin.js

@@ -0,0 +1,23 @@
+import request from "@/utils/request";
+
+//查询企业微信用户信息
+export function getWxworkUser_ehrpm(code) {
+  return request({
+    url: '/wxwork/ehrpm/getInfo/' + code,
+	headers: {
+	  isToken: false
+	},
+    method: 'get'
+  })
+}
+
+//根据手机号获取DRP用户信息
+export function getDrpUser(staffCode) {
+  return request({
+    'url': '/login/ehr/' + staffCode,
+    headers: {
+      isToken: false
+    },
+    'method': 'get',
+  })
+}

+ 29 - 0
src/components/popover-select-v2/index.vue

@@ -224,6 +224,33 @@ export default {
       const { referName } = this.$props;
       this.$emit("copyChange", this.innerValue.split(/,|,|\s+/));
     },
+    useBlur() {
+      const {
+        $props: { source, dataMapping },
+      } = this;
+
+      for (let key in dataMapping) {
+        if (dataMapping[key] === "id" || dataMapping[key] === "code") {
+          if (!source[key] || source[key] === "") {
+            this.innerValue = "";
+          }
+        }
+      }
+    },
+    handleKeyupDel() {
+      console.log("focus");
+      const {
+        $props: { source, dataMapping },
+      } = this;
+
+      for (let key in dataMapping) {
+        if (dataMapping[key] === "id" || dataMapping[key] === "code") {
+          if (source[key] && source[key] !== "") {
+            source[key] = undefined;
+          }
+        }
+      }
+    },
     handleClear() {
       this.innerValue = "";
     },
@@ -255,7 +282,9 @@ export default {
       v-model="innerValue"
       :value-key="valueKey"
       :fetch-suggestions="useAutocomplete"
+      @blur="useBlur"
       @select="useConfirm([$event])"
+      @keyup.delete.native="handleKeyupDel"
       style="width: 100%"
     >
       <i class="el-icon-search" slot="suffix" @click="open"> </i>

+ 50 - 2
src/components/popover-select/index.vue

@@ -125,6 +125,19 @@ export default {
       },
       immediate: true,
     },
+    innerValue: {
+      handler: function (newValue) {
+        if (!newValue) {
+          const {
+            $props: { source, dataMapping },
+          } = this;
+          for (let key in dataMapping) {
+            source[key] = undefined;
+          }
+          this.$emit("update:source", source);
+        }
+      },
+    },
   },
   methods: {
     //
@@ -254,8 +267,13 @@ export default {
       }
     },
     handleClear() {
-      if (!this.$props.multiple) {
+      const { source, multiple, dataMapping } = this.$props;
+      if (!multiple) {
         this.innerValue = "";
+        // for (let key in dataMapping) {
+        //   source[key] = "";
+        // }
+        // this.$emit("update:source", source);
       }
     },
     async useAutocomplete(prop, cb) {
@@ -280,6 +298,34 @@ export default {
       const { type, source } = this.$props;
       this.$emit("copyChange", this.innerValue.split(/,|,|\s+/));
     },
+    useBlur() {
+      const {
+        $props: { source, dataMapping, multiple },
+      } = this;
+      if (!multiple) {
+        for (let key in dataMapping) {
+          if (dataMapping[key] === "id" || dataMapping[key] === "code") {
+            if (!source[key] || source[key] === "") {
+              this.innerValue = "";
+            }
+          }
+        }
+      }
+    },
+    handleKeyupDel() {
+      console.log("focus");
+      const {
+        $props: { source, dataMapping },
+      } = this;
+
+      for (let key in dataMapping) {
+        if (dataMapping[key] === "id" || dataMapping[key] === "code") {
+          if (source[key] && source[key] !== "") {
+            source[key] = undefined;
+          }
+        }
+      }
+    },
   },
   created() {},
   mounted() {},
@@ -308,10 +354,12 @@ export default {
       v-bind="$attrs"
       v-model="innerValue"
       :size="size"
+      :disabled="disabled"
       :value-key="valueKey"
       :fetch-suggestions="useAutocomplete"
+      @blur="useBlur"
       @select="useConfirm([$event])"
-      :disabled="disabled"
+      @keyup.delete.native="handleKeyupDel"
       style="width: 100%"
     >
       <i :size="size" class="el-icon-search" slot="suffix" @click="open"> </i>

+ 1 - 1
src/permission.js

@@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request'
 
 NProgress.configure({ showSpinner: false })
 
-const whiteList = ['/login', '/register', '/test01', '/ehrentrance', '/canteenAddFood', '/canteenAddMenu', '/menuScreen', '/foodScreen','/business/wms/historical-route']
+const whiteList = ['/login', '/register', '/test01', '/ehrentrance','/business/ehr/ehrpm-entrance','/canteenAddFood', '/canteenAddMenu', '/menuScreen', '/foodScreen','/business/wms/historical-route']
 
 router.beforeEach((to, from, next) => {
   NProgress.start()

+ 5 - 0
src/router/index.js

@@ -62,6 +62,11 @@ export const constantRoutes = [
     hidden: true
   },
   {
+    path: '/business/ehr/ehrpm-entrance',
+    component: () => import('@/views/business/ehr/ehrpm-entrance'),
+    hidden: true
+  },
+  {
     path: '/canteenAddFood',
     component: () => import('@/views/canteen/addFood'),
     hidden: true

+ 36 - 0
src/views/business/ehr/ehrpm-entrance.vue

@@ -0,0 +1,36 @@
+<template>
+	<div>
+		正在前往DRP绩效...
+	</div>
+</template>
+<script>
+	import {getWxworkUser_ehrpm,getDrpUser} from "@/api/business/ehr/wxworklogin";
+	import {setToken} from '@/utils/auth'
+	export default {
+		data() {
+			return {
+			}
+		},
+		methods: {
+		},
+		async created() {
+			let query = this.$route.query;
+			console.log("query",query);
+			let res = await getWxworkUser_ehrpm(query.code);
+			console.log("res",res);
+			if(res.code == '200'){
+				let staffCode = res.data.userid;
+				let dres = await getDrpUser(staffCode);
+				if (dres.code === 200) {
+					let token = dres.token
+					setToken(token)
+					this.$store.commit('SET_TOKEN', token)
+					this.$store.dispatch("GetInfo").then(() => {})
+					this.$store.dispatch("GenerateRoutes").then(
+						this.$router.push({ path: '/business/ehr/pm/myPm' }).catch(()=>{})
+					)
+				}
+			}
+		}
+	}
+</script>

+ 19 - 3
src/views/business/ehr/pm/awaitMarkPm/detail.vue

@@ -51,7 +51,11 @@
               </template>
             </el-table-column>
             <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-            <el-table-column width="80" label="权重" align="center" prop="weight"/>
+            <el-table-column width="80" label="权重(%)" align="center" prop="weight">
+              <template slot-scope="scope">
+                {{scope.row.asItem ? "+/-" : scope.row.weight}}
+              </template>
+            </el-table-column>
             <el-table-column :show-overflow-tooltip="!isUnfold" label="指标说明" align="center" prop="instructions">
               <template slot-scope="scope">
                 <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>
@@ -138,6 +142,8 @@ export default {
       isUnfold:false,
       //是否显驳回弹出层
       turnDownOpen:false,
+      //上级评分
+      lldMark:0,
     };
   },
   computed: {
@@ -184,9 +190,10 @@ export default {
       if(this.form.ldMark){
         ldMark = this.form.ldMark;
       }else{
-        ldMark = data.reduce((sum, e) => sum + Number(e.leaderScoring || 0) * (Number(e.weight || 0) / 100), 0);
+        ldMark = data.reduce((sum, e) => sum + (e.asItem ? Number(e.leaderScoring || 0) : Number(e.leaderScoring || 0) * (Number(e.weight || 0) / 100)), 0);
         ldMark = ldMark.toFixed(1);
       }
+      this.lldMark = ldMark;
       return ['合计','','',this.form.weight,'','','',this.form.saMark,'',ldMark];
     },
     //驳回
@@ -223,6 +230,14 @@ export default {
       if("000001,001194".includes(this.$store.state.user.name)){
         this.form.comment = '-';
       }
+      if(this.form.staffDivide == 'C1' && this.lldMark > 150){
+        this.$modal.msgWarning("业务组总评分不能超过150!");
+        return;
+      }
+      if(this.form.staffDivide == 'C2' && this.lldMark > 100){
+        this.$modal.msgWarning("非务组总评分不能超过100!");
+        return;
+      }
       this.$refs["dataForm"].validate(async (valid, obj) => {
         if (valid) {
           //保存绩效数据
@@ -247,7 +262,8 @@ export default {
     },
     //返回
     btnBack(){
-      this.$router.back();
+      // this.$router.back();
+      this.$router.push({name:'AwaitMarkPm',params: { id: this.form.sourceId}});
     },
     //必选标识
     addRedStar(h, { column }) {

+ 5 - 1
src/views/business/ehr/pm/awaitVerifyPm/detail.vue

@@ -33,7 +33,11 @@
             </template>
           </el-table-column>
           <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-          <el-table-column width="80" label="权重" align="center" prop="weight"/>
+          <el-table-column width="80" label="权重(%)" align="center" prop="weight">
+              <template slot-scope="scope">
+                {{scope.row.asItem ? "+/-" : scope.row.weight}}
+              </template>
+            </el-table-column>
           <el-table-column :show-overflow-tooltip="!isUnfold" label="指标说明" align="center" prop="instructions">
             <template slot-scope="scope">
               <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>

+ 8 - 11
src/views/business/ehr/pm/finishMarkPm/detail.vue

@@ -47,7 +47,11 @@
               </template>
             </el-table-column>
             <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-            <el-table-column width="80" label="权重(%)" align="center" prop="weight"/>
+            <el-table-column width="80" label="权重(%)" align="center" prop="weight">
+              <template slot-scope="scope">
+                {{scope.row.asItem ? "+/-" : scope.row.weight}}
+              </template>
+            </el-table-column>
             <el-table-column :show-overflow-tooltip="!isUnfold" label="指标说明" align="center" prop="instructions">
               <template slot-scope="scope">
                 <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>
@@ -156,16 +160,9 @@ export default {
     //合计
     getSummaries(param){
       const { columns, data } = param;
-      let weight = data.reduce((sum, e) => sum + Number(e.weight || 0), 0);
-      this.weightSum = weight;
-      let selfScoring = 0;
-      if(this.form.saMark){
-        selfScoring = this.form.saMark;
-      }else{
-        selfScoring = data.reduce((sum, e) => sum + Number(e.selfScoring || 0) * (Number(e.weight || 0) / 100), 0);
-        selfScoring = selfScoring.toFixed(1);
-      }
-      return ['合计','','',weight,'','','',selfScoring,'',this.form.ldMark];
+      let val = data.reduce((sum, e) => sum + Number(e.weight || 0), 0);
+      this.weightSum = val;
+      return ['合计','','',val,'','','',this.form.saMark,'',this.form.ldMark];
     },
   }
 }

+ 8 - 11
src/views/business/ehr/pm/finishVerifyPm/detail.vue

@@ -35,7 +35,11 @@
               </template>
             </el-table-column>
             <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-            <el-table-column width="80" label="权重(%)" align="center" prop="weight"/>
+            <el-table-column width="80" label="权重(%)" align="center" prop="weight">
+              <template slot-scope="scope">
+                {{scope.row.asItem ? "+/-" : scope.row.weight}}
+              </template>
+            </el-table-column>
             <el-table-column :show-overflow-tooltip="!isUnfold" label="指标说明" align="center" prop="instructions">
               <template slot-scope="scope">
                 <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>
@@ -140,16 +144,9 @@ export default {
     //合计
     getSummaries(param){
       const { columns, data } = param;
-      let weight = data.reduce((sum, e) => sum + Number(e.weight || 0), 0);
-      this.weightSum = weight;
-      let selfScoring = 0;
-      if(this.form.saMark){
-        selfScoring = this.form.saMark;
-      }else{
-        selfScoring = data.reduce((sum, e) => sum + Number(e.selfScoring || 0) * (Number(e.weight || 0) / 100), 0);
-        selfScoring = selfScoring.toFixed(1);
-      }
-      return ['合计','','',weight,'','','',selfScoring,'',this.form.ldMark];
+      let val = data.reduce((sum, e) => sum + Number(e.weight || 0), 0);
+      this.weightSum = val;
+      return ['合计','','',val,'','','',this.form.saMark,'',this.form.ldMark];
     },
   }
 }

+ 5 - 1
src/views/business/ehr/pm/juniorPm/detail.vue

@@ -47,7 +47,11 @@
               </template>
             </el-table-column>
             <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-            <el-table-column width="80" label="权重(%)" align="center" prop="weight"/>
+            <el-table-column width="80" label="权重(%)" align="center" prop="weight">
+              <template slot-scope="scope">
+                {{scope.row.asItem ? "+/-" : scope.row.weight}}
+              </template>
+            </el-table-column>
             <el-table-column :show-overflow-tooltip="!isUnfold" label="指标说明" align="center" prop="instructions">
               <template slot-scope="scope">
                 <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>

+ 18 - 3
src/views/business/ehr/pm/myPm/detail.vue

@@ -51,14 +51,18 @@
             <!-- <el-button size="mini" @click="btnUnfold">{{isUnfold == true ? "收起" : "展开"}}</el-button> -->
           </div>
           <el-table size="mini"  :data="form.performanceItem" show-summary :summary-method="getSummaries" border>
-            <el-table-column type="index" width="50" label="序号"/>
+            <el-table-column type="index" width="50" align="center" label="序号"/>
             <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估方面" align="center" prop="aspect">
               <template slot-scope="scope">
                 <dict-tag :options="dict.type.ehr_pm_aspect" :value="scope.row.aspect"/>
               </template>
             </el-table-column>
             <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-            <el-table-column width="80" label="权重(%)" align="center" prop="weight"/>
+            <el-table-column width="80" label="权重(%)" align="center" prop="weight">
+              <template slot-scope="scope">
+                {{scope.row.asItem ? "+/-" : scope.row.weight}}
+              </template>
+            </el-table-column>
             <el-table-column :show-overflow-tooltip="!isUnfold" label="指标说明" align="center" prop="instructions">
               <template slot-scope="scope">
                 <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>
@@ -223,6 +227,8 @@ export default {
       isUnfold:false,
       //明细权重合计值
       weightSum: 0,
+      //自评分
+      saMark: 0,
     }
   },
   computed: {
@@ -360,9 +366,10 @@ export default {
       if(this.form.saMark){
         selfScoring = this.form.saMark;
       }else{
-        selfScoring = data.reduce((sum, e) => sum + Number(e.selfScoring || 0) * (Number(e.weight || 0) / 100), 0);
+        selfScoring = data.reduce((sum, e) => sum + (e.asItem ? Number(e.selfScoring || 0) :  Number(e.selfScoring || 0) * (Number(e.weight || 0) / 100)), 0);
         selfScoring = selfScoring.toFixed(1);
       }
+      this.saMark = selfScoring;
       return ['合计','','',weight,'','','',selfScoring,'',this.form.ldMark];
     },
     //提交
@@ -385,6 +392,14 @@ export default {
         });
       }
       if(this.form.status == '3'){
+        if(this.form.staffDivide == 'C1' && this.saMark > 150){
+          this.$modal.msgWarning("业务组自评总分不能超过150!");
+          return;
+        }
+        if(this.form.staffDivide == 'C2' && this.saMark > 100){
+          this.$modal.msgWarning("非务组自评总分不能超过100!");
+          return;
+        }
         this.$refs["dataForm"].validate(async valid => {
           if (valid) {
             let that = this;

+ 5 - 1
src/views/business/ehr/pm/performance/detail.vue

@@ -58,7 +58,11 @@
               </template>
             </el-table-column>
             <el-table-column width="100" :show-overflow-tooltip="!isUnfold" label="评估指标" align="center" prop="target" />
-            <el-table-column width="80" label="权重(%)" align="center" prop="weight"/>
+            <el-table-column width="80" label="权重(%)" align="center" prop="weight">
+              <template slot-scope="scope">
+                {{scope.row.asItem ? "+/-" : scope.row.weight}}
+              </template>
+            </el-table-column>
             <el-table-column :show-overflow-tooltip="!isUnfold" label="指标说明" align="center" prop="instructions">
               <template slot-scope="scope">
                 <div style="white-space: pre-wrap;text-align: left">{{scope.row.instructions}}</div>

+ 1 - 2
src/views/material/basicFile/details.vue

@@ -973,7 +973,6 @@
 </template>
 
 <script>
-import drTabs from "../components/dr-tabs.vue";
 import detailsTabs from "../config/detailsTabs";
 import materialApi from "@/api/material/basic";
 import { getDicts as getDicts } from "@/api/system/dict/data";
@@ -991,7 +990,7 @@ export default {
     },
   },
   components: {
-    drTabs,
+    drTabs: () => import("../components/dr-tabs.vue"),
     IsUsing: () => import("./isUsing/index.vue"),
     whlbButton: () => import("./wei-hu-lei-bie/index.vue"),
   },

+ 0 - 731
src/views/material/basicFile/index-copy.vue

@@ -1,731 +0,0 @@
-<!-- 物料信息基础档案 -->
-<script src="../../../main.js"></script>
-<template>
-  <div class="material-basic" v-loading="failLoad">
-    <!-- 主体列表 -->
-    <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"
-        :size="size"
-        :dict="dict"
-        :columns="SearchColumns"
-        @reset="handleResetQuery"
-        @submit="handleQuery"
-      ></el-super-search>
-
-      <!-- 操作栏 -->
-      <el-row
-        :gutter="10"
-        class="mb10"
-        type="flex"
-        justify="end"
-        style="margin: 10px 0"
-      >
-        <!-- 新增、修改、删除、复制 -->
-        <el-col :span="1.5">
-          <el-button-group>
-            <el-button :size="size" @click="handleEdit">修改</el-button>
-            <el-button :size="size" @click="handleRefresh">刷新</el-button>
-          </el-button-group>
-        </el-col>
-
-        <!-- 启用 -->
-        <el-col :span="1.5">
-          <is-using
-            :size="size"
-            :select-data="checkedList"
-            @success="handleQuery"
-          ></is-using>
-        </el-col>
-
-        <!-- 导入导出 -->
-        <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-group>
-        </el-col>
-
-        <!-- <el-col :span="1.5">
-          <whlbButton :data="checkedList" :size="size"></whlbButton>
-        </el-col> -->
-      </el-row>
-
-      <div
-        class="el-super-ux-table"
-        v-resize="resize"
-        style="
-          position: relative;
-          display: flex;
-          flex: 1;
-          flex-direction: column;
-          overflow: auto;
-        "
-      >
-        <ux-grid
-          v-if="tableHeader.length"
-          border
-          use-virtual
-          keep-source
-          beautify-table
-          :size="size"
-          :data="taskList"
-          :height="tableHeight"
-          ref="materialTable"
-          @cell-dblclick="handledbClick"
-          @select="handleSelect"
-          @select-all="handleSelectAll"
-          :header-row-style="{
-            color: '#515a6e',
-          }"
-          style="flex: 1"
-        >
-          <
-          <!-- 多选 -->
-          <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
-    >
-      <span>是否确认{{ optionDialog.op }}?</span>
-      <span slot="footer">
-        <el-button @click="handleOptionShow('option', false)">取 消</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"
-    >
-      <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
-          >
-          <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>
-  </div>
-</template>
-
-<script>
-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])],
-  components: {
-    ElSuperSearch: () => import("@/components/super-search/index.vue"),
-    ElDictTag: () => import("@/components/DictTag/index.vue"),
-    IsUsing: () => import("./isUsing/index.vue"),
-    whlbButton: () => import("./wei-hu-lei-bie/index.vue"),
-  },
-  data() {
-    const params = this.$init.params(SearchColumns);
-
-    return {
-      failLoad: false,
-      params: params,
-      SearchColumns: SearchColumns,
-      rowKey: "id",
-      size: "mini",
-      // 物料基本信息数据
-      taskList: [],
-      // 查询表单字段
-      queryForm: {
-        name: "",
-        code: "",
-        isEnable: "",
-      },
-      // 总条数
-      total: 1,
-      loading: false,
-      importData: {
-        show: false,
-        list: [],
-      },
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 50,
-        code: null,
-        name: null,
-      },
-      // 表头
-      tableHeader: [],
-      // 多选数组
-      checkedList: [],
-      // 列表选中数据
-      // checkedList: [],
-      // 操作弹窗
-      optionDialog: {
-        show: false,
-        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 == "已启用"
-      );
-    },
-
-    // 修改
-    handleEdit() {
-      if (this.checkedList.length == 1) {
-        this.$router.push({
-          path: `/material/basicFile/detail/${this.checkedList[0].id}`,
-          query: {
-            isEdit: true,
-          },
-        });
-      } else {
-        this.$notify.warning({
-          message: `${
-            this.checkedList.length > 1
-              ? "修改只能选择单个数据!"
-              : "请选择需要修改的信息!"
-          }`,
-        });
-      }
-    },
-    // 删除
-    handleDel() {
-      console.log("删除", this.checkedList);
-      // delMaterial
-      if (this.checkedList.length) {
-        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.warning({
-          message: `请选择需要删除的数据!`,
-        });
-      }
-    },
-    //查询
-    handleQuery() {
-      // 重新查询后需要清空列表选中的数据
-      this.checkedList = [];
-      this.$refs.materialTable.clearSelection();
-      this.getMaterialList();
-    },
-    // 重置查询条件
-    handleResetQuery() {
-      this.queryParams.pageNum = 1;
-
-      this.queryParams.pageSize = 100;
-
-      this.params = this.$init.params(SearchColumns);
-
-      this.handleQuery();
-    },
-    // 刷新
-    handleRefresh() {
-      this.getMaterialList();
-      // for (const key in this.queryForm) {
-      //   this.queryForm[key] = '';
-      // }
-    },
-
-    // 批量导入
-    handleImport() {
-      this.importData.show = true;
-    },
-    // 导入弹窗关闭前
-    handlefileDialogColse(done) {
-      this.importData.list = [];
-      done();
-    },
-    // 导入弹窗操作
-    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);
-            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 };
-                  if (null != param) {
-                    materialApi.exportMartial(param).then((res) => {
-                      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); // 创建下载的链接
-                      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",
-                });
-              } else {
-                this.$notify({
-                  message: res.msg,
-                  type: res.code == 200 ? "success" : "warning",
-                });
-              }
-            });
-          } else {
-            this.$notify({
-              title: "警告",
-              message: "请上传文件之后在确认!",
-              type: "warning",
-            });
-          }
-          break;
-      }
-    },
-
-    // 删除文件
-    handleFileRemove(file, fileList) {
-      // console.log('删除文件', file, 'file', fileList, 'fileList');
-      this.importData.list = fileList;
-    },
-    // 文件发生改变
-    handleChangeFile(file, fileList) {
-      this.importData.list = fileList;
-    },
-
-    // 批量导出
-    handleExport() {
-      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`
-        );
-      } else {
-        let params = {
-          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`
-        );
-      }
-    },
-    // 下载模板
-    handleDownTemplate() {
-      this.download("/system/material/download", {}, `物料基本信息模板.xlsx`);
-    },
-
-    // 操作弹窗显隐
-    handleOptionShow(type, val) {
-      switch (type) {
-        case "option":
-          this.optionDialog.show = val;
-          break;
-      }
-    },
-    // 操作弹窗确认按钮
-    handleComfirmOption(op) {
-      switch (op) {
-        case "cancal":
-          this.handleOptionShow("option", false);
-          break;
-      }
-    },
-
-    // 双击行
-    handledbClick(e) {
-      this.$router.push({
-        path: `/material/basicFile/detail/${e.id}`,
-      });
-    },
-    // 绑定row-key
-    getRowKey(row) {
-      return row.id;
-    },
-    // 对象数组去重
-    handleUnique(arr, key) {
-      // arr  需要去重的数组   type:作为去重依据的key
-      const res = new Map();
-      return arr.filter((arr) => !res.has(arr[key]) && res.set(arr[key], 1));
-    },
-    // 行数据勾选操作
-    handleSelect(selection, row) {
-      this.checkedList = selection;
-      // // true就是选中,0或者false是取消选中
-      // let selected = selection.length && selection.indexOf(row) !== -1
-    },
-    //手动勾选全选
-    handleSelectAll(selection) {
-      this.checkedList = selection;
-    },
-    // 获取物料列表信息
-    async getMaterialList() {
-      try {
-        this.loading = true;
-        let page = {
-          pageNum: this.queryParams.pageNum,
-          pageSize: this.queryParams.pageSize,
-        };
-
-        let param = {
-          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]) ||
-            "",
-        };
-
-        let { code, data } = await materialApi.materialList(param, page);
-
-        if (code == 200) {
-          this.taskList = data.tableBody.rows;
-          this.total = data.tableBody.total;
-        }
-      } catch (error) {
-      } finally {
-        this.loading = false;
-      }
-
-      // materialApi.materialList(param, page).then((res) => {
-      //   _this.loading = false;
-      //   console.log(res, '获取物料列表信息以及表头字段');
-      //   let {code, data} = res;
-      //   if (code == 200) {
-      //     _this.taskList = data.tableBody.rows;
-      //     _this.total = data.tableBody.total;
-
-      //   }
-      // })
-    },
-    // 获取物料列表表头
-    getTagList(templateCode) {
-      materialApi.tagList({ templateCode }).then((res) => {
-        console.log(res, "获取物料列表表头");
-        if (res.code == 200) {
-          this.tableHeader = res.data;
-        }
-      });
-    },
-  },
-  created() {},
-  beforeRouteEnter(to, from, next) {
-    next((vm) => {
-      if (from.name == "materialDetail") {
-        // this.$store.getQuery(this.queryForm);
-        console.log(vm, "queryValue", vm.$store);
-        vm.queryForm = vm.$store.state.query.queryVlue;
-        // 清空选中数据
-        vm.checkedList = [];
-        vm.$refs.materialTable && vm.$refs.materialTable.clearSelection();
-      }
-      vm.getTagList("material_list");
-      vm.getMaterialList();
-    });
-  },
-  // 进入详情,保留查询条件
-  beforeRouteLeave(to, from, next) {
-    if (to.name == "materialDetail") {
-      this.$store.commit("SET_QUERY", this.queryForm);
-    } else {
-      this.$store.commit("SET_QUERY", { name: "", code: "" });
-    }
-    next();
-  },
-};
-</script>
-
-<style lang="scss">
-.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;
-}
-</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;
-}
-::v-deep.uxbeautifyTableClass
-  .elx-header--column
-  .elx-resizable.is--line:before {
-  height: 100%;
-  background-color: #dfe6ec;
-}
-</style>

+ 0 - 552
src/views/material/requisition/index copy.vue

@@ -1,552 +0,0 @@
-<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 {
-  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",
-  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: "未提交",
-        },
-        {
-          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(() => {});
-    },
-    // 批量提交
-    async handleBatchSubmit() {
-      let filterList = this.checkedList.filter(
-        (item) => !(item.status === "0" || item.status === "3")
-      );
-
-      console.log(filterList, "filterList", this.checkedList.length);
-
-      if (!filterList.length && this.checkedList.length) {
-        this.handleConfirmTips(async () => {
-          try {
-            this.failLoad = true;
-
-            let ids = this.checkedList.map((item) => Number(item.id));
-
-            let { code, msg } = await betchSubmit({ ids });
-
-            if (code == 200) {
-              this.reset();
-            }
-
-            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: "存在不符合提交条件数据或未选择数据!",
-        });
-      }
-    },
-
-    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 {
-      }
-    },
-
-    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",
-              });
-              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;
-}
-.el-card {
-  width: calc(100% - 32px);
-  height: calc(100vh - 32px);
-  margin: 16px;
-  padding: 16px;
-  border-radius: 8px;
-}
-</style>

+ 320 - 162
src/views/monitor/job/index.vue

@@ -1,6 +1,13 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
       <el-form-item label="任务名称" prop="jobName">
         <el-input
           v-model="queryParams.jobName"
@@ -10,7 +17,11 @@
         />
       </el-form-item>
       <el-form-item label="任务组名" prop="jobGroup">
-        <el-select v-model="queryParams.jobGroup" placeholder="请选择任务组名" clearable>
+        <el-select
+          v-model="queryParams.jobGroup"
+          placeholder="请选择任务组名"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.sys_job_group"
             :key="dict.value"
@@ -20,7 +31,11 @@
         </el-select>
       </el-form-item>
       <el-form-item label="任务状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择任务状态" clearable>
+        <el-select
+          v-model="queryParams.status"
+          placeholder="请选择任务状态"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.sys_job_status"
             :key="dict.value"
@@ -30,8 +45,16 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
@@ -44,7 +67,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['monitor:job:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -55,7 +79,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['monitor:job:edit']"
-        >修改</el-button>
+          >修改</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -66,7 +91,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['monitor:job:remove']"
-        >删除</el-button>
+          >删除</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -76,9 +102,10 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['monitor:job:export']"
-        >导出</el-button>
+          >导出</el-button
+        >
       </el-col>
-<!--      <el-col :span="1.5">
+      <!--      <el-col :span="1.5">
         <el-button
           type="info"
           plain
@@ -97,22 +124,53 @@
           size="mini"
           @click="handleJobReport"
           v-hasPermi="['monitor:job:query']"
-        >报表</el-button>
+          >报表</el-button
+        >
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="jobList" @selection-change="handleSelectionChange">
+    <el-table
+      v-loading="loading"
+      :data="jobList"
+      @selection-change="handleSelectionChange"
+    >
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="任务编号" width="100" align="center" prop="jobId" />
-      <el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
+      <el-table-column
+        label="任务编号"
+        width="100"
+        align="center"
+        prop="jobId"
+      />
+      <el-table-column
+        label="任务名称"
+        align="center"
+        prop="jobName"
+        :show-overflow-tooltip="true"
+      />
       <el-table-column label="任务组名" align="center" prop="jobGroup">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_job_group" :value="scope.row.jobGroup"/>
+          <dict-tag
+            :options="dict.type.sys_job_group"
+            :value="scope.row.jobGroup"
+          />
         </template>
       </el-table-column>
-      <el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
-      <el-table-column label="cron执行表达式" align="center" prop="cronExpression" :show-overflow-tooltip="true" />
+      <el-table-column
+        label="调用目标字符串"
+        align="center"
+        prop="invokeTarget"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="cron执行表达式"
+        align="center"
+        prop="cronExpression"
+        :show-overflow-tooltip="true"
+      />
       <el-table-column label="状态" align="center">
         <template slot-scope="scope">
           <el-switch
@@ -123,7 +181,11 @@
           ></el-switch>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -131,26 +193,50 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['monitor:job:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['monitor:job:remove']"
-          >删除</el-button>
-          <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['monitor:job:changeStatus', 'monitor:job:query']">
-            <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
+            >删除</el-button
+          >
+          <el-dropdown
+            size="mini"
+            @command="(command) => handleCommand(command, scope.row)"
+            v-hasPermi="['monitor:job:changeStatus', 'monitor:job:query']"
+          >
+            <el-button size="mini" type="text" icon="el-icon-d-arrow-right"
+              >更多</el-button
+            >
             <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item command="handleRun" icon="el-icon-caret-right"
-                v-hasPermi="['monitor:job:changeStatus']">执行一次</el-dropdown-item>
-              <el-dropdown-item command="handleView" icon="el-icon-view"
-                v-hasPermi="['monitor:job:query']">任务详细</el-dropdown-item>
-              <el-dropdown-item command="handleJobLog" icon="el-icon-s-operation"
-                v-hasPermi="['monitor:job:query']">调度日志</el-dropdown-item>
+              <el-dropdown-item
+                command="handleRun"
+                icon="el-icon-caret-right"
+                v-hasPermi="['monitor:job:changeStatus']"
+                >执行一次</el-dropdown-item
+              >
+              <el-dropdown-item
+                command="handleView"
+                icon="el-icon-view"
+                v-hasPermi="['monitor:job:query']"
+                >任务详细</el-dropdown-item
+              >
+              <el-dropdown-item
+                command="handleJobLog"
+                icon="el-icon-s-operation"
+                v-hasPermi="['monitor:job:query']"
+                >调度日志</el-dropdown-item
+              >
 
-              <el-dropdown-item command="handleJobReport" icon="el-icon-s-operation"
-                                v-hasPermi="['monitor:job:query']">调度报表</el-dropdown-item>
+              <el-dropdown-item
+                command="handleJobReport"
+                icon="el-icon-s-operation"
+                v-hasPermi="['monitor:job:query']"
+                >调度报表</el-dropdown-item
+              >
             </el-dropdown-menu>
           </el-dropdown>
         </template>
@@ -158,7 +244,7 @@
     </el-table>
 
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -180,15 +266,23 @@
             </el-form-item>
           </el-col>
 
-          <el-col :span="12">
-            <el-form-item label="任务内容" prop="cont" >
-              <el-input v-model="form.cont" placeholder="请输入任务内容" />
+          <el-col :span="24">
+            <el-form-item label="任务内容" prop="cont">
+              <el-input
+                v-model="form.cont"
+                placeholder="请输入任务内容"
+                type="textarea"
+                :rows="4"
+              />
             </el-form-item>
           </el-col>
 
           <el-col :span="12">
-            <el-form-item label="超时限制" prop="timeout" >
-              <el-input v-model="form.timeout" placeholder="请输入超时限制" />
+            <el-form-item label="超时限制(小时)" prop="timeout">
+              <el-input
+                v-model="form.timeout"
+                placeholder="请输入超时限制(小时)"
+              />
             </el-form-item>
           </el-col>
 
@@ -248,9 +342,8 @@
             </el-form-item>
           </el-col>
 
-
-          <el-col :span="24"   >
-            <el-form-item prop="invokeTarget"  readonly >
+          <el-col :span="24">
+            <el-form-item prop="invokeTarget" readonly>
               <span slot="label">
                 调用方法
                 <el-tooltip placement="top">
@@ -262,12 +355,18 @@
                   <i class="el-icon-question"></i>
                 </el-tooltip>
               </span>
-              <el-input v-model="invokeTarget" placeholder="请输入调用目标字符串" />
+              <el-input
+                v-model="invokeTarget"
+                placeholder="请输入调用目标字符串"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="24">
             <el-form-item label="cron表达式" prop="cronExpression">
-              <el-input v-model="form.cronExpression" placeholder="请输入cron执行表达式">
+              <el-input
+                v-model="form.cronExpression"
+                placeholder="请输入cron执行表达式"
+              >
                 <template slot="append">
                   <el-button type="primary" @click="handleShowCron">
                     生成表达式
@@ -301,7 +400,8 @@
                   v-for="dict in dict.type.sys_job_status"
                   :key="dict.value"
                   :label="dict.value"
-                >{{dict.label}}</el-radio>
+                  >{{ dict.label }}</el-radio
+                >
               </el-radio-group>
             </el-form-item>
           </el-col>
@@ -313,12 +413,27 @@
       </div>
     </el-dialog>
 
-    <el-dialog title="Cron表达式生成器" :visible.sync="openCron" append-to-body destroy-on-close class="scrollbar">
-      <crontab @hide="openCron=false" @fill="crontabFill" :expression="expression"></crontab>
+    <el-dialog
+      title="Cron表达式生成器"
+      :visible.sync="openCron"
+      append-to-body
+      destroy-on-close
+      class="scrollbar"
+    >
+      <crontab
+        @hide="openCron = false"
+        @fill="crontabFill"
+        :expression="expression"
+      ></crontab>
     </el-dialog>
 
     <!-- 任务日志详细 -->
-    <el-dialog title="任务详细" :visible.sync="openView" width="700px" append-to-body>
+    <el-dialog
+      title="任务详细"
+      :visible.sync="openView"
+      width="700px"
+      append-to-body
+    >
       <el-form ref="form" :model="form" label-width="120px" size="mini">
         <el-row>
           <el-col :span="12">
@@ -326,17 +441,27 @@
             <el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="任务分组:">{{ jobGroupFormat(form) }}</el-form-item>
-            <el-form-item label="创建时间:">{{ form.createTime }}</el-form-item>
+            <el-form-item label="任务分组:">{{
+              jobGroupFormat(form)
+            }}</el-form-item>
+            <el-form-item label="创建时间:">{{
+              form.createTime
+            }}</el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="cron表达式:">{{ form.cronExpression }}</el-form-item>
+            <el-form-item label="cron表达式:">{{
+              form.cronExpression
+            }}</el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="下次执行时间:">{{ parseTime(form.nextValidTime) }}</el-form-item>
+            <el-form-item label="下次执行时间:">{{
+              parseTime(form.nextValidTime)
+            }}</el-form-item>
           </el-col>
           <el-col :span="24">
-            <el-form-item label="调用目标方法:">{{ form.invokeTarget }}</el-form-item>
+            <el-form-item label="调用目标方法:">{{
+              form.invokeTarget
+            }}</el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="任务状态:">
@@ -368,40 +493,58 @@
 </template>
 
 <script>
-import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job";
-import Crontab from '@/components/Crontab'
+import {
+  listJob,
+  getJob,
+  delJob,
+  addJob,
+  updateJob,
+  runJob,
+  changeJobStatus,
+} from "@/api/monitor/job";
+import Crontab from "@/components/Crontab";
 
 export default {
   components: { Crontab },
   name: "Job",
-  dicts: ['sys_job_group', 'sys_job_status', 'sys_oa','sys_oa_s','sys_yes_no'],
+  dicts: [
+    "sys_job_group",
+    "sys_job_status",
+    "sys_oa",
+    "sys_oa_s",
+    "sys_yes_no",
+  ],
   data() {
     return {
       pickerOptions: {
-        shortcuts: [{
-          text: '今天',
-          onClick(picker) {
-            picker.$emit('pick', new Date());
-          }
-        }, {
-          text: '昨天',
-          onClick(picker) {
-            const date = new Date();
-            date.setTime(date.getTime() - 3600 * 1000 * 24);
-            picker.$emit('pick', date);
-          }
-        }, {
-          text: '一周前',
-          onClick(picker) {
-            const date = new Date();
-            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
-            picker.$emit('pick', date);
-          }
-        }]
+        shortcuts: [
+          {
+            text: "今天",
+            onClick(picker) {
+              picker.$emit("pick", new Date());
+            },
+          },
+          {
+            text: "昨天",
+            onClick(picker) {
+              const date = new Date();
+              date.setTime(date.getTime() - 3600 * 1000 * 24);
+              picker.$emit("pick", date);
+            },
+          },
+          {
+            text: "一周前",
+            onClick(picker) {
+              const date = new Date();
+              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", date);
+            },
+          },
+        ],
       },
-      value1: '',
-      value2: '',
-      value3: '',
+      value1: "",
+      value2: "",
+      value3: "",
       // 遮罩层
       loading: true,
       // 选中数组
@@ -434,66 +577,66 @@ export default {
         jobGroup: undefined,
         jobType: undefined,
         jobTypeS: undefined,
-        dispc:undefined,
-        empno:undefined,
-        cont:undefined,
-        timeout:undefined,
+        dispc: undefined,
+        empno: undefined,
+        cont: undefined,
+        timeout: undefined,
         status: undefined,
-        duration:undefined
+        duration: undefined,
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
-        duration: [
-          { required: true, message: "不能为空", trigger: "blur" }
-        ],
-        dispc: [
-          { required: true, message: "不能为空", trigger: "blur" }
-        ],
-        jobTypeS: [
-          { required: true, message: "不能为空", trigger: "blur" }
-        ],
-        jobType: [
-          { required: true, message: "不能为空", trigger: "blur" }
-        ],
-        jobGroup: [
-          { required: true, message: "不能为空", trigger: "blur" }
-        ],
-        timeout: [
-          { required: true, message: "不能为空", trigger: "blur" }
-        ],
-        cont: [
-          { required: true, message: "不能为空", trigger: "blur" }
-        ],
-        empno: [
-          { required: true, message: "不能为空", trigger: "blur" }
-        ],
-        jobName: [
-          { required: true, message: "名称不能为空", trigger: "blur" }
-        ],
-         invokeTarget: [
-          { required: true, message: "调用目标字符串不能为空", trigger: "blur" }
+        duration: [{ required: true, message: "不能为空", trigger: "blur" }],
+        dispc: [{ required: true, message: "不能为空", trigger: "blur" }],
+        jobTypeS: [{ required: true, message: "不能为空", trigger: "blur" }],
+        jobType: [{ required: true, message: "不能为空", trigger: "blur" }],
+        jobGroup: [{ required: true, message: "不能为空", trigger: "blur" }],
+        timeout: [{ required: true, message: "不能为空", trigger: "blur" }],
+        cont: [{ required: true, message: "不能为空", trigger: "blur" }],
+        empno: [{ required: true, message: "不能为空", trigger: "blur" }],
+        jobName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
+        invokeTarget: [
+          {
+            required: true,
+            message: "调用目标字符串不能为空",
+            trigger: "blur",
+          },
         ],
         cronExpression: [
-          { required: true, message: "cron执行表达式不能为空", trigger: "blur" }
-        ]
-      }
+          {
+            required: true,
+            message: "cron执行表达式不能为空",
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
-  computed:{
-    invokeTarget:function (){
-      let white = ['jobName','empno','cont','timeout','jobGroup','jobType','jobTypeS','dispc','duration']
-      let param = ''
-      white.forEach((item,index)=>{
-        if(this.form[item])
-        index===white.length-1
-          ?param+=`'${this.form[item]}'`
-          :param+=`'${this.form[item]}',`
-      })
-      this.form.invokeTarget=`ryTask.oaTask(${param})`
-      return `ryTask.oaTask(${param})`
-    }
+  computed: {
+    invokeTarget: function () {
+      let white = [
+        "jobName",
+        "empno",
+        "cont",
+        "timeout",
+        "jobGroup",
+        "jobType",
+        "jobTypeS",
+        "dispc",
+        "duration",
+      ];
+      let param = "";
+      white.forEach((item, index) => {
+        if (this.form[item])
+          index === white.length - 1
+            ? (param += `'${this.form[item]}'`)
+            : (param += `'${this.form[item]}',`);
+      });
+      this.form.invokeTarget = `ryTask.oaTask(${param})`;
+      return `ryTask.oaTask(${param})`;
+    },
   },
   created() {
     this.getList();
@@ -502,7 +645,7 @@ export default {
     /** 查询定时任务列表 */
     getList() {
       this.loading = true;
-      listJob(this.queryParams).then(response => {
+      listJob(this.queryParams).then((response) => {
         this.jobList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -527,7 +670,7 @@ export default {
         cronExpression: undefined,
         misfirePolicy: 1,
         concurrent: 1,
-        status: "0"
+        status: "0",
       };
       this.resetForm("form");
     },
@@ -543,7 +686,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.jobId);
+      this.ids = selection.map((item) => item.jobId);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
     },
@@ -569,25 +712,33 @@ export default {
     // 任务状态修改
     handleStatusChange(row) {
       let text = row.status === "0" ? "启用" : "停用";
-      this.$modal.confirm('确认要"' + text + '""' + row.jobName + '"任务吗?').then(function() {
-        return changeJobStatus(row.jobId, row.status);
-      }).then(() => {
-        this.$modal.msgSuccess(text + "成功");
-      }).catch(function() {
-        row.status = row.status === "0" ? "1" : "0";
-      });
+      this.$modal
+        .confirm('确认要"' + text + '""' + row.jobName + '"任务吗?')
+        .then(function () {
+          return changeJobStatus(row.jobId, row.status);
+        })
+        .then(() => {
+          this.$modal.msgSuccess(text + "成功");
+        })
+        .catch(function () {
+          row.status = row.status === "0" ? "1" : "0";
+        });
     },
     /* 立即执行一次 */
     handleRun(row) {
-      this.$modal.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?').then(function() {
-        return runJob(row.jobId, row.jobGroup);
-      }).then(() => {
-        this.$modal.msgSuccess("执行成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('确认要立即执行一次"' + row.jobName + '"任务吗?')
+        .then(function () {
+          return runJob(row.jobId, row.jobGroup);
+        })
+        .then(() => {
+          this.$modal.msgSuccess("执行成功");
+        })
+        .catch(() => {});
     },
     /** 任务详细信息 */
     handleView(row) {
-      getJob(row.jobId).then(response => {
+      getJob(row.jobId).then((response) => {
         this.form = response.data;
         this.openView = true;
       });
@@ -604,12 +755,12 @@ export default {
     /** 任务日志列表查询 */
     handleJobLog(row) {
       const jobId = row.jobId || 0;
-      this.$router.push('/monitor/job-log/index/' + jobId)
+      this.$router.push("/monitor/job-log/index/" + jobId);
     },
     /** 任务日志列表查询 */
     handleJobReport(row) {
       const jobId = row.jobId || 0;
-      this.$router.push('/monitor/job-log/index/' + jobId)
+      this.$router.push("/monitor/job-log/index/" + jobId);
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -621,24 +772,24 @@ export default {
     handleUpdate(row) {
       this.reset();
       const jobId = row.jobId || this.ids;
-      getJob(jobId).then(response => {
+      getJob(jobId).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改任务";
       });
     },
     /** 提交按钮 */
-    submitForm: function() {
-      this.$refs["form"].validate(valid => {
+    submitForm: function () {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.jobId != undefined) {
-            updateJob(this.form).then(response => {
+            updateJob(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addJob(this.form).then(response => {
+            addJob(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -650,20 +801,27 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const jobIds = row.jobId || this.ids;
-      this.$modal.confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?').then(function() {
-        return delJob(jobIds);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?')
+        .then(function () {
+          return delJob(jobIds);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('monitor/job/export', {
-        ...this.queryParams
-      }, `job_${new Date().getTime()}.xlsx`)
-    }
-  }
+      this.download(
+        "monitor/job/export",
+        {
+          ...this.queryParams,
+        },
+        `job_${new Date().getTime()}.xlsx`
+      );
+    },
+  },
 };
-
 </script>

+ 38 - 18
src/views/monitor/job/log.vue

@@ -59,7 +59,11 @@
         ></el-date-picker>
       </el-form-item>
       <el-form-item label="是否完成" prop="whetherComplete">
-        <el-select v-model="queryParams.whetherComplete" placeholder="请选择任务是否完成" clearable>
+        <el-select
+          v-model="queryParams.whetherComplete"
+          placeholder="请选择任务是否完成"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.sys_job_complete"
             :key="dict.value"
@@ -76,7 +80,11 @@
         />
       </el-form-item>
       <el-form-item label="任务大类" prop="jobType">
-        <el-select v-model="queryParams.jobType" placeholder="请选择任务大类" clearable>
+        <el-select
+          v-model="queryParams.jobType"
+          placeholder="请选择任务大类"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.sys_oa"
             :key="dict.value"
@@ -86,7 +94,11 @@
         </el-select>
       </el-form-item>
       <el-form-item label="任务小类" prop="jobTypeS">
-        <el-select v-model="queryParams.jobTypeS" placeholder="请选择任务小类" clearable>
+        <el-select
+          v-model="queryParams.jobTypeS"
+          placeholder="请选择任务小类"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.sys_oa_s"
             :key="dict.value"
@@ -221,7 +233,7 @@
       />
       <el-table-column
         label="任务内容"
-        width="200"
+        width="400"
         align="center"
         prop="cont"
       />
@@ -367,7 +379,14 @@ import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog";
 
 export default {
   name: "JobLog",
-  dicts: ["sys_job_complete", "sys_oa", "sys_oa_s", "sys_common_status", "sys_job_group","sys_oa_back_state"],
+  dicts: [
+    "sys_job_complete",
+    "sys_oa",
+    "sys_oa_s",
+    "sys_common_status",
+    "sys_job_group",
+    "sys_oa_back_state",
+  ],
   data() {
     return {
       // 遮罩层
@@ -397,8 +416,8 @@ export default {
         status: undefined,
         jobType: undefined,
         jobTypeS: undefined,
-        empno:undefined,
-        whetherComplete:undefined
+        empno: undefined,
+        whetherComplete: undefined,
       },
     };
   },
@@ -431,26 +450,27 @@ export default {
           this.jobLogList = response.rows.map((item) => {
             const { executionTime, createTime, duration } = item;
 
-            const durations=`${duration}h`;
-            let tqaaaa  = null;
-
+            const durations = `${duration}h`;
+            let tqaaaa = null;
 
-            if(executionTime != null){
+            if (executionTime != null) {
               tqaaaa = (
-                parseInt (
-                  new Date(executionTime).getTime() - new Date(createTime).getTime()
+                parseInt(
+                  new Date(executionTime).getTime() -
+                    new Date(createTime).getTime()
                 ) /
                 1000 /
                 60 /
                 60
               ).toFixed(2);
             }
-            
 
             /** 用于计算超时时长 */
-             const calculateTime = (
-              parseInt (
-                new Date(executionTime == null ? Date(): executionTime).getTime() - new Date(createTime).getTime()
+            const calculateTime = (
+              parseInt(
+                new Date(
+                  executionTime == null ? Date() : executionTime
+                ).getTime() - new Date(createTime).getTime()
               ) /
               1000 /
               60 /
@@ -458,7 +478,7 @@ export default {
             ).toFixed(2);
 
             /** 计算超时时长 */
-            const timestemp = (calculateTime - duration).toFixed(2)  ;
+            const timestemp = (calculateTime - duration).toFixed(2);
 
             const tqbbbb = timestemp > 0 ? `超时 ${timestemp}h` : `未超时`;
 

+ 65 - 111
src/views/purchase/DemandSummary/index.vue

@@ -9,7 +9,7 @@
                 <el-select
                   multiple
                   v-model="queryParams.rowStatus"
-                  size="mini"
+                  :size="size"
                   style="width: 200px"
                   clearable
                 >
@@ -27,7 +27,7 @@
               <el-form-item label="采购员">
                 <el-select
                   clearable
-                  size="mini"
+                  :size="size"
                   v-model="queryParams.buyer"
                   @clear="cleanBuyer"
                   @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
@@ -46,7 +46,7 @@
               <el-form-item label="品类">
                 <el-select
                   v-model="queryParams.materialClassifyFour"
-                  size="mini"
+                  :size="size"
                   multiple
                   collapse-tags
                   clearable
@@ -68,22 +68,18 @@
               <el-form-item label="生产厂家">
                 <el-input
                   v-model.trim="queryParams.manufacturer"
-                  size="mini"
+                  :size="size"
                   clearable
                   style="width: 200px"
                 />
               </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="search"
+              <el-button type="primary" :size="size" @click="search"
                 >搜索</el-button
               >
-              <el-button size="mini" plain @click="reset">重置</el-button>
+              <el-button :size="size" plain @click="reset">重置</el-button>
             </div>
-            <!-- </el-form-item> -->
-            <!-- </el-col> -->
           </el-row>
 
           <CollapseTransition>
@@ -93,7 +89,7 @@
                   <el-form-item label="预测分类">
                     <el-select
                       v-model="queryParams.forecastClassification"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                       clearable
                     >
@@ -111,7 +107,7 @@
                   <el-form-item label="审核人">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.puManagerAuditor"
                       @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')"
                       style="width: 200px"
@@ -129,7 +125,7 @@
                   <el-form-item label="注册人">
                     <el-input
                       v-model.trim="queryParams.registrant"
-                      size="mini"
+                      :size="size"
                       clearable
                       style="width: 200px"
                     />
@@ -139,7 +135,7 @@
                   <el-form-item label="业务类型">
                     <el-select
                       v-model="queryParams.businessType"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                       clearable
                     >
@@ -160,7 +156,7 @@
                   <el-form-item label="单据来源">
                     <el-select
                       v-model="queryParams.billSource"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                       clearable
                     >
@@ -178,7 +174,7 @@
                   <el-form-item label="需求客户">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.customer"
                       @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')"
                       style="width: 200px"
@@ -196,7 +192,7 @@
                   <el-form-item label="供应仓库">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.lastWarehouse"
                       @focus="chooseRefer('WAREHOUSE_PARAM', true, '供应仓库')"
                       style="width: 200px"
@@ -214,7 +210,7 @@
                   <el-form-item label="供应库位">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.lastAllocation"
                       @focus="
                         chooseRefer(
@@ -250,14 +246,14 @@
                       <el-input
                         slot="reference"
                         clearable
-                        size="mini"
+                        :size="size"
                         v-model="queryParams.names"
                         @clear="clearMaterial"
                         style="width: 200px"
                         @paste.native="pasteMe($event)"
                       >
                         <el-button
-                          size="mini"
+                          :size="size"
                           slot="append"
                           @click="chooseMaterial"
                           >数量:{{
@@ -272,7 +268,7 @@
                   <el-form-item label="默认采购组织">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.purchaseOrg"
                       @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')"
                       style="width: 200px"
@@ -303,7 +299,7 @@
                   <el-form-item label="采购需求单号">
                     <el-input
                       v-model.trim="queryParams.code"
-                      size="mini"
+                      :size="size"
                       clearable
                       style="width: 200px"
                     />
@@ -330,11 +326,11 @@
                     <el-select
                       clearable
                       v-model="queryParams.isCustomerSpecified"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                     >
                       <el-option
-                        v-for="item in options"
+                        v-for="item in dict.type.sys_yes_no"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value"
@@ -349,11 +345,11 @@
                     <el-select
                       clearable
                       v-model="queryParams.isUrgency"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                     >
                       <el-option
-                        v-for="item in options"
+                        v-for="item in dict.type.sys_yes_no"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value"
@@ -367,7 +363,7 @@
                   <el-form-item label="补单供应商">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.additionalSupplier"
                       @focus="chooseRefer('SUPPLIER_PARAM', true, '供应商')"
                       style="width: 200px"
@@ -410,55 +406,55 @@
         ></el-divider>
 
         <div class="btn_grooup">
-          <el-button type="primary" size="mini" @click="editList"
+          <el-button type="primary" :size="size" @click="editList"
             >编辑</el-button
           >
           <el-button
             type="danger"
-            size="mini"
+            :size="size"
             v-if="!lineDisable"
             @click="cancelEdit"
             >取消编辑</el-button
           >
           <el-button
             type="success"
-            size="mini"
+            :size="size"
             v-if="!lineDisable"
             @click="saveList"
             >保存</el-button
           >
           <el-button
             type="primary"
-            size="mini"
+            :size="size"
             v-if="lineDisable"
             @click="confirms"
             >确认</el-button
           >
           <el-button
             type="primary"
-            size="mini"
+            :size="size"
             v-if="lineDisable"
             @click="cancels"
             >取消</el-button
           >
-          <!-- <el-button type="primary" size="mini" v-if="lineDisable" @click="cancelAudit">取消审批</el-button> -->
+          <!-- <el-button type="primary" :size="size" v-if="lineDisable" @click="cancelAudit">取消审批</el-button> -->
           <el-button
             type="primary"
-            size="mini"
+            :size="size"
             v-if="lineDisable"
             @click="audits"
             >审核</el-button
           >
           <el-button
             type="primary"
-            size="mini"
+            :size="size"
             v-if="lineDisable"
             @click="closeLine"
             >行关闭</el-button
           >
 
           <el-button
-            size="mini"
+            :size="size"
             type="primary"
             style="margin: 0 10px"
             v-if="lineDisable"
@@ -467,7 +463,7 @@
             导出
           </el-button>
 
-          <!-- <el-button type="primary" size="mini">转请购</el-button> -->
+          <!-- <el-button type="primary" :size="size">转请购</el-button> -->
         </div>
         <vxe-toolbar ref="xToolbar1" custom> </vxe-toolbar>
 
@@ -527,7 +523,7 @@
           >
             <template slot-scope="scope">
               <el-input
-                size="mini"
+                :size="size"
                 :disabled="scope.row.status !== '1' || lineDisable"
                 v-model="scope.row.finalBuyQty"
                 @change="jilu(scope.$rowIndex)"
@@ -848,7 +844,7 @@
           >
             <template slot-scope="scope">
               <el-input
-                size="mini"
+                :size="size"
                 :disabled="
                   scope.row.status !== '1' ||
                   lineDisable ||
@@ -908,11 +904,11 @@
               <el-input
                 readonly
                 :disabled="scope.row.status !== '1' || lineDisable"
-                size="mini"
+                :size="size"
                 v-model="scope.row.buyerName"
               >
                 <el-button
-                  size="mini"
+                  :size="size"
                   :disabled="scope.row.status !== '1' || lineDisable"
                   slot="append"
                   icon="el-icon-more"
@@ -1046,24 +1042,20 @@
           />
           <vxe-column title="操作" align="center" width="50">
             <template slot-scope="scope">
-              <el-button type="text" size="mini" @click="check(scope.row)"
+              <el-button type="text" :size="size" @click="check(scope.row)"
                 >查看</el-button
               >
             </template>
           </vxe-column>
         </vxe-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"
+        <pagination
           :total="total"
-        >
-        </el-pagination>
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList(queryParams)"
+          style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
+        />
       </el-card>
     </div>
 
@@ -1086,11 +1078,6 @@
 </template>
 
 <script>
-import Add from "./add";
-import Refers from "@/components/Refers/refers.vue";
-import TreeRefers from "@/components/Refers/treeRefer.vue";
-import popDialog from "@/components/PopDialog/index.vue";
-import CollapseTransition from "@/components/MyCollapse/collapse.vue";
 // 用于物料参照框数据
 import { getRefer } from "@/api/purchase/basic.js";
 import {
@@ -1107,6 +1094,7 @@ import {
 export default {
   name: "demandSummary",
   dicts: [
+    "sys_yes_no",
     "sys_row_status",
     "predictive_classify",
     "sys_period_unit",
@@ -1114,11 +1102,11 @@ export default {
     "sys_bill_source",
   ],
   components: {
-    Add,
-    CollapseTransition,
-    Refers,
-    TreeRefers,
-    popDialog,
+    Add: () => import("./add"),
+    CollapseTransition: () => import("@/components/MyCollapse/collapse.vue"),
+    Refers: () => import("@/components/Refers/refers.vue"),
+    TreeRefers: () => import("@/components/Refers/treeRefer.vue"),
+    popDialog: () => import("@/components/PopDialog/index.vue"),
   },
   data() {
     return {
@@ -1216,16 +1204,6 @@ export default {
       lastAllocationOptions: [],
       orgOptions: [],
       supplierOptions: [],
-      options: [
-        {
-          value: "Y",
-          label: "是",
-        },
-        {
-          value: "N",
-          label: "否",
-        },
-      ],
       referCondition: {
         type: "",
         isPage: true,
@@ -1347,33 +1325,27 @@ export default {
       };
       this.getList(this.queryParams);
     },
-    getList(params) {
-      getSummaryList(params)
-        .then((res) => {
-          if (res.code === 200) {
-            this.tableList = res.rows;
-            this.total = res.total;
-          }
-        })
-        .then(() => {
-          // 合计不显示重绘
-          this.$refs.table.doLayout();
-          this.loading = false;
-        })
-        .catch((err) => {
-          this.loading = false;
-        });
+    async getList(params) {
+      try {
+        this.loading = true;
+        let { code, rows, total } = await getSummaryList(params);
+        if (code == 200) {
+          this.tableList = rows;
+          this.total = total;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
     },
     selectAllEvent({ checked }) {
       const selection = this.$refs.table.getCheckboxRecords();
-      console.log("选中", selection);
       this.allSelection = selection;
       this.ids = selection.map((item) => item.demandItemId);
       console.log("选中数组", this.ids.join());
     },
     handleSelectionChange({ checked }) {
       const selection = this.$refs.table.getCheckboxRecords();
-      console.log("选中", selection);
       this.allSelection = selection;
       this.ids = selection.map((item) => item.demandItemId);
       console.log("选中数组", this.ids.join());
@@ -1418,16 +1390,6 @@ export default {
       // console.log(row)
       this.$refs.table.toggleCheckboxRow(row.row);
     },
-    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;
     },
@@ -1440,16 +1402,17 @@ export default {
       this.getList(this.queryParams);
     },
     saveList() {
-      // console.log('记录',this.record)
+      // console.log("记录", this.record);
       // 对记录的数据进行去重
       let newRecord = Array.from(new Set(this.record));
-      // console.log('去重后的', newRecord)
+      // console.log("去重后的", newRecord);
       let changeList = newRecord.map((i) => {
         return this.tableList[i];
       });
       // console.log('shuzu', changeList)
       editSummaryList(changeList).then((res) => {
         if (res.code === 200) {
+          this.record = [];
           this.$modal.notifySuccess("保存成功");
           this.lineDisable = true;
           this.getList(this.queryParams);
@@ -1717,10 +1680,6 @@ export default {
 .hang ::v-deep .el-form-item__content {
   margin-left: 0px !important;
 }
-.el-pagination {
-  margin-top: 10px;
-  text-align: right;
-}
 ::v-deep .vxe-body--row > td {
   border-right: none;
 }
@@ -1731,8 +1690,3 @@ export default {
   background-color: #ff8a8a !important;
 }
 </style>
-<style>
-.exporttable {
-  border: solid 1px #c0c0c0;
-}
-</style>

Plik diff jest za duży
+ 887 - 254
src/views/purchase/PurchaseDemandList/add.vue


+ 193 - 0
src/views/purchase/PurchaseDemandList/columns.js

@@ -0,0 +1,193 @@
+export default function useColumns() {
+
+  const 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,
+      width: item.width || 160,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
+  }));
+
+
+  const SearchColumns = [
+    {
+      item: { key: "code", title: "需求单号" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "customerName", title: "需求客户" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "CUSTOMER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          customer: "id",
+          customerName: "name"
+        },
+      },
+    },
+    {
+      item: { key: "isCustomerSpecified", title: "是否客户指定" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_yes_no",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "demandPersonalName", title: "需求人员" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "CONTACTS_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          demandPersonal: "code",
+          demandPersonalName: "name"
+        },
+      },
+    },
+    {
+      item: { key: "source", title: "单据来源" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_bill_source",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "billType", title: "业务类型" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_business",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "demandDeptName", title: "需求部门" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "DEPT_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          demandDept: "id",
+          demandDeptName: "name"
+        },
+      },
+    },
+    {
+      item: { width: 100, key: "demandDate", title: "需求日期", },
+      attr: {
+        clearable: true,
+        is: "el-date-picker",
+        type: "date",
+        valueFormat: "yyyy-MM-dd",
+      },
+    },
+    {
+      item: { key: "materialCode", title: "物料编码" },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "status", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_status",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "planType", title: "需求计划" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_plan_type",
+        clearable: true,
+      },
+    },
+    {
+      item: { width: 100, key: "createTimeString", title: "制单日期", },
+      attr: {
+        clearable: true,
+        is: "el-date-picker",
+        type: "date",
+        valueFormat: "yyyy-MM-dd",
+      },
+    },
+    {
+      item: { key: "additionalSupplierName", title: "补单供应商" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "SUPPLIER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          additionalSupplier: "id",
+          additionalSupplierName: "name"
+        },
+      },
+    },
+  ];
+
+  return { TableColumns, SearchColumns }
+}

+ 14 - 0
src/views/purchase/PurchaseDemandList/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);

+ 969 - 0
src/views/purchase/PurchaseDemandList/index copy.vue

@@ -0,0 +1,969 @@
+<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="demandWindow">需求窗口期</el-button>
+          <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-super-ux-table
+          v-loading="loading"
+          v-model="tableList"
+          :columns="TableColumns"
+          size="mini"
+          :dict="dict"
+          index
+          checkbox
+          class="exporttable"
+          :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"
+        >
+          <!-- <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"
+          title="操作"
+          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>
+        </ux-table-column>
+        </el-super-ux-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>
+
+    <!-- 需求窗口期 -->
+    <el-dialog title="需求窗口期" :visible.sync="setDemand.open" @close="closeDemand" width="800px">
+      <div slot="footer">
+        <el-button size="mini" @click="setDemand.open = false">取 消</el-button>
+        <el-button type="primary" size="mini" @click="saveDemand">保 存</el-button>
+      </div>
+      <el-table
+        :data="setDemand.gridData"
+      >
+        <el-table-column property="ways" label="方案">
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.ways" size="mini" disabled>
+              <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column property="category" label="类型">
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.category" size="mini" disabled>
+              <el-option v-for="dict in dict.type.sys_plan_type" :key="dict.value" :label="dict.label" :value="dict.value">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column property="deadline" label="截止星期">
+          <template slot-scope="scope">
+            <el-input-number size="mini" :min=1 :max="scope.row.ways == 'ZJH' ? 7 : 12 " v-model="scope.row.deadline" clearable @input=changeDeadline(scope.row)></el-input-number>
+          </template>
+        </el-table-column>
+        <el-table-column property="remark" label="备注">
+          <template slot-scope="scope">
+            <el-input size="mini" v-model="scope.row.remark" clearable></el-input>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- <span style="color: red">注:周计划星期填写范围1-7,月计划填写范围1-12</span> -->
+    </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, getDemandWindowList, saveDemandWindow } from '@/api/purchase/purchaseDemand.js'
+export default {
+  name: 'PurchaseDemandList',
+  components: {
+    Add,
+    CollapseTransition,
+    Refers,
+    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() {
+    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: [],
+      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,
+    },
+  })),
+    setDemand: {
+      open: false,
+      gridData: []
+    }
+    }
+  },
+  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: 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
+    },
+    // 需求窗口期配置
+    demandWindow() {
+      this.setDemand.open = true
+      this.$nextTick(() => {
+        getDemandWindowList().then(res => {
+          if (res.code === 200) {
+            this.setDemand.gridData = res.rows
+          }
+        })
+      })
+    },
+    saveDemand() {
+      let params = this.setDemand.gridData
+      saveDemandWindow(params).then(res => {
+        if (res.code === 200) {
+          this.$modal.notifySuccess("保存成功");
+          this.setDemand.open = false
+        }
+      })
+    },
+    changeDeadline(row) {
+      row.delFlag = '2'
+    },
+    closeDemand() {}
+  }
+}
+</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>

Plik diff jest za duży
+ 534 - 647
src/views/purchase/PurchaseDemandList/index.vue


+ 6 - 2
src/views/purchase/apply/columns.js

@@ -23,7 +23,7 @@ export default function useColumns() {
     { item: { key: "approveUser", title: "当前审批人", width: 100 }, attr: {} },
     {
       item: { key: "isEffective", title: "是否已推价格", width: 100 },
-      attr: { is: "el-dict-tag", dictName: "is_effective"},
+      attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
       item: { key: "approveTime", title: "单据申请日期", width: 100 },
@@ -65,7 +65,11 @@ export default function useColumns() {
         is: "el-popover-select-v2",
         referName: "SUPPLIER_PARAM",
         valueKey: "name",
-        dataMapping: { supplier: "id", supplierName: "name" },
+        dataMapping: {
+          supplier: "id",
+          supplierCode: "code",
+          supplierName: "name",
+        },
       },
     },
     {

+ 1 - 0
src/views/purchase/catalogue/columns.js

@@ -123,6 +123,7 @@ export default function useColumns() {
         valueKey: "name",
         dataMapping: {
           supplier: "id",
+          supplierCode: "code",
           supplierName: "name",
         },
       },

+ 3 - 2
src/views/purchase/catalogue/index.vue

@@ -12,6 +12,7 @@ export default {
     EnaButton: () => import("./enable/index.vue"),
     ExpButton: () => import("./export/index.vue"),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
   },
   data() {
@@ -180,7 +181,7 @@ export default {
         <el-button size="mini" @click="exportAll">全部导出</el-button>
       </el-button-group>
     </div>
-    <el-super-table
+    <el-super-ux-table
       v-model="tableData"
       :size="size"
       :dict="dict"
@@ -195,7 +196,7 @@ export default {
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"
     >
-    </el-super-table>
+    </el-super-ux-table>
   </el-card>
 </template>
 <style scoped lang="scss">

Plik diff jest za duży
+ 195 - 193
src/views/purchase/purchase-order/add/column.js


+ 7 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -826,10 +826,14 @@ export default {
             (params["stordocId"] = this.params.warehouse);
           let { code, rows } = await orderApi.REFER(params);
           if (code == 200) {
-            !rows.length &&
+            if (!rows.length) {
               this.$notify.warning({
                 message: "粘贴数据检索为空,请检查是否符合要求!",
               });
+              for (const key in dataMapping) {
+                source[key] = "";
+              }
+            }
             rows = rows.map((item) => {
               let obj = {};
               for (const key in dataMapping) {
@@ -972,6 +976,7 @@ export default {
                 :title="column.title"
                 :type="column.referName"
                 :disabled="column.disabled"
+                :clearable="column.clearable"
                 :multiple="column.multiple"
                 :placeholder="column.placeholder"
                 :data-mapping="column.dataMapping"
@@ -1153,6 +1158,7 @@ export default {
                       :value-key="cColumn.valueKey"
                       :type="cColumn.referName"
                       :disabled="cColumn.disabled"
+                      :clearable="cColumn.clearable"
                       :multiple="cColumn.multiple"
                       :copy="cColumn.copy"
                       :placeholder="cColumn.placeholder"

+ 11 - 1
src/views/purchase/purchase-order/edit/index.vue

@@ -779,10 +779,18 @@ export default {
             (params["stordocId"] = this.params.warehouse);
           let { code, rows } = await orderApi.REFER(params);
           if (code == 200) {
-            !rows.length &&
+            // !rows.length &&
+            //   this.$notify.warning({
+            //     message: "粘贴数据检索为空,请检查是否符合要求!",
+            //   });
+            if (!rows.length) {
               this.$notify.warning({
                 message: "粘贴数据检索为空,请检查是否符合要求!",
               });
+              for (const key in dataMapping) {
+                source[key] = "";
+              }
+            }
             rows = rows.map((item) => {
               let obj = {};
               for (const key in dataMapping) {
@@ -935,6 +943,7 @@ export default {
                 :placeholder="column.placeholder"
                 :data-mapping="column.dataMapping"
                 :disabled="column.disabled"
+                :clearable="column.clearable"
                 :query-params="column.queryParams"
                 @change="handleReferChange"
               ></dr-popover-select>
@@ -1112,6 +1121,7 @@ export default {
                       :title="cColumn.title"
                       :value-key="cColumn.valueKey"
                       :disabled="cColumn.disabled"
+                      :clearable="cColumn.clearable"
                       :copy="cColumn.copy"
                       :type="cColumn.referName"
                       :multiple="cColumn.multiple"

+ 4 - 1
src/views/purchase/transferOrder/add.vue

@@ -74,7 +74,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
-            <el-form-item label="客户">
+            <el-form-item label="客户" prop="customer">
               <DrPopoverSelectV2
                 size="mini"
                 v-model="basicForm.customerName"
@@ -1528,6 +1528,9 @@ export default {
         deliveryDept:[
           { required: true, message: "调出部门不能为空", trigger: "blur" },
         ],
+        customer:[
+          { required: true, message: "客户不能为空", trigger: "blur" },
+        ],
       },
       // materialInfo: [],
       receiveInfo: [],

+ 8 - 39
src/views/purchase/transferOrder/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="transferOrder">
     <div v-if="isList">
-      <el-card style="position: relative">
+      <el-card style="position: relative" v-loading="loading">
         <el-super-search
           v-model="params"
           :size="size"
@@ -11,7 +11,7 @@
           @submit="getList(params, Pages)"
         ></el-super-search>
 
-        <div class="btn_grooup">
+        <el-row class="my-4" style="text-align: right">
           <el-button-group style="margin-right: 5px">
             <el-button type="primary" :size="size" @click="addOrder"
               >新增</el-button
@@ -23,7 +23,7 @@
             @temDownload="useImportTemplate"
             :fileSize="2"
           ></BatchImport>
-        </div>
+        </el-row>
 
         <el-super-ux-table
           v-model="tableList"
@@ -48,33 +48,33 @@
             width="160"
           >
             <template slot-scope="scope">
-              <el-button type="text" size="mini" @click="check(scope.row)"
+              <el-button type="text" :size="size" @click="check(scope.row)"
                 >查看</el-button
               >
               <el-button
                 type="text"
-                size="mini"
+                :size="size"
                 v-if="scope.row.status == '0' || scope.row.status == '3'"
                 @click="edit(scope.row)"
                 >编辑</el-button
               >
               <el-button
                 type="text"
-                size="mini"
+                :size="size"
                 v-if="scope.row.status == '0' || scope.row.status == '3'"
                 @click="commit(scope.row)"
                 >提交</el-button
               >
               <el-button
                 type="text"
-                size="mini"
+                :size="size"
                 v-if="scope.row.status == '1'"
                 @click="handleBack(scope.row)"
                 >流程收回</el-button
               >
               <el-button
                 type="text"
-                size="mini"
+                :size="size"
                 v-if="scope.row.status == '0' || scope.row.status == '3'"
                 @click="deleteids(scope.row)"
                 >删除</el-button
@@ -113,7 +113,6 @@
       :row="rowDetail"
       @refresh="getList(params, Pages)"
     />
-    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true" />
   </div>
 </template>
 
@@ -121,8 +120,6 @@
 import useColumns from "./columns";
 import { dicts } from "./dicts";
 import Add from "./add.vue";
-import CollapseTransition from "@/components/MyCollapse/collapse.vue";
-import Refers from "@/components/Refers/refers.vue";
 import {
   getOrderList,
   delOrder,
@@ -136,8 +133,6 @@ export default {
   dicts: [...dicts, "oa_templete_id"],
   components: {
     Add,
-    CollapseTransition,
-    Refers,
     ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
     BatchImport: () => import("@/components/BatchImport/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
@@ -178,9 +173,6 @@ export default {
           label: "否",
         },
       ],
-      chuOrgOptions: [],
-      ruOrgOptions: [],
-      manOptions: [],
       tableList: [],
       // total: 0,
       tabParams: {
@@ -305,20 +297,6 @@ export default {
         .catch(() => {});
     },
 
-    selectionsToInput(selection) {
-      if (this.referCondition.title == "调出库存组织") {
-        this.chuOrgOptions = selection;
-        this.queryParams.deliveryInventoryOrg = selection[0].id;
-      }
-      if (this.referCondition.title == "调入库存组织") {
-        this.ruOrgOptions = selection;
-        this.queryParams.storageInventoryOrg = selection[0].id;
-      }
-      if (this.referCondition.title == "制单人") {
-        this.manOptions = selection;
-        this.queryParams.createBy = selection[0].code;
-      }
-    },
     //模板下载
     useImportTemplate() {
       this.download(
@@ -327,10 +305,6 @@ export default {
         `调拨单导入模板_${new Date().getTime()}.xlsx`
       );
     },
-    //导入
-    useImportData() {
-      console.log("导入");
-    },
     // 上传文件
     async onUpload(file) {
       try {
@@ -380,9 +354,4 @@ export default {
   box-sizing: border-box;
   overflow-y: scroll;
 }
-.btn_grooup {
-  margin: 10px 0;
-  display: flex;
-  justify-content: flex-end;
-}
 </style>

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików