Browse Source

盘点计划详情;查看设备台账详情,重置查询列表数据;

yijing 1 year ago
parent
commit
58bc012d56

+ 15 - 7
src/api/codeManagement/index.js

@@ -1,7 +1,15 @@
 import request from '@/utils/request';
-
+export async function fieldModel(params) {
+  const res = await request.get(`/main/fieldmodel/list`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 // 保存/修改编码信息
-export async function saveNew (data) {
+export async function saveNew(data) {
   const res = await request.post('/main/codemanage/saveNew', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -10,7 +18,7 @@ export async function saveNew (data) {
 }
 
 // 获取编码列表
-export async function getCodeList (data) {
+export async function getCodeList(data) {
   let par = new URLSearchParams(data);
   const res = await request.get(`/main/codemanage/page?` + par, {});
   if (res.data.code == 0) {
@@ -22,7 +30,7 @@ export async function getCodeList (data) {
 /**
  * 删除编码
  */
-export async function removeCodeInfo (params) {
+export async function removeCodeInfo(params) {
   const res = await request.post('/main/codemanage/delete', params);
   if (res.data.code == 0) {
     return res.data.message;
@@ -31,7 +39,7 @@ export async function removeCodeInfo (params) {
 }
 
 // 获取编码详情
-export async function getCodeDetail (id) {
+export async function getCodeDetail(id) {
   const res = await request.get(`/main/codemanage/getById/` + id, {});
   if (res.data.code == 0) {
     return res.data.data;
@@ -39,7 +47,7 @@ export async function getCodeDetail (id) {
   return Promise.reject(new Error(res.data.message));
 }
 // 生成编码
-export async function getCode (code) {
+export async function getCode(code) {
   const res = await request.get(`/main/codemanage/getCode/` + code, {});
   if (res.data.code == 0) {
     return res.data.data;
@@ -51,7 +59,7 @@ export async function getCode (code) {
  * 检查编码是否存在
  * @param code 编码
  */
-export async function checkCode (code) {
+export async function checkCode(code) {
   const res = await request.get('/main/codemanage/getByCode/' + code);
   if (res.data.code == 0) {
     return res.data.data;

+ 10 - 0
src/api/ruleManagement/plan.js

@@ -104,3 +104,13 @@ export async function removeRule(data) {
 //   }
 //   return Promise.reject(new Error(res.data.message));
 // }
+
+export async function getWarehouseList() {
+  const res = await request.post(`/wms/warehouse/select/warehouseList`, {
+    params: { status: 1 }
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 1
src/views/ledgerAssets/components/details/maintain.vue

@@ -265,7 +265,7 @@
       rest() {
         this.searchForm = {
           code: '',
-          deviceId: '',
+          deviceId: this.searchForm.deviceId,
           planCode: '',
           planName: '',
           executeStatus: '',

+ 288 - 341
src/views/ledgerAssets/components/details/malfunction.vue

@@ -6,74 +6,33 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="报修记录单号">
-              <el-input
-                v-model="searchForm.repairsCode"
-                placeholder="请输入"
-                size="small"
-              ></el-input> </el-form-item
-          ></el-col>
+              <el-input v-model="searchForm.repairsCode" placeholder="请输入" size="small"></el-input>
+            </el-form-item></el-col>
           <el-col :span="8">
             <el-form-item label="来源编码">
-              <el-input
-                v-model="searchForm.sourceCode"
-                placeholder="请输入"
-                size="small"
-              ></el-input> </el-form-item
-          ></el-col>
+              <el-input v-model="searchForm.sourceCode" placeholder="请输入" size="small"></el-input>
+            </el-form-item></el-col>
           <el-col :span="8">
             <el-form-item label="报修人">
-              <el-input
-                v-model="searchForm.repairsPerson"
-                placeholder="请输入"
-                size="small"
-              ></el-input> </el-form-item
-          ></el-col>
+              <el-input v-model="searchForm.repairsPerson" placeholder="请输入" size="small"></el-input>
+            </el-form-item></el-col>
           <el-col :span="8">
             <el-form-item label="报修时间">
-              <el-date-picker
-                class="form-input"
-                size="small"
-                v-model="searchForm.date"
-                type="daterange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-                value-format="yyyy-MM-dd HH:mm:ss"
-                :default-time="['00:00:00', '23:59:59']"
-                style="width: 100%"
-              >
-              </el-date-picker> </el-form-item
-          ></el-col>
+              <el-date-picker class="form-input" size="small" v-model="searchForm.date" type="daterange"
+                range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
+                :default-time="['00:00:00', '23:59:59']" style="width: 100%">
+              </el-date-picker> </el-form-item></el-col>
 
           <el-col :span="8">
             <el-form-item label="来源">
-              <el-select
-                filterable
-                v-model="searchForm.source"
-                class="w100"
-                size="small"
-              >
-                <el-option
-                  :value="item.value"
-                  :label="item.label"
-                  v-for="item in option.source"
-                  :key="item.value"
-                ></el-option>
-              </el-select> </el-form-item
-          ></el-col>
+              <el-select filterable v-model="searchForm.source" class="w100" size="small">
+                <el-option :value="item.value" :label="item.label" v-for="item in option.source"
+                  :key="item.value"></el-option>
+              </el-select> </el-form-item></el-col>
 
           <el-col :span="8" style="text-align: right">
-            <el-button icon="el-icon-refresh-left" size="small" @click="rest"
-              >重置</el-button
-            >
-            <el-button
-              type="primary"
-              icon="el-icon-search"
-              size="small"
-              @click="search"
-              >搜索</el-button
-            ></el-col
-          >
+            <el-button icon="el-icon-refresh-left" size="small" @click="rest">重置</el-button>
+            <el-button type="primary" icon="el-icon-search" size="small" @click="search">搜索</el-button></el-col>
         </el-row>
       </el-form>
       <!-- <el-table
@@ -85,27 +44,12 @@
         :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
       >
       </el-table> -->
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="tableData"
-        cache-key="systemRoleTable"
-      >
+      <ele-pro-table ref="table" :columns="columns" :datasource="tableData" cache-key="systemRoleTable">
       </ele-pro-table>
-      <div
-        class="zw-table-footer"
-        style="display: flex; justify-content: flex-end"
-      >
-        <el-pagination
-          background
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="total"
-          :page-sizes="[15, 30, 50, 100, 500]"
-          :page-size.sync="pages.size"
-          :current-page.sync="pages.page"
-          @current-change="handleCurrentChange"
-          @size-change="handleSizeChange"
-        >
+      <div class="zw-table-footer" style="display: flex; justify-content: flex-end">
+        <el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total"
+          :page-sizes="[15, 30, 50, 100, 500]" :page-size.sync="pages.size" :current-page.sync="pages.page"
+          @current-change="handleCurrentChange" @size-change="handleSizeChange">
         </el-pagination>
       </div>
     </div>
@@ -114,292 +58,295 @@
 </template>
 
 <script>
-  // import mixins from '../mixins/index'
-  import pagenation from '@/components/Pagination';
-  import { getWorkOrderList } from '@/api/maintenance/repair';
-  import { workorderStatus, resultStatus } from '@/utils/dict/operationManage';
-  // import DetailsDialog from "@/views/feature/maintenance/repair/RepairDetailsDialog.vue";
-  export default {
-    // mixins: [mixins],
-    props: {
-      id: {
-        typeof: String,
-        default: ''
-      }
-    },
-    // DetailsDialog
-    components: { pagenation },
-    data() {
-      return {
-        informationId: '',
-        tableData: [],
-        columns: [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'code',
-            slot: 'code',
-            label: '工单编号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 150
-          },
-          {
-            prop: 'planCode',
-            // label: '关联单号',
-            label: '计划单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'planName',
-            label: '维修名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'substanceDetailVO.name',
-            label: '设备名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'substanceDetailVO.fixCode',
-            label: '固资编码',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'substanceDetailVO.codeNumber',
-            label: '设备编号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'executeUserName',
-            label: '执行人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'assistsName',
-            label: '辅助人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
+// import mixins from '../mixins/index'
+import pagenation from '@/components/Pagination';
+import { getWorkOrderList } from '@/api/maintenance/repair';
+import { workorderStatus, resultStatus } from '@/utils/dict/operationManage';
+// import DetailsDialog from "@/views/feature/maintenance/repair/RepairDetailsDialog.vue";
+export default {
+  // mixins: [mixins],
+  props: {
+    id: {
+      typeof: String,
+      default: ''
+    }
+  },
+  // DetailsDialog
+  components: { pagenation },
+  data() {
+    return {
+      informationId: '',
+      tableData: [],
+      columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          slot: 'code',
+          label: '工单编号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150
+        },
+        {
+          prop: 'planCode',
+          // label: '关联单号',
+          label: '计划单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'planName',
+          label: '维修名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'substanceDetailVO.name',
+          label: '设备名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'substanceDetailVO.fixCode',
+          label: '固资编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'substanceDetailVO.codeNumber',
+          label: '设备编号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'executeUserName',
+          label: '执行人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'assistsName',
+          label: '辅助人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
 
+        {
+          prop: 'acceptTime',
+          label: '开始时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'finishTime',
+          label: '结束时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'planFinishTime',
+          label: '计划完成时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          columnKey: 'orderHour',
+          label: '实际工时(分钟)',
+          align: 'center',
+          resizable: false,
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (row) => {
+            if (row.finishTime && row.acceptTime) {
+              return parseInt(
+                (new Date(row.finishTime).getTime() -
+                  new Date(row.acceptTime).getTime()) /
+                60000
+              );
+            }
+          }
+        },
+        {
+          prop: 'orderStatus',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            return workorderStatus.filter(
+              (item) => item.code == row.orderStatus
+            )[0].label;
+          }
+        },
+        {
+          prop: 'acceptanceStatus',
+          label: '执行结果',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            return row.acceptanceStatus
+              ? resultStatus.filter(
+                (item) => item.code == row.acceptanceStatus
+              )[0].label
+              : '';
+          }
+        }
+      ],
+      searchForm: {
+        repairsCode: '',
+        sourceCode: '',
+        repairsPerson: '',
+        source: '',
+        date: ''
+      },
+      pages: {
+        page: 1,
+        size: 10
+      },
+      total: 0,
+      option: {
+        startTimeType: [
           {
-            prop: 'acceptTime',
-            label: '开始时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
+            value: '1',
+            label: '工单生成时间'
           },
           {
-            prop: 'finishTime',
-            label: '结束时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
+            value: '2',
+            label: '开工时间'
           },
           {
-            prop: 'planFinishTime',
-            label: '计划完成时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
+            value: '3',
+            label: '完工时间'
+          }
+        ],
+        source: [
+          {
+            value: '1',
+            label: '手动创建'
           },
           {
-            columnKey: 'orderHour',
-            label: '实际工时(分钟)',
-            align: 'center',
-            resizable: false,
-            showOverflowTooltip: true,
-            minWidth: 120,
-            formatter: (row) => {
-              if (row.finishTime && row.acceptTime) {
-                return parseInt(
-                  (new Date(row.finishTime).getTime() -
-                    new Date(row.acceptTime).getTime()) /
-                    60000
-                );
-              }
-            }
+            value: '3',
+            label: '告警通知'
           },
           {
-            prop: 'orderStatus',
-            label: '状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              return workorderStatus.filter(
-                (item) => item.code == row.orderStatus
-              )[0].label;
-            }
+            value: '4',
+            label: '保养工单'
           },
           {
-            prop: 'acceptanceStatus',
-            label: '执行结果',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              return row.acceptanceStatus
-                ? resultStatus.filter(
-                    (item) => item.code == row.acceptanceStatus
-                  )[0].label
-                : '';
-            }
+            value: '5',
+            label: '巡点检工单'
           }
-        ],
-        searchForm: {
-          repairsCode: '',
-          sourceCode: '',
-          repairsPerson: '',
-          source: '',
-          date: ''
-        },
-        pages: {
-          page: 1,
-          size: 10
-        },
-        total: 0,
-        option: {
-          startTimeType: [
-            {
-              value: '1',
-              label: '工单生成时间'
-            },
-            {
-              value: '2',
-              label: '开工时间'
-            },
-            {
-              value: '3',
-              label: '完工时间'
-            }
-          ],
-          source: [
-            {
-              value: '1',
-              label: '手动创建'
-            },
-            {
-              value: '3',
-              label: '告警通知'
-            },
-            {
-              value: '4',
-              label: '保养工单'
-            },
-            {
-              value: '5',
-              label: '巡点检工单'
-            }
-          ]
-        }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getdata();
+  },
+  methods: {
+    // 实现分页序号连贯
+    indexMethod(index) {
+      index = index + 1 + (this.pages.page - 1) * this.pages.size;
+      return index;
+    },
+    getdata() {
+      let par = {
+        // equiCode: this.code,
+        deviceId: this.id,
+        type: 3,
+        ...this.pages,
+        ...this.searchForm
       };
+      if (this.searchForm.date) {
+        par.startTime = this.searchForm.date[0];
+        par.endTime = this.searchForm.date[1];
+      }
+      delete par.date;
+      console.log(par, 'param');
+      getWorkOrderList(par).then((res) => {
+        this.tableData = res.list;
+        this.total = res.size;
+      });
     },
-    created() {
+    search() {
+      this.pages.page = 1;
       this.getdata();
     },
-    methods: {
-      // 实现分页序号连贯
-      indexMethod(index) {
-        index = index + 1 + (this.pages.page - 1) * this.pages.size;
-        return index;
-      },
-      getdata() {
-        let par = {
-          // equiCode: this.code,
-          deviceId: this.id,
-          type: 3,
-          ...this.pages,
-          ...this.searchForm
-        };
-        if (this.searchForm.date) {
-          par.startTime = this.searchForm.date[0];
-          par.endTime = this.searchForm.date[1];
-        }
-        console.log(par, 'param');
-        getWorkOrderList(par).then((res) => {
-          this.tableData = res.list;
-          this.total = res.size;
-        });
-      },
-      search() {
-        this.pages.page = 1;
-        this.getdata();
-      },
-      rest() {
-        this.searchForm = {
-          workOrderCode: '',
-          planCode: '',
-          planName: '',
-          repairsCode: '',
-          executeUserName: '',
-          startTimeType: '1',
-          date: ''
-        };
-        this.pages.page = 1;
-        this.getdata();
-      },
-      setAcceptTime(val) {
-        if (val) {
-          return JSON.parse(val).join('/');
-        } else {
-          return '';
-        }
-      },
-      jumpDetails(row) {
-        row.tabLabel = '维修信息';
-        row.title = '报修记录详情';
-        row.workOrderCode = row.id;
-        this.$refs.detailsDialogRef.init(row);
-        // this.$refs.detailsDialogRef.equipmentdialog = true
-        // const res = await repair.getInfo(row.id)
-        // this.infoData = res.data
-        // this.repairInfoLogs = res.data.repairInfoLogs
-      },
-      handleCurrentChange() {
-        this.getdata();
-      },
-      handleSizeChange() {
-        this.pages.page = 1;
-        this.getdata();
+    rest() {
+      this.searchForm = {
+        workOrderCode: '',
+        planCode: '',
+        planName: '',
+        repairsCode: '',
+        executeUserName: '',
+        startTimeType: '1',
+        date: ''
+      };
+      this.pages.page = 1;
+      this.getdata();
+    },
+    setAcceptTime(val) {
+      if (val) {
+        return JSON.parse(val).join('/');
+      } else {
+        return '';
       }
+    },
+    jumpDetails(row) {
+      row.tabLabel = '维修信息';
+      row.title = '报修记录详情';
+      row.workOrderCode = row.id;
+      this.$refs.detailsDialogRef.init(row);
+      // this.$refs.detailsDialogRef.equipmentdialog = true
+      // const res = await repair.getInfo(row.id)
+      // this.infoData = res.data
+      // this.repairInfoLogs = res.data.repairInfoLogs
+    },
+    handleCurrentChange() {
+      this.getdata();
+    },
+    handleSizeChange() {
+      this.pages.page = 1;
+      this.getdata();
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .wrapper {
-    background: #fff;
-    padding: 20px;
-  }
+.wrapper {
+  background: #fff;
+  padding: 20px;
+}
 
-  .search-box {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-  }
-  .repairsCode {
-    cursor: pointer;
-    &:hover {
-      color: #157a2c;
-    }
+.search-box {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.repairsCode {
+  cursor: pointer;
+
+  &:hover {
+    color: #157a2c;
   }
+}
 </style>

+ 1 - 1
src/views/ledgerAssets/components/details/point-inspection.vue

@@ -262,7 +262,7 @@
       rest() {
         this.searchForm = {
           code: '',
-          deviceId: '',
+          deviceId: this.searchForm.deviceId,
           planCode: '',
           planName: '',
           executeStatus: '',

+ 1 - 1
src/views/ledgerAssets/components/details/repair.vue

@@ -238,7 +238,7 @@
       rest() {
         this.searchForm = {
           code: '',
-          deviceId: '',
+          deviceId: this.searchForm.deviceId,
           planCode: '',
           planName: '',
           executeStatus: '',

+ 398 - 567
src/views/stocktaking/plan/components/addInventoryDialog.vue

@@ -1,56 +1,25 @@
 <template>
-  <el-dialog
-    :visible.sync="dialogVisible"
-    :title="dialogTile"
-    :before-close="handleClose"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    v-loading="addDialogLoading"
-    width="80%"
-    :fullscreen="fullscreen"
-    class="fullscreen"
-    ><template slot="title">
-      <modalTitle
-        :title="dialogTile"
-        @setFullscreen="fullscreen = !fullscreen"
-      ></modalTitle>
+  <el-dialog :visible.sync="dialogVisible" :title="dialogTile" :before-close="handleClose" :close-on-click-modal="false"
+    :close-on-press-escape="false" v-loading="addDialogLoading" width="80%" :fullscreen="fullscreen"
+    class="fullscreen"><template slot="title">
+      <modalTitle :title="dialogTile" @setFullscreen="fullscreen = !fullscreen"></modalTitle>
     </template>
     <HeaderTitle title="基本信息" size="16px"></HeaderTitle>
-    <el-form
-      :model="addForm"
-      class="add_form"
-      ref="addFormRef"
-      :rules="rules"
-      label-width="110px"
-    >
+    <el-form :model="addForm" class="add_form" ref="addFormRef" :rules="rules" label-width="110px">
       <el-row :gutter="20">
         <el-col :span="8">
           <el-form-item label="计划配置单号" prop="code">
-            <el-input
-              v-model="addForm.code"
-              placeholder="自动生成"
-              disabled
-            ></el-input>
+            <el-input v-model="addForm.code" placeholder="自动生成" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="计划配置名字" prop="name">
-            <el-input
-              :disabled="isBindPlan"
-              v-model="addForm.name"
-              placeholder="请输入"
-            ></el-input>
+            <el-input :disabled="isBindPlan" v-model="addForm.name" placeholder="请输入"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="自动派单" prop="autoOrder">
-            <el-select
-              v-model="addForm.autoOrder"
-              class="w100"
-              placeholder="请选择"
-              :disabled="isBindPlan"
-              filterable
-            >
+            <el-select v-model="addForm.autoOrder" class="w100" placeholder="请选择" :disabled="isBindPlan" filterable>
               <el-option :value="1" label="是"></el-option>
               <el-option :value="0" label="否"></el-option>
             </el-select>
@@ -58,114 +27,56 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="规则名称" prop="ruleId">
-            <el-select
-              v-model="addForm.ruleId"
-              class="w100"
-              placeholder="请选择规则名称"
-              @change="change_ruleId"
-              :disabled="isBindPlan"
-              filterable
-            >
-              <el-option
-                v-for="item in ruleNameList"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-                @click.native="addForm.ruleName = item.name"
-              ></el-option>
+            <el-select v-model="addForm.ruleId" class="w100" placeholder="请选择规则名称" @change="change_ruleId"
+              :disabled="isBindPlan" filterable>
+              <el-option v-for="item in ruleNameList" :key="item.id" :value="item.id" :label="item.name"
+                @click.native="addForm.ruleName = item.name"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="计划盘点时长" prop="executorDuration">
-            <el-input
-              v-model.number="addForm.executorDuration"
-              placeholder="请输入"
-              :disabled="isBindPlan"
-            >
+            <el-input v-model.number="addForm.executorDuration" placeholder="请输入" :disabled="isBindPlan">
               <template #suffix>分钟</template>
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="盘点仓库" prop="warehouseId">
-            <el-select
-              placeholder="请选择"
-              class="w100"
-              :disabled="isBindPlan"
-              v-model="addForm.warehouseId"
-              @change="changeWarehouse"
-              filterable
-            >
-              <el-option
-                v-for="item in warehouseList"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-                @click.native="
-                  () => {
-                    addForm.bizTypeName = item.name;
-                  }
-                "
-              ></el-option>
+            <el-select placeholder="请选择" class="w100" :disabled="isBindPlan" v-model="addForm.warehouseId"
+              @change="changeWarehouse" filterable>
+              <el-option v-for="item in warehouseList" :key="item.id" :value="item.id" :label="item.name" @click.native="
+                () => {
+                  addForm.bizTypeName = item.name;
+                }
+              "></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="审核人" prop="approvalUserId">
-            <el-select
-              v-model="addForm.approvalUserId"
-              size="small"
-              style="width: 100%"
-              :disabled="isBindPlan"
-              filterable
-            >
-              <el-option
-                v-for="item in uerList"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-              ></el-option>
+            <el-select v-model="addForm.approvalUserId" size="small" style="width: 100%" :disabled="isBindPlan"
+              filterable>
+              <el-option v-for="item in uerList" :key="item.id" :value="item.id" :label="item.name"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="紧急程度" prop="urgent">
-            <DictSelection
-              :isProhibit="isBindPlan"
-              dictName="紧急程度"
-              clearable
-              filterable
-              v-model="addForm.urgent"
-            >
+            <DictSelection :isProhibit="isBindPlan" dictName="紧急程度" clearable filterable v-model="addForm.urgent">
             </DictSelection>
           </el-form-item>
         </el-col>
         <el-col :span="8" v-if="addForm.autoOrder">
           <el-form-item label="执行部门" prop="executeGroupId">
-            <deptSelect
-              :isBindPlan="isBindPlan"
-              v-model="addForm.executeGroupId"
-              @changeGroup="searchDeptNodeClick"
-            />
+            <deptSelect :isBindPlan="isBindPlan" v-model="addForm.executeGroupId" @changeGroup="searchDeptNodeClick" />
           </el-form-item>
         </el-col>
         <el-col :span="8" v-if="addForm.autoOrder">
           <el-form-item label="执行人员" prop="executorId">
-            <el-select
-              v-model="addForm.executorId"
-              @change="changeExecutor"
-              :disabled="isBindPlan"
-              size="small"
-              style="width: 100%"
-              filterable
-            >
-              <el-option
-                v-for="item in executorList"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-              ></el-option>
+            <el-select v-model="addForm.executorId" @change="changeExecutor" :disabled="isBindPlan" size="small"
+              style="width: 100%" filterable>
+              <el-option v-for="item in executorList" :key="item.id" :value="item.id" :label="item.name"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
@@ -183,108 +94,38 @@
         </el-col> -->
         <el-col :span="24">
           <el-form-item label="备注" prop="remark">
-            <el-input
-              placeholder="请输入"
-              type="textarea"
-              :rows="2"
-              resize="none"
-              v-model="addForm.remark"
-              :disabled="isBindPlan"
-            ></el-input>
+            <el-input placeholder="请输入" type="textarea" :rows="2" resize="none" v-model="addForm.remark"
+              :disabled="isBindPlan"></el-input>
           </el-form-item>
         </el-col>
       </el-row>
       <HeaderTitle title="盘点物品信息" size="16px">
-        <el-select
-          :disabled="isBindPlan"
-          @change="dimensionChange"
-          v-model="dimension"
-          placeholder="请选择维度"
-        >
+        <el-select :disabled="isBindPlan" @change="dimensionChange" v-model="dimension" placeholder="请选择维度">
           <el-option label="物品维度" :value="1"> </el-option>
           <el-option label="批次维度" :value="2"> </el-option>
         </el-select>
-        <el-button
-          v-if="!isBindPlan"
-          style="margin-left: 10px"
-          type="primary"
-          @click="addProducts"
-          >添加物品</el-button
-        >
+        <el-button v-if="!isBindPlan" style="margin-left: 10px" type="primary" @click="addProducts">添加物品</el-button>
       </HeaderTitle>
-      <el-table
-        ref="table"
-        :data="productList"
-        :height="500"
-        row-key="id"
-        tooltip-effect="dark"
-        border
-      >
+      <el-table ref="table" :data="productList" :height="500" row-key="id" tooltip-effect="dark" border>
         <el-table-column label="序号" type="index" width="50">
         </el-table-column>
-        <el-table-column
-          label="物品编码"
-          prop="categoryCode"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          label="物品名称"
-          prop="categoryName"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          width="150"
-          prop="categoryLevelPath"
-          label="产品分类"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          label="批次号"
-          prop="batchNo"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          label="牌号"
-          prop="brandNum"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          label="型号"
-          prop="categoryModel"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          label="规格"
-          prop="specification"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          label="计量数量"
-          prop="measureQuantity"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          label="计量单位"
-          prop="measureUnit"
-          :show-overflow-tooltip="true"
-        ></el-table-column>
-        <el-table-column
-          label="重量"
-          prop="weight"
-          :show-overflow-tooltip="true"
-        >
+        <el-table-column label="物品编码" prop="categoryCode" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="物品名称" prop="categoryName" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column width="150" prop="categoryLevelPath" label="产品分类"
+          :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="批次号" prop="batchNo" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="牌号" prop="brandNum" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="型号" prop="categoryModel" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="规格" prop="specification" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="计量数量" prop="measureQuantity" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="计量单位" prop="measureUnit" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column label="重量" prop="weight" :show-overflow-tooltip="true">
         </el-table-column>
-        <el-table-column
-          label="重量单位"
-          prop="weightUnit"
-          :show-overflow-tooltip="true"
-        >
+        <el-table-column label="重量单位" prop="weightUnit" :show-overflow-tooltip="true">
         </el-table-column>
         <el-table-column v-if="!isBindPlan" label="操作" width="100">
           <template slot-scope="{ row, $index }">
-            <el-button @click="deleted(row, $index)" type="text" size="small"
-              >删除</el-button
-            >
+            <el-button @click="deleted(row, $index)" type="text" size="small">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -293,395 +134,385 @@
       <el-button type="primary" size="small" @click="submit">提交</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
     </div>
-    <div v-else slot="footer">
-      <el-button type="primary" size="small" @click="dialogVisible = false"
-        >确定</el-button
-      >
-      <el-button size="small" @click="dialogVisible = false">关闭</el-button>
-    </div>
-    <selectType
-      :visibleDialog.sync="visibleDialog"
-      :treeIds="productType"
-      :dimension="dimension"
-      :warehouseId="addForm.warehouseId"
-      :selectionIds="selectionIds"
-      :loadTree.sync="loadTree"
-      @selectTableData="addGoods"
-    />
+    <selectType :visibleDialog.sync="visibleDialog" :treeIds="productType" :dimension="dimension"
+      :warehouseId="addForm.warehouseId" :selectionIds="selectionIds" :loadTree.sync="loadTree"
+      @selectTableData="addGoods" />
   </el-dialog>
 </template>
 
 <script>
-  import modalTitle from '@/components/modalTitle.vue';
-  import { getTreeByGroup } from '@/api/classifyManage';
-  import selectType from './selectType.vue';
-  import { getCode } from '@/api/codeManagement';
-  import {
-    getInventoryPlanDetailById,
-    saveInventoryPlan,
-    updateInventoryPlan
-  } from '@/api/inventory';
-  import {
-    getRule,
-    getWarehouseList,
-    getCategoryLevelIdByWarehouseId
-  } from '@/api/ruleManagement/plan';
-  import { getUserPage } from '@/api/system/organization';
-  import deptSelect from '@/components/CommomSelect/new-dept-select.vue';
-  export default {
-    props: {
-      dialogTile: {
-        type: String,
-        default: '新增临时盘点计划'
+import modalTitle from '@/components/modalTitle.vue';
+import { getTreeByGroup } from '@/api/classifyManage';
+import selectType from './selectType.vue';
+import { getCode } from '@/api/codeManagement';
+import {
+  getInventoryPlanDetailById,
+  saveInventoryPlan,
+  updateInventoryPlan
+} from '@/api/inventory';
+import {
+  getRule,
+  getWarehouseList,
+  getCategoryLevelIdByWarehouseId
+} from '@/api/ruleManagement/plan';
+import { getUserPage } from '@/api/system/organization';
+import deptSelect from '@/components/CommomSelect/new-dept-select.vue';
+export default {
+  props: {
+    dialogTile: {
+      type: String,
+      default: '新增临时盘点计划'
+    },
+    isBindPlan: {
+      type: Boolean,
+      default: function () {
+        return false;
+      }
+    },
+    id: {
+      type: String,
+      default: ''
+    }
+  },
+  components: {
+    deptSelect,
+    selectType,
+    modalTitle
+  },
+  data() {
+    return {
+      fullscreen: false,
+      visibleDialog: false,
+      type: 2, // 盘点类型 2仓储 4资产
+      dimension: 1, // 盘点维度1物品 2批次
+      factoryOptions: [],
+      workshopOptions: [],
+      productionLineOptions: [],
+      stationOptions: [],
+      codeList: [],
+      addDialogLoading: false,
+      dialogVisible: false,
+      wh_checkStatus: [], // 盘点类型
+      warehouseList: [], // 盘点仓库
+      uerList: [], // 审核人
+      executorList: [], // 执行人
+      assetsType: null,
+      planRuleInventoryDetailList: [],
+      tableList: [],
+      newColumns: [],
+      selection: [],
+      keyWord: '',
+      total: 0,
+      page: 1,
+      size: 10,
+      loadTree: true,
+      productList: [],
+      productType: [],
+      addForm: {
+        ruleId: '', // 规则名称
+        ruleName: '', // 规则名称
+        code: '', // 计划配置单号
+        name: '', // 计划配置名称
+        executeGroupId: '', // 执行部门code
+        executeGroupName: '', // 执行部门name
+        executorId: '', // 执行人id
+        executorName: '', // 执行人name
+        lockWarehouse: 1, // 是否锁库盘点
+        urgent: '1', // 紧急程度
+        warehouseId: '', // 盘点仓库Id
+        autoOrder: 1, // 是否自动派单
+        remark: '', // 备注
+        approvalUserId: '', // 审核人Id
+        approvalUserName: '', // 审核人name
+        executorDuration: 0 // 盘点时长
       },
-      isBindPlan: {
-        type: Boolean,
-        default: function () {
-          return false;
-        }
+      rules: {
+        code: [
+          { required: true, message: '请输入计划配置单号', trigger: 'blur' }
+        ],
+        name: [
+          { required: true, message: '请输入计划配置名称', trigger: 'blur' }
+        ],
+        autoOrder: [
+          { required: true, message: '请选择是否自动派单', trigger: 'change' }
+        ],
+        ruleId: [
+          { required: true, message: '请选择规则名称', trigger: 'change' }
+        ],
+        executorDuration: [
+          { required: true, message: '请输入计划完成时长', trigger: 'blur' }
+        ],
+        warehouseId: [
+          { required: true, message: '请选择盘点仓库', trigger: 'change' }
+        ],
+        executeGroupId: [
+          { required: true, message: '请选择选择执行部门', trigger: 'change' }
+        ],
+        executorId: [
+          { required: true, message: '请选择选择执行人员', trigger: 'change' }
+        ]
       },
-      id: {
-        type: String,
-        default: ''
+      ruleNameList: []
+    };
+  },
+  watch: {
+    dialogVisible(val) {
+      if (val) {
+        // 获取审核人列表数据
+        this.getUserList();
+        // 获取盘点仓库
+        this._getWarehouse();
+        // 获取计划单号
+        this.getOrderCode();
+        // 获取规则名称
+        this._getRuleNameList();
+        // 获取物品类型
+        this.getGoodsList();
+        if (
+          this.dialogTile === '修改临时盘点计划' ||
+          this.dialogTile === '临时盘点计划详情'
+        ) {
+          getInventoryPlanDetailById(this.id).then(async (res) => {
+            res.urgent = String(res.urgent);
+            this.addForm = res;
+            this.dimension = res.planDetailVOS[0].batchNo ? 2 : 1;
+            if (this.addForm.executeGroupId) {
+              this.getUserList({ groupId: this.addForm.executeGroupId });
+            }
+            this.productList = res.planDetailVOS.map((item) => item.info);
+            getCategoryLevelIdByWarehouseId({
+              warehouseId: this.addForm.warehouseId
+            }).then((data) => {
+              console.log(data);
+              this.productType = Array.from(new Set(data));
+            });
+          });
+        } else {
+          this.productList = [];
+          this.addForm = {
+            ruleId: '', // 规则名称
+            ruleName: '', // 规则名称
+            code: '', // 计划配置单号
+            executeGroupId: '', // 执行部门code
+            executeGroupName: '', // 执行部门name
+            executorId: '', // 执行人id
+            executorName: '', // 执行人name
+            lockWarehouse: 1, // 是否锁库盘点
+            urgent: '1', // 紧急程度
+            warehouseId: '', // 盘点仓库Id
+            autoOrder: 1, // 是否自动派单
+            remark: '', // 备注
+            approvalUserId: '', // 审核人Id
+            approvalUserName: '', // 审核人name
+            executorDuration: 0 // 盘点时长
+          };
+        }
       }
+    }
+  },
+  computed: {
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
     },
-    components: {
-      deptSelect,
-      selectType,
-      modalTitle
+    selectionIds() {
+      return this.productList.map((item) => item.categoryId);
+    }
+  },
+  methods: {
+    // 添加物品明细
+    async addGoods(data) {
+      console.log(data);
+      let productList = data.map((item) => {
+        return {
+          ...item
+        };
+      });
+      this.productList = this.productList.concat(productList);
     },
-    data() {
-      return {
-        fullscreen: false,
-        visibleDialog: false,
-        type: 2, // 盘点类型 2仓储 4资产
-        dimension: 1, // 盘点维度1物品 2批次
-        factoryOptions: [],
-        workshopOptions: [],
-        productionLineOptions: [],
-        stationOptions: [],
-        codeList: [],
-        addDialogLoading: false,
-        dialogVisible: false,
-        wh_checkStatus: [], // 盘点类型
-        warehouseList: [], // 盘点仓库
-        uerList: [], // 审核人
-        executorList: [], // 执行人
-        assetsType: null,
-        planRuleInventoryDetailList: [],
-        tableList: [],
-        newColumns: [],
-        selection: [],
-        keyWord: '',
-        total: 0,
-        page: 1,
-        size: 10,
-        loadTree: true,
-        productList: [],
-        productType: [],
-        addForm: {
-          ruleId: '', // 规则名称
-          ruleName: '', // 规则名称
-          code: '', // 计划配置单号
-          name: '', // 计划配置名称
-          executeGroupId: '', // 执行部门code
-          executeGroupName: '', // 执行部门name
-          executorId: '', // 执行人id
-          executorName: '', // 执行人name
-          lockWarehouse: 1, // 是否锁库盘点
-          urgent: '1', // 紧急程度
-          warehouseId: '', // 盘点仓库Id
-          autoOrder: 1, // 是否自动派单
-          remark: '', // 备注
-          approvalUserId: '', // 审核人Id
-          approvalUserName: '', // 审核人name
-          executorDuration: 0 // 盘点时长
-        },
-        rules: {
-          code: [
-            { required: true, message: '请输入计划配置单号', trigger: 'blur' }
-          ],
-          name: [
-            { required: true, message: '请输入计划配置名称', trigger: 'blur' }
-          ],
-          autoOrder: [
-            { required: true, message: '请选择是否自动派单', trigger: 'change' }
-          ],
-          ruleId: [
-            { required: true, message: '请选择规则名称', trigger: 'change' }
-          ],
-          executorDuration: [
-            { required: true, message: '请输入计划完成时长', trigger: 'blur' }
-          ],
-          warehouseId: [
-            { required: true, message: '请选择盘点仓库', trigger: 'change' }
-          ],
-          executeGroupId: [
-            { required: true, message: '请选择选择执行部门', trigger: 'change' }
-          ],
-          executorId: [
-            { required: true, message: '请选择选择执行人员', trigger: 'change' }
-          ]
-        },
-        ruleNameList: []
-      };
+    addProducts() {
+      if (this.addForm.warehouseId) {
+        console.log(this.addForm.warehouseId);
+        this.visibleDialog = true;
+      } else {
+        this.$message.warning('请选择盘点仓库');
+      }
     },
-    watch: {
-      dialogVisible(val) {
-        if (val) {
-          // 获取审核人列表数据
-          this.getUserList();
-          // 获取盘点仓库
-          this._getWarehouse();
-          // 获取计划单号
-          this.getOrderCode();
-          // 获取规则名称
-          this._getRuleNameList();
-          // 获取物品类型
-          this.getGoodsList();
-          if (
-            this.dialogTile === '修改临时盘点计划' ||
-            this.dialogTile === '临时盘点计划详情'
-          ) {
-            getInventoryPlanDetailById(this.id).then(async (res) => {
-              res.urgent = String(res.urgent);
-              this.addForm = res;
-              this.dimension = res.planDetailVOS[0].batchNo ? 2 : 1;
-              if (this.addForm.executeGroupId) {
-                this.getUserList({ groupId: this.addForm.executeGroupId });
-              }
-              this.productList = res.planDetailVOS.map((item) => item.info);
-              getCategoryLevelIdByWarehouseId({
-                warehouseId: this.addForm.warehouseId
-              }).then((data) => {
-                console.log(data);
-                this.productType = Array.from(new Set(data));
-              });
-            });
-          } else {
-            this.productList = [];
-            this.addForm = {
-              ruleId: '', // 规则名称
-              ruleName: '', // 规则名称
-              code: '', // 计划配置单号
-              executeGroupId: '', // 执行部门code
-              executeGroupName: '', // 执行部门name
-              executorId: '', // 执行人id
-              executorName: '', // 执行人name
-              lockWarehouse: 1, // 是否锁库盘点
-              urgent: '1', // 紧急程度
-              warehouseId: '', // 盘点仓库Id
-              autoOrder: 1, // 是否自动派单
-              remark: '', // 备注
-              approvalUserId: '', // 审核人Id
-              approvalUserName: '', // 审核人name
-              executorDuration: 0 // 盘点时长
-            };
-          }
-        }
+    deleted(row, index) {
+      this.productList.splice(index, 1);
+    },
+    selecctedRow(val) {
+      this.selection = val;
+    },
+    dimensionChange() {
+      this.productList = [];
+    },
+    checkSelectable(row) {
+      return true;
+    },
+    // 改变规则名称
+    change_ruleId(val) {
+      this.addForm.ruleName = this.ruleNameList.filter(
+        (item) => item.id === val
+      )[0].name;
+    },
+    // 获取物品类型列表
+    async getGoodsList() {
+      const { data } = await getTreeByGroup({ type: this.type });
+      console.log('data------', data);
+      this.codeList = data;
+    },
+    // 获取规则名列表
+    async _getRuleNameList() {
+      const res = await getRule({ status: 1, type: 4, pageNum: 1, size: -1 });
+      if (res.list) {
+        this.ruleNameList = res.list || [];
       }
     },
-    computed: {
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      },
-      selectionIds() {
-        return this.productList.map((item) => item.categoryId);
+    // 获取计划配置单号
+    async getOrderCode(tips) {
+      const code = await getCode('inventoryconfig_code');
+      this.$set(this.addForm, 'code', code);
+    },
+    // 执行人选择
+    changeExecutor(val) {
+      if (val) {
+        this.addForm.executorId = val;
+        this.addForm.executorName = this.executorList.filter(
+          (item) => item.id === val
+        )[0].name;
       }
     },
-    methods: {
-      // 添加物品明细
-      async addGoods(data) {
-        console.log(data);
-        let productList = data.map((item) => {
-          return {
-            ...item
-          };
-        });
-        this.productList = this.productList.concat(productList);
-      },
-      addProducts() {
-        if (this.addForm.warehouseId) {
-          console.log(this.addForm.warehouseId);
-          this.visibleDialog = true;
-        } else {
-          this.$message.warning('请选择盘点仓库');
-        }
-      },
-      deleted(row, index) {
-        this.productList.splice(index, 1);
-      },
-      selecctedRow(val) {
-        this.selection = val;
-      },
-      dimensionChange() {
-        this.productList = [];
-      },
-      checkSelectable(row) {
-        return true;
-      },
-      // 改变规则名称
-      change_ruleId(val) {
-        this.addForm.ruleName = this.ruleNameList.filter(
+    // 仓库选择
+    changeWarehouse(val) {
+      if (val) {
+        this.addForm.warehouseId = val;
+        this.addForm.warehouseName = this.warehouseList.filter(
           (item) => item.id === val
         )[0].name;
-      },
-      // 获取物品类型列表
-      async getGoodsList() {
-        const { data } = await getTreeByGroup({ type: this.type });
-        console.log('data------', data);
-        this.codeList = data;
-      },
-      // 获取规则名列表
-      async _getRuleNameList() {
-        const res = await getRule({ status: 1, type: 4, pageNum: 1, size: -1 });
-        if (res.list) {
-          this.ruleNameList = res.list || [];
-        }
-      },
-      // 获取计划配置单号
-      async getOrderCode(tips) {
-        const code = await getCode('inventoryconfig_code');
-        this.$set(this.addForm, 'code', code);
-      },
-      // 执行人选择
-      changeExecutor(val) {
-        if (val) {
-          this.addForm.executorId = val;
-          this.addForm.executorName = this.executorList.filter(
-            (item) => item.id === val
-          )[0].name;
-        }
-      },
-      // 仓库选择
-      changeWarehouse(val) {
-        if (val) {
-          this.addForm.warehouseId = val;
-          this.addForm.warehouseName = this.warehouseList.filter(
-            (item) => item.id === val
-          )[0].name;
-          this.productList = [];
-          getCategoryLevelIdByWarehouseId({ warehouseId: val }).then((data) => {
-            console.log(data);
-            this.productType = Array.from(new Set(data));
-          });
-        }
-      },
-      // 关闭弹窗
-      handleClose() {
-        this.dialogVisible = false;
-        this.$refs.addFormRef.resetFields();
-        this.addForm.assetsName = '';
-        this.assetsType = null;
-        this.addForm = {
-          ruleId: '', // 规则名称
-          ruleName: '', // 规则名称
-          code: '', // 计划配置单号
-          executeGroupId: '', // 执行部门code
-          executeGroupName: '', // 执行部门name
-          executorId: '', // 执行人id
-          executorName: '', // 执行人name
-          lockWarehouse: 1, // 是否锁库盘点
-          urgent: '1', // 紧急程度
-          warehouseId: '', // 盘点仓库Id
-          autoOrder: 1, // 是否自动派单
-          remark: '', // 备注
-          approvalUserId: '', // 审核人Id
-          approvalUserName: '', // 审核人name
-          executorDuration: 0 // 盘点时长
-        };
-      },
-
-      // 封装 - 获取盘点仓库
-      async _getWarehouse() {
-        const res = await getWarehouseList({});
-        console.log(res);
-        this.warehouseList = res.map((item) => {
-          return { ...item, name: item.factoryName + '-' + item.name };
+        this.productList = [];
+        getCategoryLevelIdByWarehouseId({ warehouseId: val }).then((data) => {
+          console.log(data);
+          this.productType = Array.from(new Set(data));
         });
-      },
+      }
+    },
+    // 关闭弹窗
+    handleClose() {
+      this.dialogVisible = false;
+      this.$refs.addFormRef.resetFields();
+      this.addForm.assetsName = '';
+      this.assetsType = null;
+      this.addForm = {
+        ruleId: '', // 规则名称
+        ruleName: '', // 规则名称
+        code: '', // 计划配置单号
+        executeGroupId: '', // 执行部门code
+        executeGroupName: '', // 执行部门name
+        executorId: '', // 执行人id
+        executorName: '', // 执行人name
+        lockWarehouse: 1, // 是否锁库盘点
+        urgent: '1', // 紧急程度
+        warehouseId: '', // 盘点仓库Id
+        autoOrder: 1, // 是否自动派单
+        remark: '', // 备注
+        approvalUserId: '', // 审核人Id
+        approvalUserName: '', // 审核人name
+        executorDuration: 0 // 盘点时长
+      };
+    },
+
+    // 封装 - 获取盘点仓库
+    async _getWarehouse() {
+      const res = await getWarehouseList({});
+      console.log(res);
+      this.warehouseList = res.map((item) => {
+        return { ...item, name: item.factoryName + '-' + item.name };
+      });
+    },
 
-      //选择部门(搜索)
-      searchDeptNodeClick(info, row) {
-        console.log(info);
-        console.log(row);
-        if (info) {
-          const params = { groupId: info };
-          this.getUserList(params);
-          this.addForm.executeGroupName = row.name;
+    //选择部门(搜索)
+    searchDeptNodeClick(info, row) {
+      console.log(info);
+      console.log(row);
+      if (info) {
+        const params = { groupId: info };
+        this.getUserList(params);
+        this.addForm.executeGroupName = row.name;
+      } else {
+        this.addForm.executeGroupId = null;
+      }
+    },
+
+    // 获取审核人列表、巡点检人员
+    async getUserList(params) {
+      try {
+        let data = { pageNum: 1, size: -1 };
+        // 如果传了参数就是获取巡点检人员数据
+        if (params) {
+          data = Object.assign(data, params);
+        }
+        const res = await getUserPage(data);
+        if (params) {
+          this.executorList = res.list;
         } else {
-          this.addForm.executeGroupId = null;
+          this.uerList = res.list;
         }
-      },
-
-      // 获取审核人列表、巡点检人员
-      async getUserList(params) {
-        try {
-          let data = { pageNum: 1, size: -1 };
-          // 如果传了参数就是获取巡点检人员数据
-          if (params) {
-            data = Object.assign(data, params);
-          }
-          const res = await getUserPage(data);
-          if (params) {
-            this.executorList = res.list;
-          } else {
-            this.uerList = res.list;
-          }
-        } catch (error) {}
-      },
-      submit() {
-        console.log(this.addForm);
-        this.$refs.addFormRef.validate(async (valid) => {
-          let res = null;
-          if (valid) {
-            let params = {
-              ...this.addForm,
-              planDetailAddPOList: this.productList.map((item) => {
-                return {
-                  batchNo: item.batchNo,
-                  categoryId: item.categoryId,
-                  categoryName: item.categoryName,
-                  info: item
-                };
-              })
-            };
-            if (this.productList?.length > 0) {
-              if (this.dialogTile === '修改临时盘点计划') {
-                res = await updateInventoryPlan(params);
-              } else {
-                res = await saveInventoryPlan(params);
-              }
+      } catch (error) { }
+    },
+    submit() {
+      console.log(this.addForm);
+      this.$refs.addFormRef.validate(async (valid) => {
+        let res = null;
+        if (valid) {
+          let params = {
+            ...this.addForm,
+            planDetailAddPOList: this.productList.map((item) => {
+              return {
+                batchNo: item.batchNo,
+                categoryId: item.categoryId,
+                categoryName: item.categoryName,
+                info: item
+              };
+            })
+          };
+          if (this.productList?.length > 0) {
+            if (this.dialogTile === '修改临时盘点计划') {
+              res = await updateInventoryPlan(params);
             } else {
-              return this.$message.error('请选择需要盘点物品');
+              res = await saveInventoryPlan(params);
             }
+          } else {
+            return this.$message.error('请选择需要盘点物品');
+          }
 
-            if (res.code == 0) {
-              this.handleClose();
-              this.$message.success(res.message);
-              this.$emit('refreshList');
-            }
+          if (res.code == 0) {
+            this.handleClose();
+            this.$message.success(res.message);
+            this.$emit('refreshList');
           }
-        });
-      },
-      handleChangeassetDict(data) {
-        console.log(data);
-      }
+        }
+      });
+    },
+    handleChangeassetDict(data) {
+      console.log(data);
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  ::v-deep .el-row {
-    display: flex;
-    flex-wrap: wrap;
-  }
-  .add_form {
-    ::v-deep .el-form-item {
-      margin-bottom: 20px !important;
-    }
-  }
-  .table_search {
-    margin-bottom: 5px;
+::v-deep .el-row {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.add_form {
+  ::v-deep .el-form-item {
+    margin-bottom: 20px !important;
   }
+}
+
+.table_search {
+  margin-bottom: 5px;
+}
 </style>

+ 205 - 236
src/views/stocktaking/plan/index.vue

@@ -3,22 +3,10 @@
     <el-card shadow="never" v-loading="loading">
       <plan-search ref="inventorySearch" @search="reload"> </plan-search>
       <!-- 数据表格 -->
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        height="calc(100vh-300px)"
-        :pageSize="20"
-        :datasource="datasource"
-      >
+      <ele-pro-table ref="table" :columns="columns" height="calc(100vh-300px)" :pageSize="20" :datasource="datasource">
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="openEdit()"
-          >
+          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit()">
             新建临时计划
           </el-button>
         </template>
@@ -28,256 +16,237 @@
           </el-link>
         </template>
         <template v-slot:action="{ row }">
-          <el-link
-            v-if="row.planStatus == 0"
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="assign(row)"
-          >
+          <el-link v-if="row.planStatus == 0" type="primary" :underline="false" icon="el-icon-edit"
+            @click="assign(row)">
             派单
           </el-link>
-          <el-link
-            v-if="row.planStatus == 0"
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="openEdit(row)"
-          >
+          <el-link v-if="row.planStatus == 0" type="primary" :underline="false" icon="el-icon-edit"
+            @click="openEdit(row)">
             修改
           </el-link>
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="revocationRow(row)"
-          >
+          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="revocationRow(row)">
             撤回
           </el-link>
         </template>
       </ele-pro-table>
     </el-card>
     <!-- 新建或编辑弹窗 -->
-    <AddInventoryDialog
-      ref="addInventoryDialogRef"
-      :dialogTile="dialogTitle"
-      :id="inventoryId"
-      @refreshList="resetForm"
-      :isBindPlan="isBindPlan"
-    />
+    <AddInventoryDialog ref="addInventoryDialogRef" :dialogTile="dialogTitle" :id="inventoryId" @refreshList="resetForm"
+      :isBindPlan="isBindPlan" />
     <!-- 派单 -->
-    <AssignDialog
-      :visibleDialog.sync="visibleDialog"
-      :planId="planId"
-      @flushed="reload"
-    ></AssignDialog>
+    <AssignDialog :visibleDialog.sync="visibleDialog" :planId="planId" @flushed="reload"></AssignDialog>
   </div>
 </template>
 
 <script>
-  import PlanSearch from './components/plan-search.vue';
-  import AddInventoryDialog from './components/addInventoryDialog.vue';
-  import AssignDialog from './components/assignDialog.vue';
-  import {
-    getInventoryPlanList,
-    revocationInventoryPlan
-  } from '@/api/inventory';
-  export default {
-    components: {
-      PlanSearch,
-      AddInventoryDialog,
-      AssignDialog
-    },
-    data() {
-      return {
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            slot: 'code',
-            prop: 'code',
-            label: '计划单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'name',
-            label: '计划名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            slot: 'enable',
-            minWidth: 110
-          },
-          {
-            prop: 'warehouseName',
-            label: '盘点仓库',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'ruleName',
-            label: '计划规则',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'planStatus',
-            label: '状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110,
-            formatter: (row, column) => {
-              return this.statusList.filter(
-                (item) => item.value == row.planStatus
-              )[0].label;
-            }
-          },
-          {
-            prop: 'createName',
-            label: '创建人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'createTime',
-            label: '生成时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 250,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
+import PlanSearch from './components/plan-search.vue';
+import AddInventoryDialog from './components/addInventoryDialog.vue';
+import AssignDialog from './components/assignDialog.vue';
+import {
+  getInventoryPlanList,
+  revocationInventoryPlan
+} from '@/api/inventory';
+export default {
+  components: {
+    PlanSearch,
+    AddInventoryDialog,
+    AssignDialog
+  },
+  data() {
+    return {
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          slot: 'code',
+          prop: 'code',
+          label: '计划单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'name',
+          label: '计划名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          slot: 'enable',
+          minWidth: 110
+        },
+        {
+          prop: 'warehouseName',
+          label: '盘点仓库',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'ruleName',
+          label: '计划规则',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'planStatus',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110,
+          formatter: (row, column) => {
+            return this.statusList.filter(
+              (item) => item.value == row.planStatus
+            )[0].label;
           }
-        ],
-        // 加载状态
-        loading: false,
-        dialogTitle: '',
-        isBindPlan: false,
-        inventoryId: '',
-        planId: '',
-        // 0未派单;1已派单;2已完成;3已撤回;
-        statusList: [
-          { label: '未派单', value: 0 },
-          { label: '已派单', value: 1 },
-          { label: '已完成', value: 2 },
-          { label: '已撤回', value: 3 }
-        ],
-        visibleDialog: false
-      };
-    },
-    methods: {
-      assign(row) {
-        this.planId = row.id;
-        this.visibleDialog = true;
-      },
-      // 重置
-      resetForm() {
-        this.$refs.inventorySearch.reset();
-      },
-      /* 表格数据源 */
-      async datasource({ page, limit, where, order }) {
-        return await getInventoryPlanList({
-          pageNum: page,
-          size: limit,
-          ...where
-        });
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where });
-      },
-      openEdit(row) {
-        if (row) {
-          this.dialogTitle = '修改临时盘点计划';
-          this.inventoryId = row.id;
-        } else {
-          this.dialogTitle = '新增临时盘点计划';
-          this.inventoryId = '';
+        },
+        {
+          prop: 'createUserName',
+          label: '创建人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'createTime',
+          label: '生成时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 250,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
         }
-        this.isBindPlan = false;
-        this.$refs.addInventoryDialogRef.dialogVisible = true;
-      },
-      // goDetail(row) {
-      //   this.dialogTitle = '临时盘点计划详情';
-      //   this.inventoryId = row.id;
-      //   this.isBindPlan = true;
-      //   this.$refs.addInventoryDialogRef.dialogVisible = true;
-      // },
-      goDetail(row) {
-        this.$router.push({
-          path: '/warehouseManagement/stocktaking/plan/details',
-          query: {
-            id: row.id
-          }
-        });
-      },
-      // 撤回
-      revocationRow(row) {
-        this.$confirm('是否确定撤回?', '提示', {
-          type: 'warning'
-        })
-          .then(() => {
-            revocationInventoryPlan({ id: row.id }).then((data) => {
-              console.log(data);
-              this.$message.success('撤回成功!');
-              this.reload();
-            });
-          })
-          .catch(() => {});
+      ],
+      // 加载状态
+      loading: false,
+      dialogTitle: '',
+      isBindPlan: false,
+      inventoryId: '',
+      planId: '',
+      // 0未派单;1已派单;2已完成;3已撤回;
+      statusList: [
+        { label: '未派单', value: 0 },
+        { label: '已派单', value: 1 },
+        { label: '已完成', value: 2 },
+        { label: '已撤回', value: 3 }
+      ],
+      visibleDialog: false
+    };
+  },
+  methods: {
+    assign(row) {
+      this.planId = row.id;
+      this.visibleDialog = true;
+    },
+    // 重置
+    resetForm() {
+      this.$refs.inventorySearch.reset();
+    },
+    /* 表格数据源 */
+    async datasource({ page, limit, where, order }) {
+      return await getInventoryPlanList({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where });
+    },
+    openEdit(row) {
+      if (row) {
+        this.dialogTitle = '修改临时盘点计划';
+        this.inventoryId = row.id;
+      } else {
+        this.dialogTitle = '新增临时盘点计划';
+        this.inventoryId = '';
       }
+      this.isBindPlan = false;
+      this.$refs.addInventoryDialogRef.dialogVisible = true;
+    },
+    goDetail(row) {
+      this.dialogTitle = '临时盘点计划详情';
+      this.inventoryId = row.id;
+      this.isBindPlan = true;
+      this.$refs.addInventoryDialogRef.dialogVisible = true;
+    },
+    // goDetail(row) {
+    //   this.$router.push({
+    //     path: '/warehouseManagement/stocktaking/plan/details',
+    //     query: {
+    //       id: row.id
+    //     }
+    //   });
+    // },
+    // 撤回
+    revocationRow(row) {
+      this.$confirm('是否确定撤回?', '提示', {
+        type: 'warning'
+      })
+        .then(() => {
+          revocationInventoryPlan({ id: row.id }).then((data) => {
+            console.log(data);
+            this.$message.success('撤回成功!');
+            this.reload();
+          });
+        })
+        .catch(() => { });
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  #stocktakingPlan_index {
-    height: calc(100vh - 96px);
-    width: 100%;
-    padding: 10px;
-    box-sizing: border-box;
-    // element-ui样式穿透
-    :deep(.el-card) {
+#stocktakingPlan_index {
+  height: calc(100vh - 96px);
+  width: 100%;
+  padding: 10px;
+  box-sizing: border-box;
+
+  // element-ui样式穿透
+  :deep(.el-card) {
+    height: 100%;
+
+    .el-card__body {
       height: 100%;
-      .el-card__body {
-        height: 100%;
-        box-sizing: border-box;
+      box-sizing: border-box;
+      display: flex;
+      flex-direction: column;
+
+      .ele-pro-table {
+        flex: 1;
         display: flex;
         flex-direction: column;
-        .ele-pro-table {
+
+        .el-table {
           flex: 1;
-          display: flex;
-          flex-direction: column;
-          .el-table {
-            flex: 1;
-            // display: flex;
-            // flex-direction: column;
-            // .el-table__body-wrapper {
-            //   flex: 1;
-            // }
-          }
+          // display: flex;
+          // flex-direction: column;
+          // .el-table__body-wrapper {
+          //   flex: 1;
+          // }
         }
       }
-      .el-form-item {
-        margin-bottom: 5px !important;
-      }
+    }
+
+    .el-form-item {
+      margin-bottom: 5px !important;
     }
   }
+}
 </style>