2213980799@qq.com před 1 rokem
rodič
revize
375f0242b3

+ 45 - 0
src/api/aps/index.js

@@ -14,4 +14,49 @@ export async function getProduceTaskList(params) {
   if (res.data.code == 0) {
     return res.data.data;
   }
+}
+
+/**
+ * 生产计划
+ */
+ export async function getPlanList (data) {
+  const res = await request.post('/aps/productionplan/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 生产订单
+ */
+ export async function workOrder(params) {
+  const res = await request.post('/aps/workorder/page', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 生产工单
+ */
+ export async function produceOrder (params) {
+  const res = await request.post('/mes/workorder/page', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 入库申请
+ */
+export async function warehousing (data) {
+  const res = await request.get('/mes/applystorage/page', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 53 - 0
src/api/inspectionPlan/index.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request';
+
+
+// 列表
+
+export async function getList (data) {
+    const res = await request.post(`/qms/quality_plan/page` , data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+
+// 新增
+export async function save(data) {
+  const res = await request.post(`/qms/quality_plan/save`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 编辑
+export async function update(data) {
+  const res = await request.post(`/qms/quality_plan/update`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 下发
+export async function planIssued(data) {
+  const res = await request.post(`/qms/quality_plan/plan_issued`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+
+// 删除
+export async function removeItem(data) {
+  const res = await request.delete('/qms/quality_plan/delete', {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 11 - 0
src/components/CommomSelect/dept-select.vue

@@ -9,6 +9,10 @@
     default-expand-all
     :placeholder="placeholder"
     @input="updateValue"
+    @change="changeChoose"
+    ref="treeSelect"
+    v-bind="$attrs"
+
   />
 </template>
 
@@ -44,6 +48,13 @@
       /* 更新选中数据 */
       updateValue(value) {
         this.$emit('input', value);
+      },
+      changeChoose(val) {
+        this.$emit(
+          'changeGroup',
+          val,
+          this.$refs.treeSelect.getNodeByValue(val)
+        );
       }
     }
   };

+ 3 - 1
src/enum/dict.js

@@ -11,6 +11,7 @@ export default {
   数学字符:'mathematical_symbol',
   质检类型:'inspection_type',
   不良品处理类型:'unqualified_products_type',
+  质检计划类型:'inspection_plan_type',
 
 };
 
@@ -21,5 +22,6 @@ export const numberList = [
   'order_type',
   'quality_testing_code',
   'quality_method_code',
-  'inspection_type'
+  'inspection_type',
+  'inspection_plan_type'
 ];

+ 468 - 0
src/views/inspectionPlan/components/edit.vue

@@ -0,0 +1,468 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <el-dialog
+    class="ele-dialog-form"
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="1200px"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="名称:" prop="name">
+            <el-input
+              clearable
+              v-model="form.name"
+              placeholder="请输入"
+              :disabled="type == 'detail'||type == 'issued'"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="计划类型:" prop="type">
+            <DictSelection
+              dictName="质检计划类型"
+              @change="planChange"
+              v-model="form.type"
+              clearable
+              :disabled="type == 'detail'||type == 'issued'"
+
+            ></DictSelection>
+          </el-form-item>
+        </el-col>
+
+        <!-- <el-col :span="12">
+          <el-form-item label="质检工具:" prop="inspectionTool">
+            <el-input v-model="form.inspectionTool"></el-input>
+          </el-form-item>
+        </el-col> -->
+        <el-col :span="8">
+          <el-form-item label="计划来源:" prop="planSource">
+            <el-select
+              v-model="form.planSource"
+              placeholder="请选择"
+              style="width: 100%"
+              clearable
+              @change="planSourceChange"
+              :disabled="type == 'detail'||type == 'issued'"
+
+            >
+              <el-option
+                :label="item.label"
+                v-for="item in sourceList"
+                :key="item.value"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="计划来源编码:" prop="planSourceCode">
+            <el-input v-model="form.planSourceCode" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="自动派单:" prop="autoOrder">
+            <el-select
+              v-model="form.autoOrder"
+              placeholder="请选择"
+              style="width: 100%"
+              :disabled="type == 'detail'||type == 'issued'"
+
+            >
+              <el-option label="是" :value="1" />
+              <el-option label="否" :value="0" />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="批号:" prop="batchNo">
+            <el-input v-model="form.batchNo" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品名称:" prop="productName">
+            <el-input
+              v-model="form.productName"
+              readonly=""
+              @click.native="addProduct"
+              :disabled="type == 'detail'||type == 'issued'"
+
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品编码:" prop="productCode">
+            <el-input v-model="form.productCode" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品规格:" prop="specification">
+            <el-input v-model="form.specification" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="产品牌号:" prop="brandNo">
+            <el-input v-model="form.brandNo" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="数量:" prop="productNumber">
+            <el-input
+              v-model="form.productNumber"
+              :disabled="type == 'detail'||type == 'issued'"
+
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="执行部门"
+            prop="groupId"
+            :rules="{
+              required: form.autoOrder || type == 'issued' ? true : false,
+              message: '请选择',
+              trigger: 'blur'
+            }"
+          >
+            <deptSelect
+              :disabled="type == 'detail'"
+              v-model="form.groupId"
+              @changeGroup="searchDeptNodeClick"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="执行人员"
+            prop="executeId"
+            :rules="{
+              required: form.autoOrder || type == 'issued' ? true : false,
+              message: '请选择',
+              trigger: 'blur'
+            }"
+          >
+            <el-select
+              :disabled="type == 'detail'"
+              v-model="form.executeId"
+              @change="changeExecutor"
+              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>
+        <el-col :span="8">
+          <el-form-item label="计划开始时间:" prop="planStartTime">
+            <el-date-picker
+              :disabled="type == 'detail'"
+              class="w100"
+              v-model="form.planStartTime"
+              type="date"
+              value-format="yyyy-MM-dd"
+            ></el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="计划结束时间:" prop="planEndTime">
+            <el-date-picker
+              :disabled="type == 'detail'"
+              class="w100"
+              v-model="form.planEndTime"
+              type="date"
+              value-format="yyyy-MM-dd"
+            ></el-date-picker>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <!-- <el-table :data="form.productJson" border height="30vh">
+        <el-table-column label="产品编码" align="center" prop="productCode">
+        </el-table-column>
+        <el-table-column label="产品名称" align="center" prop="productName">
+        </el-table-column>
+
+        <el-table-column label="规格" align="center" prop="specification">
+        </el-table-column>
+        <el-table-column label="牌号" align="center" prop="brandNo">
+        </el-table-column>
+        <el-table-column label="数量" align="center" prop="total">
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="70">
+          <template slot-scope="scope">
+            <el-link
+              type="danger"
+              :underline="false"
+              @click="handleDeleteItem(scope.$index, scope.row.id)"
+            >
+              删除
+            </el-link>
+          </template>
+        </el-table-column>
+      </el-table> -->
+      <!-- <div class="add-product" @click="addProduct">
+        <i class="el-icon-circle-plus-outline"></i>
+      </div> -->
+      <EquipmentDialog ref="equipmentRefs" @choose="choose" />
+      <productionPlan ref="productionPlanRef" @choose="choose" />
+      <workOrder ref="workOrderRef" @choose="choose" />
+      <produceOrder ref="produceOrderRef" @choose="choose" />
+      <warehousing ref="warehousingRef" @choose="choose" />
+    </el-form>
+
+    <template v-slot:footer>
+      <el-button @click="handleClose">取消</el-button>
+      <el-button
+        v-if="type != 'detail' && type != 'issued'"
+        type="primary"
+        :loading="loading"
+        @click="save"
+      >
+        保存
+      </el-button>
+      <el-button
+        v-if="type == 'issued'"
+        type="primary"
+        :loading="loading"
+        @click="save"
+      >
+        下发
+      </el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { save, update, planIssued } from '@/api/inspectionPlan';
+import EquipmentDialog from '../../../views/inspectionWork/components/EquipmentDialog';
+import productionPlan from './productionPlan';
+import workOrder from './workOrder';
+import produceOrder from './produceOrder';
+import warehousing from './warehousing';
+import { getUserPage } from '@/api/system/organization';
+import deptSelect from '@/components/CommomSelect/dept-select.vue';
+export default {
+  components: {
+    EquipmentDialog,
+    deptSelect,
+    productionPlan,
+    workOrder,
+    produceOrder,
+    warehousing
+  },
+  data() {
+    const defaultForm = function () {
+      return {
+        id: '',
+        code: '',
+        planSourceId: '',
+        planSourceCode: '',
+        name: '',
+        autoOrder: 0,
+        duration: '',
+        status: '',
+        approvalUserId: '',
+        executeId: '',
+        groupId: '',
+        groupName: '',
+        planStartTime: '',
+        planEndTime: '',
+        productCode: '',
+        productName: '',
+        specification: '',
+        brandNo: '',
+        executeName: '',
+        productNumber: '',
+        planSource: '',
+        batchNo: ''
+      };
+    };
+    return {
+      defaultForm,
+      // 表单数据
+      form: { ...defaultForm() },
+      sourceList: [],
+      // 表单验证规则
+      rules: {
+        name: [{ required: true, message: '请输入', trigger: 'blur' }],
+        productName: [{ required: true, message: '请选择', trigger: 'blur' }]
+      },
+      visible: false,
+      type: null,
+      title: null,
+      loading: false,
+      listPage: [],
+      executorList: []
+    };
+  },
+  watch: {
+    'form.type'(val) {
+      this.sourceList =
+        val == 1
+          ? [{ label: '入库申请单', value: '1' }]
+          : [
+              { label: '生产计划', value: '2' },
+              { label: '生产订单', value: '3' },
+              { label: '生产工单', value: '4' }
+            ];
+    }
+  },
+  created() {},
+  methods: {
+    open(type, row) {
+      this.title =
+        type == 'add'
+          ? '新增'
+          : type == 'edit'
+          ? '编辑'
+          : type == 'issued'
+          ? '下发'
+          : '详情';
+      this.type = type;
+      if (this.type != 'add') {
+        this.form = JSON.parse(JSON.stringify(row));
+        this.getUserList({ groupId: this.form.groupId });
+      }
+      this.visible = true;
+    },
+    planChange(value) {
+      this.form.planSource = '';
+      this.choose({});
+    },
+
+    planSourceChange() {
+      this.choose({});
+    },
+    addProduct() {
+      if (this.form.planSource == 1) {
+        this.$refs.warehousingRef.open();
+      } else if (this.form.planSource == 2) {
+        this.$refs.productionPlanRef.open();
+      } else if (this.form.planSource == 3) {
+        this.$refs.workOrderRef.open();
+      } else if (this.form.planSource == 4) {
+        this.$refs.produceOrderRef.open();
+      } else {
+        this.$refs.equipmentRefs.open();
+      }
+    },
+    /* 保存编辑 */
+    save() {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return false;
+        }
+        this.loading = true;
+        if (this.type == 'add') {
+          delete this.form.id;
+        }
+        console.log(this.type)
+        let URL = this.type == 'add' ? save : this.type =='edit' ? update : planIssued;
+        URL(this.form)
+          .then((msg) => {
+            this.loading = false;
+            this.$message.success(msg);
+            this.handleClose();
+            this.$emit('done');
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      });
+    },
+    choose(data) {
+      console.log(data);
+      this.form.planSourceId = data.id;
+      this.form.planSourceCode = data.code;
+      this.form.productCode = data.productCode || data[0]?.code;
+      this.form.productName = data.productName || data[0]?.name;
+      this.form.specification = data.model || data[0]?.specification;
+      this.form.brandNo = data.brandNo || data[0]?.brandNum;
+      this.form.batchNo = data.batchNo;
+      this.form.productNumber = data.productNumber;
+    },
+
+    //选择部门(搜索)
+    searchDeptNodeClick(info, row) {
+      if (info) {
+        const params = { groupId: info };
+        this.getUserList(params);
+        this.form.groupName = row.name;
+      } else {
+        this.form.executeGroupId = null;
+      }
+    },
+    // 获取审核人列表、巡点检人员
+    async getUserList(params) {
+      try {
+        let data = { pageNum: 1, size: -1 };
+        // 如果传了参数就是获取巡点检人员数据
+        if (params) {
+          data = Object.assign(data, params);
+        }
+        const res = await getUserPage(data);
+        this.executorList = res.list;
+      } catch (error) {}
+    },
+    // 执行人选择
+    changeExecutor(val) {
+      if (val) {
+        this.form.executeId = val;
+        this.form.executeName = this.executorList.filter(
+          (item) => item.id === val
+        )[0].name;
+      }
+    },
+    restForm() {
+      this.form = { ...this.defaultForm() };
+      this.$nextTick(() => {
+        this.$refs.form.clearValidate();
+      });
+    },
+    handleClose() {
+      this.restForm();
+      this.visible = false;
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.location-warp {
+  display: flex;
+
+  .detail {
+    margin-left: 10px;
+  }
+}
+:deep(.el-form-item__content .el-input-group__prepend) {
+  background-color: #fff;
+}
+:deep(
+    .el-dialog:not(.ele-dialog-form)
+      .el-dialog__body
+      .el-form
+      .el-form-item:last-child
+  ) {
+  margin-bottom: 22px;
+}
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
+</style>

+ 267 - 0
src/views/inspectionPlan/components/produceOrder.vue

@@ -0,0 +1,267 @@
+<template>
+  <el-dialog
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    title="生产工单"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="table_col" v-if="equipmentdialog">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            :current.sync="current"
+            highlight-current-row
+            row-key="id"
+            height="50vh"
+            @done="onDone"
+          >
+          </ele-pro-table>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { produceOrder } from '@/api/aps/index.js';
+
+export default {
+  components: {},
+  props: {
+    selectList: Array,
+    type: {
+      default: 2 //1多选 2单选
+    }
+  },
+  data() {
+    return {
+      planType: [
+        { label: '所有计划类型', value: null },
+        { label: '内销计划', value: '1' },
+        { label: '外销计划', value: '2' },
+        { label: '预制计划', value: '3' }
+      ],
+      equipmentdialog: false,
+      current: null,
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true,
+          show: this.type == 1
+        },
+        {
+          label: '生产工单号',
+          align: 'center',
+          prop: 'code',
+
+          minWidth: 110
+        },
+
+        {
+          prop: 'productionPlanCode',
+          label: '计划编号',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'planType',
+          label: '计划类型',
+          align: 'center',
+          formatter: (row) => {
+            const obj = this.planType.find((i) => i.value == row.planType);
+            return obj && obj.label;
+          }
+        },
+        {
+          prop: 'produceRoutingName',
+          label: '工艺路线',
+          align: 'center'
+        },
+        {
+          prop: 'productCode',
+          label: '产品编号',
+          align: 'center'
+        },
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center'
+        },
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center'
+        },
+        {
+          prop: 'model',
+          label: '型号',
+          align: 'center'
+        },
+        {
+          prop: 'batchNo',
+          label: '批号',
+          align: 'center',
+          minWidth: 100,
+          showOverflowTooltip: true
+        },
+
+        {
+          prop: 'priority',
+          label: '优先级',
+          align: 'center',
+          minWidth: 120,
+          sortable: 'custom'
+        },
+
+        {
+          prop: 'formingNum',
+          label: '要求生产数量',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'formingWeight',
+          label: '要求生产重量',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'formedNum',
+          label: '已生产数量',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'formedWeight',
+          label: '已生产重量',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'planStartTime',
+          label: '计划开始时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'planCompleteTime',
+          label: '计划结束时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'startTime',
+          label: '实际开始时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          prop: 'teamName',
+          label: '班组',
+          align: 'center',
+          showOverflowTooltip: true
+        }
+      ],
+      categoryLevelId: null,
+      code: null,
+      selection: [],
+      ids: []
+    };
+  },
+
+  watch: {},
+  methods: {
+    datasource({ page, where, limit }) {
+      return produceOrder({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    open(ids) {
+      this.equipmentdialog = true;
+    },
+    onDone() {
+      this.$nextTick(() => {
+        this.$refs.equiTable.setSelectedRowKeys(this.ids);
+      });
+    },
+    handleClose() {
+      this.equipmentdialog = false;
+      this.$refs.equiTable.clearSelection();
+    },
+    // 选择
+    selected() {
+      let data =
+        this.type == 1
+          ? JSON.parse(JSON.stringify(this.selection))
+          : JSON.parse(JSON.stringify(this.current));
+      data['productNumber']=data.formingNum
+      this.$emit('choose', data);
+      this.handleClose();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  max-height: 530px;
+  overflow: auto;
+}
+.table_col {
+  padding-left: 10px;
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
+}
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.topsearch {
+  margin-bottom: 15px;
+}
+</style>

+ 249 - 0
src/views/inspectionPlan/components/productionPlan.vue

@@ -0,0 +1,249 @@
+<template>
+  <el-dialog
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    title="生产计划"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="table_col" v-if="equipmentdialog">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            :current.sync="current"
+            highlight-current-row
+            
+            row-key="id"
+            height="50vh"
+            @done="onDone"
+          >
+          </ele-pro-table>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getPlanList} from '@/api/aps/index.js';
+
+
+export default {
+  components: {},
+  props: {
+    selectList: Array,
+    type: {
+      default: 2//1多选 2单选
+    }
+  },
+  data() {
+    return {
+      equipmentdialog: false,
+      current: null,
+      planType: [
+        { label: '所有计划类型', value: null },
+        { label: '内销计划', value: '1' },
+        { label: '外销计划', value: '2' },
+        { label: '预制计划', value: '3' }
+      ],
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true,
+          show:this.type==1
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '计划编号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 180
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'batchNo',
+          label: '批号',
+          align: 'center',
+          minWidth: 100,
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'model',
+          label: '型号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+
+        {
+          prop: 'priority',
+          label: '优先级',
+          align: 'center',
+          minWidth: 120,
+          sortable: 'custom'
+        },
+
+        {
+          prop: 'productNum',
+          label: '计划数量',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'productWeight',
+          label: '计划重量',
+          align: 'center',
+          showOverflowTooltip: true,
+        },
+        {
+          prop: 'requiredFormingNum',
+          label: '要求生产数量',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+
+        {
+          prop: 'newSumOrderWeight',
+          label: '要求生产重量',
+          align: 'center',
+          showOverflowTooltip: true,
+        },
+
+      
+        {
+          prop: 'reqMoldTime',
+          label: '要求生产日期',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+
+        {
+          prop: 'orderType',
+          label: '计划类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            const obj = this.planType.find((i) => i.value == row.planType);
+            return obj && obj.label;
+          }
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+      ],
+      categoryLevelId: null,
+      code: null,
+      selection: [],
+      ids:[]
+    };
+  },
+
+  watch: {},
+  methods: {
+    datasource({ page, where, limit }) {
+      return getPlanList({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    open(ids) {
+    
+      this.equipmentdialog = true;
+
+    
+    },
+    onDone(){
+      this.$nextTick(() => {
+        this.$refs.equiTable.setSelectedRowKeys(this.ids);
+      });
+    },
+    handleClose() {
+      this.equipmentdialog = false;
+      this.$refs.equiTable.clearSelection();
+    },
+    // 选择
+    selected() {
+      let data=this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current))
+      data['productNumber']=data.productNum
+
+      this.$emit('choose', data);
+      this.handleClose();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  max-height: 530px;
+  overflow: auto;
+}
+.table_col {
+  padding-left: 10px;
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
+}
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.topsearch {
+  margin-bottom: 15px;
+}
+</style>

+ 71 - 0
src/views/inspectionPlan/components/search.vue

@@ -0,0 +1,71 @@
+<!-- 搜索表单 --> 6
+<template>
+  <el-form label-width="90px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 4}">
+        <el-form-item label="名称:">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 4}">
+        <el-form-item label="编码:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 4}">
+        <el-form-item label="状态:">
+          <el-select v-model="where.status" class="m-2" placeholder="请选择" size="large">
+            <el-option label="未下发" :value="0" />
+            <el-option label="已下发" :value="1" />
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 10 } : { span: 4}">
+        <div class="ele-form-actions">
+          <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      name: '',
+      standardCode: '',
+      status: ''
+    };
+    return {
+      defaultWhere,
+      // 表单数据
+      where: { ...defaultWhere },
+
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  methods: {
+    /* 搜索 */
+    search() {
+      this.$emit('search', this.where);
+    },
+    /*  重置 */
+    reset() {
+
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>

+ 213 - 0
src/views/inspectionPlan/components/warehousing.vue

@@ -0,0 +1,213 @@
+<template>
+  <el-dialog
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    title="入库申请单"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="table_col" v-if="equipmentdialog">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            :current.sync="current"
+            highlight-current-row
+            
+            row-key="id"
+            height="50vh"
+            @done="onDone"
+          >
+          </ele-pro-table>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { warehousing} from '@/api/aps/index.js';
+
+
+export default {
+  components: {},
+  props: {
+    selectList: Array,
+    type: {
+      default: 2//1多选 2单选
+    }
+  },
+  data() {
+    return {
+      equipmentdialog: false,
+      current: null,
+
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true,
+          show:this.type==1
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '编码',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'workOrderCode',
+          label: '工单编码',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'warehouseName',
+          label: '仓库名称	',
+          align: 'center'
+        },
+
+        {
+          prop: 'categoryLevelName',
+          label: '物品分类',
+          align: 'center'
+        },
+        {
+          prop: 'categoryName',
+          label: '名称',
+          align: 'center'
+        },
+        { label: '型号', prop: 'modelType', width: '150' },
+        { label: '规格', prop: 'specification', width: '150' },
+        { label: '牌号', prop: 'brandNum', width: '50' },
+        {
+          slot: 'totalCount',
+          label: '总数量',
+          align: 'center'
+        },
+
+        {
+          slot: 'totalPackage',
+          label: '总包装',
+          align: 'center'
+        },
+
+        {
+          slot: 'totalWeight',
+          label: '总重量',
+          align: 'center'
+        },
+        {
+          prop: 'type',
+          label: '入库类型',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return cellValue==1?'生产入库':""
+          }
+        },
+        {
+          prop: 'approvalUserName',
+          label: '审核人',
+          align: 'center'
+        },
+
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+      ],
+      categoryLevelId: null,
+      code: null,
+      selection: [],
+      ids:[]
+    };
+  },
+
+  watch: {},
+  methods: {
+    datasource({ page, where, limit }) {
+      return warehousing({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    open(ids) {
+    
+      this.equipmentdialog = true;
+
+    
+    },
+    onDone(){
+      this.$nextTick(() => {
+        this.$refs.equiTable.setSelectedRowKeys(this.ids);
+      });
+    },
+    handleClose() {
+      this.equipmentdialog = false;
+      this.$refs.equiTable.clearSelection();
+    },
+    // 选择
+    selected() {
+      let data=this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current))
+      data['model']=data.specification
+      data['productName']=data.categoryName
+      data['productNumber']=data.totalCount
+      data['productCode']=data.categoryCode
+      
+      this.$emit('choose', data);
+      this.handleClose();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  max-height: 530px;
+  overflow: auto;
+}
+.table_col {
+  padding-left: 10px;
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
+}
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.topsearch {
+  margin-bottom: 15px;
+}
+</style>

+ 254 - 0
src/views/inspectionPlan/components/workOrder.vue

@@ -0,0 +1,254 @@
+<template>
+  <el-dialog
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    title="生产订单"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="table_col" v-if="equipmentdialog">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            :current.sync="current"
+            highlight-current-row
+            
+            row-key="id"
+            height="50vh"
+            @done="onDone"
+          >
+          </ele-pro-table>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { workOrder} from '@/api/aps/index.js';
+
+
+export default {
+  components: {},
+  props: {
+    selectList: Array,
+    type: {
+      default: 2//1多选 2单选
+    }
+  },
+  data() {
+    return {
+      equipmentdialog: false,
+      current: null,
+      planType: [
+        { label: '所有计划类型', value: null },
+        { label: '内销计划', value: '1' },
+        { label: '外销计划', value: '2' },
+        { label: '预制计划', value: '3' }
+      ],
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true,
+          show:this.type==1
+        },
+        {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            label: '生产订单号',
+            align: 'center',
+            minWidth: 110,
+            prop: 'code',
+
+          },
+          {
+            prop: 'productionPlanCode',
+            label: '计划编号',
+            align: 'center'
+          },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center'
+          },
+          {
+            prop: 'productCode',
+            label: '产品编码',
+            align: 'center'
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center'
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center'
+          },
+
+          {
+            prop: 'batchNo',
+            label: '批号',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center'
+          },
+ 
+
+          {
+            prop: 'priority',
+            label: '优先级',
+            align: 'center',
+            minWidth: 120,
+            sortable: 'custom'
+          },
+
+          {
+            prop: 'formingNum',
+            label: '要求生产数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'formingWeight',
+            label: '要求生产重量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+          },
+          {
+            prop: 'planStartTime',
+            label: '计划开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'planCompleteTime',
+            label: '计划结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+      
+
+          {
+            prop: 'serialNo',
+            label: '客户代号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'simpleName',
+            label: '客户简称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+      ],
+      categoryLevelId: null,
+      code: null,
+      selection: [],
+      ids:[]
+    };
+  },
+
+  watch: {},
+  methods: {
+    datasource({ page, where, limit }) {
+      return workOrder({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    open(ids) {
+    
+      this.equipmentdialog = true;
+
+    
+    },
+    onDone(){
+      this.$nextTick(() => {
+        this.$refs.equiTable.setSelectedRowKeys(this.ids);
+      });
+    },
+    handleClose() {
+      this.equipmentdialog = false;
+      this.$refs.equiTable.clearSelection();
+    },
+    // 选择
+    selected() {
+      let data=this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current))
+      data['productNumber']=data.formingNum
+
+      this.$emit('choose', data);
+      this.handleClose();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  max-height: 530px;
+  overflow: auto;
+}
+.table_col {
+  padding-left: 10px;
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
+}
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.topsearch {
+  margin-bottom: 15px;
+}
+</style>

+ 211 - 0
src/views/inspectionPlan/index.vue

@@ -0,0 +1,211 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <search ref="search" @search="search"></search>
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource">
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit('add')"
+          >
+            添加
+          </el-button>
+        </template>
+        <template v-slot:type="{ row }">
+          {{ getDictValue('质检计划类型', row.type) }}
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('detail', row)"
+            v-if="row.status==1"
+          >
+            详情
+          </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('edit', row)"
+            v-if="row.status==0"
+          >
+            修改
+          </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            v-if="row.status==0"
+            @click="openEdit('issued', row)"
+          >
+            下发
+          </el-link>
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove(row)"
+            v-if="row.status==0"
+
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <edit ref="edit" @done="done"></edit>
+  </div>
+</template>
+<script>
+import search from './components/search.vue';
+import edit from './components/edit.vue';
+import { getList, removeItem } from '@/api/inspectionPlan';
+import dictMixins from '@/mixins/dictMixins';
+export default {
+  mixins: [dictMixins],
+  components: {
+    search,
+    edit
+  },
+  data() {
+    return {
+      columns: [
+       
+        {
+          prop: 'code',
+          label: '编码',
+          width: 160,
+        },
+        {
+          label: '名称',
+          prop: 'name'
+        },
+        {
+          prop: 'batchNo',
+          label: '批号'
+        },
+        
+        {
+          label: '计划类型',
+          prop: 'type',
+          slot:'type'
+        },
+        {
+          label: '计划来源编码',
+          prop: 'planSourceCode'
+        },
+        {
+          label: '自动派单',
+          prop: 'autoOrder',
+          formatter: (row, column, cellValue) => {
+            return cellValue == 1 ? '是' :  '否';
+          }
+        },
+        {
+          prop: 'productName',
+          label: '产品名称',
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+        },
+        {
+          prop: 'brandNo',
+          label: '牌号',
+        },
+
+        {
+          prop: 'productNumber',
+          label: '数量',
+          width: 60
+        },
+      
+        {
+          label: '执行部门',
+          prop: 'groupName'
+        },
+        {
+          label: '执行人',
+          prop: 'executeName',
+          width: 80,
+
+        },
+        {
+          label: '计划开始时间',
+          prop: 'planStartTime'
+        },
+        {
+          label: '计划结束时间',
+          prop: 'planEndTime'
+        },
+        {
+          label: '状态',
+          prop: 'status',
+          width: 70,
+          formatter: (row, column, cellValue) => {
+            return cellValue == 1 ? '已下发' :  '未下发';
+          }
+        },
+
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 220,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ]
+    };
+  },
+  created() {
+    this.requestDict('质检计划类型');
+  },
+  methods: {
+    datasource({ page, where, limit }) {
+      return getList({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+    },
+    search(where) {
+      this.$refs.table.reload({
+        where: where,
+        page: 1
+      });
+    },
+    openEdit(type, row) {
+      this.$refs.edit.open(type, row);
+    },
+
+    remove(row) {
+      removeItem([row.id])
+        .then((message) => {
+          this.$message.success(message);
+          this.done();
+        })
+        .catch((e) => {});
+    },
+    done() {
+      this.$refs.search.search();
+    }
+  }
+};
+</script>
+  

+ 146 - 166
src/views/inspectionWork/components/EquipmentDialog.vue

@@ -7,6 +7,7 @@
     :close-on-press-escape="false"
     append-to-body
     width="60%"
+    @onDone="onDone"
   >
     <div>
       <el-row>
@@ -45,12 +46,9 @@
             :selection.sync="selection"
             :current.sync="current"
             highlight-current-row
-            @select="handleSelect"
             cache-key="systemRoleTable3"
-            aaaaaa
             row-key="id"
             height="50vh"
-            @done="setSelect"
           >
           </ele-pro-table>
         </el-col>
@@ -64,176 +62,158 @@
 </template>
 
 <script>
-  import AssetTree from '@/components/AssetTree/index.vue';
-  import { getList } from '@/api/classifyManage';
-  export default {
-    components: {
-      AssetTree
+import AssetTree from '@/components/AssetTree/index.vue';
+import { getList } from '@/api/classifyManage';
+export default {
+  components: {
+    AssetTree
+  },
+  props: {
+    selectList: Array,
+    type: {
+      default: 2 //1多选 2单选
+    }
+  },
+  data() {
+    return {
+      equipmentdialog: false,
+      current: null,
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true,
+          show: this.type == 1
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'code',
+          label: '物品编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110,
+          slot: 'code'
+        },
+        {
+          prop: 'name',
+          label: '物品名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'brandNum',
+          label: '牌号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'modelType',
+          label: '型号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        }
+      ],
+      tableList: [],
+      categoryLevelId: null,
+      code: null,
+      selection: [],
+      ids: []
+    };
+  },
+
+  watch: {},
+  methods: {
+    async datasource({ page, limit }) {
+      const params = {
+        code: this.code,
+        pageNum: page,
+        size: limit,
+        categoryLevelId: this.categoryLevelId,
+        isProduct: true
+      };
+      const data = await getList(params);
+      this.tableList = data.list;
+      return data;
     },
-    props: {
-      selectList: Array,
-      type:{
-        default:2 //1多选 2单选
+    open(ids) {
+      this.equipmentdialog = true;
+      if (ids) {
+        this.ids=ids;
       }
     },
-    data () {
-      return {
-        equipmentdialog: false,
-        current:null,
-        columns: [
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center',
-            reserveSelection: true,
-            show:this.type==1
-          },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'code',
-            label: '物品编码',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110,
-            slot: 'code'
-          },
-          {
-            prop: 'name',
-            label: '物品名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'brandNum',
-            label: '牌号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'specification',
-            label: '规格',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'modelType',
-            label: '型号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          }
-        ],
-        tableList: [],
-        categoryLevelId: null,
-        code: null,
-        selection: []
-      };
+    handleNodeClick(data) {
+      this.categoryLevelId = data.id;
+      this.reload();
     },
-
-    watch: {},
-    methods: {
-      async datasource ({ page, limit }) {
-        const params = {
-          code: this.code,
-          pageNum: page,
-          size: limit,
-          categoryLevelId: this.categoryLevelId,
-          isProduct: true
-        };
-        const data = await getList(params);
-        this.tableList = data.list;
-        return data;
-      },
-      open () {
-        this.equipmentdialog = true;
-        this.setSelect();
-      },
-      handleNodeClick (data) {
-        this.categoryLevelId = data.id;
-        this.reload();
-      },
-      reload () {
-        this.$refs.equiTable.reload();
-      },
-      handleClose () {
-        this.equipmentdialog = false;
-        this.code = '';
-        this.$refs.equiTable.clearSelection();
-      },
-      reset () {
-        this.code = null;
-        this.reload();
-      },
-      // 设置选中
-      setSelect () {
-        // this.$nextTick(() => {
-        //   this.tableList.forEach((row) => {
-        //     this.selectList?.forEach((selected, index) => {
-        //       if (selected.productCode === row.code) {
-        //         this.$refs.equiTable.toggleRowSelection(row, true);
-        //       }
-        //     });
-        //   });
-        // });
-      },
-      // 取消选中
-      handleSelect (selection, row) {
-        // if (!selection.find((i) => i.id === row.id)) {
-        //   const index = this.selectList.findIndex(
-        //     (itm) => row.code == itm.productCode
-        //   );
-        //   console.log(index);
-        //   if (index > -1) {
-        //     this.selectList.splice(index, 1);
-        //   }
-        // }
-      },
-      // 选择
-      selected () {
-        
-    
-        let list=this.type==1?this.selection:[this.current]
-        this.$emit('choose', JSON.parse(JSON.stringify(list)));
-        this.handleClose();
-      }
+    reload() {
+      this.$refs.equiTable.reload();
+    },
+    handleClose() {
+      this.equipmentdialog = false;
+      this.code = '';
+      this.$refs.equiTable.clearSelection();
+    },
+    reset() {
+      this.code = null;
+      this.reload();
+    },
+    onDone() {
+      this.$nextTick(() => {
+        this.$refs.equiTable.setSelectedRowKeys(this.ids);
+      });
+    },
+    // 选择
+    selected() {
+      let list = this.type == 1 ? this.selection : [this.current];
+      this.$emit('choose', JSON.parse(JSON.stringify(list)));
+      this.handleClose();
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .tree_col {
-    border: 1px solid #eee;
-    padding: 10px 0;
-    box-sizing: border-box;
-    max-height: 530px;
-    overflow: auto;
-  }
-  .table_col {
-    padding-left: 10px;
-    ::v-deep .el-table th.el-table__cell {
-      background: #f2f2f2;
-    }
-  }
-  .pagination {
-    text-align: right;
-    padding: 10px 0;
-  }
-  .btns {
-    text-align: center;
-    padding: 10px 0;
-  }
-  .topsearch {
-    margin-bottom: 15px;
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  max-height: 530px;
+  overflow: auto;
+}
+.table_col {
+  padding-left: 10px;
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
   }
+}
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.topsearch {
+  margin-bottom: 15px;
+}
 </style>

+ 112 - 44
src/views/inspectionWork/components/edit.vue

@@ -11,27 +11,27 @@
   >
     <el-form ref="form" :model="form" :rules="rules" label-width="100px">
       <el-row>
-        <el-col :span="8" v-if="title!='新增'">
+        <el-col :span="8" v-if="title != '新增'">
           <el-form-item label="编码:">
-            <el-input :maxlength="20" v-model="form.code" disabled  />
+            <el-input :maxlength="20" v-model="form.code" disabled />
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="title!='新增'">
+        <el-col :span="8" v-if="title != '新增'">
           <el-form-item label="工单号:">
-            <el-input :maxlength="20" v-model="form.workOrderCode" disabled   />
+            <el-input :maxlength="20" v-model="form.workOrderCode" disabled />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="质检类型:" prop="qualityType">
             <DictSelection
               dictName="质检类型"
-              v-if="title=='新增'"
+              v-if="title != '详情'"
               v-model="form.qualityType"
             ></DictSelection>
             <el-input
               :value="getDictValue('质检类型', form.qualityType)"
               disabled
-              v-if="title!='新增'"
+              v-if="title == '详情'"
             />
           </el-form-item>
         </el-col>
@@ -41,12 +41,12 @@
               @click.native="openVersion"
               clearable
               v-model="form.produceRoutingName"
-              v-if="title=='新增'"
+              v-if="title != '详情'"
             />
             <el-input
               v-model="form.produceRoutingName"
               disabled
-              v-if="title!='新增'"
+              v-if="title == '详情'"
             />
           </el-form-item>
         </el-col>
@@ -58,7 +58,7 @@
               placeholder="请选择"
               clearable
               @change="produceTaskChange"
-              v-if="title=='新增'"
+              v-if="title != '详情'"
             >
               <el-option
                 v-for="item in produceTaskList"
@@ -71,7 +71,7 @@
             <el-input
               v-model="form.produceTaskName"
               disabled
-              v-if="title!='新增'"
+              v-if="title == '详情'"
             />
           </el-form-item>
         </el-col>
@@ -81,12 +81,12 @@
               v-model="form.productName"
               @click.native="addProduct"
               readonly
-              v-if="title=='新增'"
+              v-if="title == '新增'"
             />
             <el-input
               v-model="form.productName"
               disabled
-              v-if="title!='新增'"
+              v-if="title != '新增'"
             />
           </el-form-item>
         </el-col>
@@ -100,7 +100,7 @@
             <el-input
               v-model="form.qualifiedNumber"
               @input="inputValue"
-              :disabled="title!='新增'"
+              :disabled="title == '详情'"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -109,16 +109,15 @@
             <el-input
               v-model="form.noQualifiedNumber"
               @input="inputValue"
-              :disabled="title!='新增'"
-
+              :disabled="title == '详情'"
             ></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="工时(h):" prop="hours">
-            <el-input v-model="form.hours"
-            :disabled="title!='新增'"
-            
+            <el-input
+              v-model="form.hours"
+              :disabled="title == '详情'"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -129,23 +128,45 @@
               v-model="form.qualityTime"
               type="date"
               value-format="yyyy-MM-dd"
-              :disabled="title!='新增'"
-
+              :disabled="title == '详情'"
             ></el-date-picker>
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="质检人:" prop="qualityName">
-            <el-input disabled v-model="form.qualityName"></el-input>
+          <el-form-item label="质检部门" prop="groupId">
+            <deptSelect
+              :disabled="title == '详情'"
+              v-model="form.groupId"
+              @changeGroup="searchDeptNodeClick"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="质检人" prop="qualityId">
+            <el-select
+              :disabled="title == '详情'"
+              v-model="form.qualityId"
+              @change="changeExecutor"
+              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>
       </el-row>
     </el-form>
 
-    <div class="title"  v-if="title != '新增'">质检内容</div>
-    <el-table border v-if="title != '新增'">  </el-table>
-    <div class="title"   v-if="title != '新增'">不合格品内容</div>
-    <el-table :data="form.voList" border   v-if="title != '新增'">
+    <div class="title" v-if="title != '新增'">质检内容</div>
+    <el-table border v-if="title != '新增'"> </el-table>
+    <div class="title" v-if="title != '新增'">不合格品内容</div>
+    <el-table :data="form.voList" border v-if="title != '新增'" height="25vh" >
       <el-table-column label="序号" align="center" width="60">
         <template slot-scope="scope">
           <span>{{ scope.$index + 1 }}</span>
@@ -178,7 +199,12 @@
       >
         报工
       </el-button>
-      <el-button type="primary" :loading="loading" @click="save"  v-if="title == '新增'">
+      <el-button
+        type="primary"
+        :loading="loading"
+        @click="save"
+        v-if="title == '新增'"
+      >
         保存
       </el-button>
     </template>
@@ -193,9 +219,10 @@ import { getProduceTaskList } from '@/api/aps';
 import EquipmentDialog from './EquipmentDialog.vue';
 import ProductionVersion from './ProductionVersion.vue';
 import dictMixins from '@/mixins/dictMixins';
-
+import deptSelect from '@/components/CommomSelect/dept-select.vue';
+import { getUserPage } from '@/api/system/organization';
 export default {
-  components: { ProductionVersion, EquipmentDialog },
+  components: { ProductionVersion, EquipmentDialog,deptSelect },
   mixins: [dictMixins],
 
   data() {
@@ -219,7 +246,11 @@ export default {
         hours: '',
         qualityTime: '',
         qualityName: '',
-        voList: []
+        qualityId: '',
+        voList: [],
+        groupId:'',
+        groupName:'',
+        id:""
       };
     };
     return {
@@ -233,13 +264,16 @@ export default {
         qualifiedNumber: [
           { required: true, message: '请输入', trigger: 'blur' }
         ],
-        qualityTime: [{ required: true, message: '请输入', trigger: 'blur' }]
+        qualityTime: [{ required: true, message: '请输入', trigger: 'blur' }],
+        groupId: [{ required: true, message: '请输入', trigger: 'change' }],
+        qualityId: [{ required: true, message: '请输入', trigger: 'change' }]
       },
       visible: false,
       type: null,
       title: null,
       loading: false,
-      produceTaskList: []
+      produceTaskList: [],
+      executorList:''
     };
   },
 
@@ -249,7 +283,9 @@ export default {
       this.title = type == 'add' ? '新增' : type == 'edit' ? '报工' : '详情';
       this.type = type;
       if (this.type != 'add') {
-        this.form = row;
+        this.form = JSON.parse(JSON.stringify(row));
+        this.getUserList({ groupId: this.form.groupId });
+        this.getProduceTaskList();
       }
       this.visible = true;
     },
@@ -293,6 +329,37 @@ export default {
       this.form.productCode = data[0].code;
       this.form.specification = data[0].specification;
       this.form.brandNo = data[0].brandNum;
+    },
+        //选择部门(搜索)
+        searchDeptNodeClick(info, row) {
+      if (info) {
+        const params = { groupId: info };
+        this.getUserList(params);
+        this.form.groupName = row.name;
+      } else {
+        this.form.executeGroupId = null;
+      }
+    },
+    // 获取审核人列表、巡点检人员
+    async getUserList(params) {
+      try {
+        let data = { pageNum: 1, size: -1 };
+        // 如果传了参数就是获取巡点检人员数据
+        if (params) {
+          data = Object.assign(data, params);
+        }
+        const res = await getUserPage(data);
+        this.executorList = res.list;
+      } catch (error) {}
+    },
+    // 执行人选择
+    changeExecutor(val) {
+      if (val) {
+        this.form.qualityId = val;
+        this.form.qualityName = this.executorList.filter(
+          (item) => item.id === val
+        )[0].name;
+      }
     },
     /* 保存编辑 */
     save() {
@@ -314,17 +381,18 @@ export default {
       });
     },
     update() {
-        this.loading = true;
-        update({ id: this.form.id, status: 1 })
-          .then((msg) => {
-            this.loading = false;
-            this.$message.success(msg);
-            this.handleClose();
-            this.$emit('done');
-          })
-          .catch((e) => {
-            this.loading = false;
-          });
+      this.loading = true;
+      this.form['status'] = 1;
+      update({ ...this.form })
+        .then((msg) => {
+          this.loading = false;
+          this.$message.success(msg);
+          this.handleClose();
+          this.$emit('done');
+        })
+        .catch((e) => {
+          this.loading = false;
+        });
     },
     restForm() {
       this.form = { ...this.defaultForm() };