Переглянути джерело

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dev

ysy 2 роки тому
батько
коміт
fee0762a6b

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

@@ -31,3 +31,17 @@ export async function getPlanDeviceList ({ produceVersionId }) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 选择工艺路线
+export async function routeList(params) {
+  const res = await request.get('/main/producerouting/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+// 工序
+export async function getProduceTaskList(params) {
+  const res = await request.post('/main/producerouting/taskinstance/page',params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}

+ 12 - 0
src/api/mes/index.js

@@ -23,3 +23,15 @@ export async function getCaptcha() {
   }
   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));
+}

+ 127 - 0
src/api/unacceptedProduct/index.js

@@ -0,0 +1,127 @@
+import request from '@/utils/request';
+
+
+/**
+ * 不合格品台账列表
+ */
+export async function getList(data) {
+  const res = await request.post('/mes/unqualified_products/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 不合格品台账列表详情
+ */
+export async function getDetail(data) {
+  const res = await request.get('/mes/unqualified_products_detail/query/' + data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//不合格品新建/修改
+export async function unqualifiedProductsAdd(data) {
+  const res = await request.post('/mes/unqualified_products/' + (data.id ? 'update' : 'add'), data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//不合格品处置
+export async function dispose(data) {
+  const res = await request.post('mes/unqualified_products_detail/dispose', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 删除
+export async function deleteUnacceptedProduct(data) {
+  const res = await request.delete('/mes/unqualified_products/delete/' + data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 删除详情
+export async function deleteUnacceptedProductDetail(data) {
+  const res = await request.delete('/mes/unqualified_products_detail/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 返工返修台账
+ */
+export async function getReworkList(data) {
+  const res = await request.post('/mes/return_repair_work/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 删除返工返修台账
+export async function deleteReworkList(data) {
+  const res = await request.delete('/mes/return_repair_work/delete' , {data});
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// // 下达
+// export async function releaseWorkOrder({ id, teamId }) {
+//   const res = await request.get(
+//     `/aps/workorder/releaseWorkOrder/${id}/${teamId}`
+//   );
+//   if (res.data.code == 0) {
+//     return res.data.data;
+//   }
+//   return Promise.reject(new Error(res.data.message));
+// }
+/**
+ * 返工返修转换
+ */
+ export async function transformation(data,type) {
+  const res = await request.post('/mes/return_repair_work/transformation?type='+type, data);
+    return res.data
+  
+}
+/**
+ * 试销品台账
+ */
+ export async function trialProducts(data) {
+  const res = await request.post('/mes/trial_products/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 删除试销品台账
+export async function deleteTrialProducts(data) {
+  const res = await request.delete('/mes/trial_products/delete' , {data});
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 报废品台账
+ */
+ export async function scrapProducts(data) {
+  const res = await request.post('/mes/scrap_products/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 删除报废品台账
+export async function deleteScrapProducts(data) {
+  const res = await request.delete('/mes/scrap_products/delete' , {data});
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 159 - 0
src/components/AssetTree/index2.vue

@@ -0,0 +1,159 @@
+<template>
+  <div class="tree-wrapper">
+    <el-tree
+      :data="treeList"
+      :props="defaultProps"
+      v-loading="treeLoading"
+      :node-key="nodeKey"
+      ref="tree"
+      :highlight-current="true"
+      :expand-on-click-node="false"
+      @node-click="handleNodeClick"
+      v-bind="$attrs"
+      :default-expand-all="defaultExpandAll"
+    >
+    </el-tree>
+  </div>
+</template>
+
+<script>
+  import { getTreeByPid } from '@/api/classifyManage';
+  // let originId = '';
+  // let originType = '';
+  export default {
+    props: {
+      // treeList私有化处理
+      treeFormate: {
+        type: Function,
+        default: null
+      },
+      defaultProps: {
+        type: Object,
+        default: function () {
+          return {
+            children: 'children',
+            value: 'id',
+            label: 'name'
+          };
+        }
+      },
+      defaultExpandAll: {
+        type: Boolean,
+        default: function () {
+          return true;
+        }
+      },
+      // 初始请求treeList
+      init: {
+        type: Boolean,
+        default: true
+      },
+      id: {
+        type: String,
+        default: '0'
+      },
+      nodeKey: {
+        type: String,
+        default: 'id'
+      }
+      // appendRoot: {
+      //   type: Boolean,
+      //   default: false
+      // },
+    },
+    data () {
+      return {
+        treeList: [],
+        treeLoading: false,
+        parentName: '',
+        parentId: '',
+        currentKey: ''
+      };
+    },
+    mounted () {
+      if (this.init) {
+        this.getTreeData();
+      }
+    },
+    methods: {
+      getInstance () {
+        return this.$refs.tree;
+      },
+      // 获取树结构数据
+      async getTreeData () {
+        try {
+          this.treeLoading = true;
+
+          const res = await getTreeByPid(this.id);
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+            this.$emit('setRootId', res.data[0].id);
+            if (this.treeFormate) {
+              this.treeList = this.treeFormate(this.treeList);
+            }
+            this.$nextTick(() => {
+              // 默认高亮第一级树节点
+              if (this.treeList[0]) {
+                this.setCurrentKey(this.treeList[0].id);
+                this.handleNodeClick(
+                  this.treeList[0],
+                  this.$refs.tree.getCurrentNode()
+                );
+              }
+            });
+            return this.treeList;
+          }
+        } catch (error) {}
+        this.treeLoading = false;
+      },
+      // 递归 - 往树children里面添加parentName
+      // _setParentName (tree) {
+      //   let data = tree;
+      //   for (let i = 0; i < data.length; i++) {
+      //     if (data[i].parentId === '0') {
+      //       this.parentName = data[i].name;
+      //       originId = data[i].id;
+      //       originType = data[i].type;
+      //     }
+
+      //     data[i]['originId'] = originId;
+      //     data[i]['originType'] = originType;
+      //     data[i]['parentId'] = data[i]['parentId'];
+      //     if (data[i].children && data[i].children.length > 0) {
+      //       this._setParentName(data[i].children);
+      //     }
+      //   }
+      //   return data;
+      // },
+
+      handleNodeClick (data, node) {
+        this.$emit('handleNodeClick', data, node);
+      },
+      // 设置默认高亮行
+      setCurrentKey (id) {
+        this.currentKey = id;
+        this.$refs.tree.setCurrentKey(this.currentKey);
+      },
+
+      // 获取树的选中状态
+      getSelectList () {
+        const selectList = this.$refs.tree.getCurrentNode();
+        return selectList;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree-wrapper {
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+
+    :deep(.el-tree) {
+      display: inline-block;
+      min-width: 100%;
+    }
+  }
+</style>

+ 186 - 0
src/components/ProductionVersion/ProductionVersion.vue

@@ -0,0 +1,186 @@
+<template>
+  <el-dialog title="选择工艺路线" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="true"
+    :close-on-press-escape="false" append-to-body width="80%">
+    <el-card shadow="never">
+
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 350px)"
+        class="dict-table" @cell-click="cellClick">
+        <!-- 表头工具栏 -->
+
+        
+
+        <template v-slot:status="{ row }">
+          {{ checkStatus(row) }}
+        </template>
+
+        <template v-slot:action="{ row }">
+          <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+        </template>
+      </ele-pro-table>
+
+    </el-card>
+    <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 { routeList } from '@/api/aps';
+// import productionSearch from './production-search.vue'
+export default {
+  components: { 
+    // productionSearch
+    },
+  data() {
+    return {
+      visible: false,
+      // 表格列配置
+      columns: [
+        {
+          prop: 'code',
+          label: '工艺路线组编码',
+          // sortable: 'custom',
+          showOverflowTooltip: true,
+          align: 'center',
+
+          minWidth: 110
+        },
+        {
+          prop: 'name',
+          label: '工艺路线名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+
+
+        {
+          prop: 'version',
+          label: '工艺路线版本',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          prop: 'produceVersionName',
+          label: '生产版本',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          slot: 'status',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+
+        {
+          action: 'action',
+          slot: 'action',
+          align: 'center',
+          label: '选择'
+        }
+      ],
+      statusList: [
+        { label: '草稿', value: -1 },
+        { label: '失效', value: 0 },
+        { label: '生效', value: 1 }
+      ],
+      categoryLevelId: '9',
+      radio: null
+    }
+  },
+
+  watch: {
+
+  },
+  methods: {
+
+    checkStatus(row) {
+      let obj = this.statusList.find((it) => it.value == row.status);
+      return obj.label;
+    },
+    /* 表格数据源 */
+    datasource({ page, where, limit }) {
+      return routeList({
+        ...where,
+        pageNum: page,
+        size: limit,
+  
+      });
+    },
+
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where: where });
+    },
+    open(item) {
+      if (item) {
+        this.current = {
+          id: item.id,
+          name: item.name,
+        }
+        this.radio = item.id
+      }
+      this.visible = true
+    },
+    // 单击获取id
+    cellClick (row) {
+        this.current = row
+        this.radio = row.id
+    },
+
+    handleClose() {
+      this.visible = false
+ 
+    },
+    selected() {
+      if (!this.current) {
+        return this.$message.warning('请选择工艺路线')
+      }
+      this.$emit('changeProduct', this.current)
+      this.handleClose()
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  height: 500px;
+  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>

+ 6 - 1
src/enum/dict.js

@@ -12,6 +12,11 @@ export default {
   时间单位: 'time_unit',
   处置仓库: 'modificatiWnarehouse',
   干燥区域: 'drying_area',
-  日期方式: 'date_method'
+  日期方式: 'date_method',
+  不良品处理类型:'unqualified_products_type',
+  返工返修处置 :'return_repair_work_type',
+  订单类型: 'order_type',
+  不合格品原因:'unqualified_products_reason',
+  订单计划类型: 'plan_type',
 };
 export const numberList = ['date_method'];

+ 38 - 1
src/utils/util.js

@@ -1,4 +1,4 @@
-import { getAction } from '@/api/flowable/manage';
+// import { getAction } from '@/api/flowable/manage';
 
 import store from '@/store';
 
@@ -33,3 +33,40 @@ export function randomString(len) {
   }
   return pwd;
 }
+
+//不合格品台账状态
+export function unacceptedProductStatus(v) {
+  let status = '';
+  switch (v) {
+    case 0:
+      status = '待处理';
+      break;
+    case 1:
+      status = '处理中';
+      break;
+    case 2:
+      status = '已处理';
+      break;
+    case 3:
+      status = '已完结';
+      break;
+  }
+  return status;
+}
+//返工返修状态
+export function reworkStatus(v) {
+  let status = '';
+  switch (v) {
+    case 1:
+      status = '待处理';
+      break;
+    case 2:
+      status = '处理中';
+      break;
+    case 3:
+      status = '已完成';
+      break;
+   
+  }
+  return status;
+}

+ 239 - 0
src/views/unacceptedProduct/components/EquipmentDialog.vue

@@ -0,0 +1,239 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="60%"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="topsearch">
+          <el-form>
+            <el-row>
+              <el-col :span="6">
+                <el-input
+                  v-model="code"
+                  placeholder="请输入产品编码"
+                  size="small"
+                ></el-input>
+              </el-col>
+              <el-col :span="6" style="margin-left: 10px">
+                <el-button type="primary" size="small" @click="reload"
+                  >搜索</el-button
+                >
+                <el-button size="small" @click="reset">重置</el-button>
+              </el-col>
+            </el-row>
+          </el-form>
+        </el-col>
+        <el-col :span="6" class="tree_col">
+          <AssetTree
+            @handleNodeClick="handleNodeClick"
+            id="9"
+            :paramsType="'type'"
+            ref="treeList"
+          />
+        </el-col>
+        <el-col :span="18" class="table_col" v-if="equipmentdialog">
+          <ele-pro-table
+            ref="equiTable"
+            :columns="columns"
+            :datasource="datasource"
+            :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>
+      </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 AssetTree from '@/components/AssetTree/index2.vue';
+  import { getList } from '@/api/classifyManage/itemInformation';
+  export default {
+    components: {
+      AssetTree
+    },
+    props: {
+      selectList: Array,
+      type:{
+        default:1 //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: []
+      };
+    },
+
+    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();
+      }
+    }
+  };
+</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>

+ 467 - 0
src/views/unacceptedProduct/components/create.vue

@@ -0,0 +1,467 @@
+<template>
+  <ele-modal :visible.sync="visible" :title="title" width="80vw" append-to-body>
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="90px"
+      class="create-form"
+    >
+      <el-row :gutter="15">
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="编码:">
+            <el-input :maxlength="20" v-model="form.code" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="工单号:">
+            <el-input :maxlength="20" v-model="form.workOrderId" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="数量:">
+            <el-input
+              :maxlength="20"
+              v-model="form.unqualifiedQuantity"
+              disabled
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="工艺路线:">
+            <el-input
+              @click.native="openVersion"
+              clearable
+              v-model="form.produceRoutingName"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="工序:">
+            <el-select
+              style="width: 100%"
+              v-model="form.produceTaskId"
+              placeholder="请选择"
+              clearable
+              @change="produceTaskChange"
+            >
+              <el-option
+                v-for="item in produceTaskList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+          <el-form-item label="批号:">
+            <el-input :maxlength="20" v-model="form.batchNo" disabled />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-table :data="form.poList" border height="40vh">
+        <el-table-column label="序号" align="center" width="60">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="产品名称" align="center" prop="productName">
+        </el-table-column>
+        <el-table-column label="产品编号" align="center" prop="productCode">
+        </el-table-column>
+        <el-table-column label="牌号" align="center" prop="brandNo">
+        </el-table-column>
+        <el-table-column label="刻码" align="center" prop="engravingCode">
+          <template slot-scope="scope">
+            <el-form-item
+              label-width="0px"
+              :prop="'poList.' + scope.$index + '.engravingCode'"
+             
+            >
+              <el-input
+                v-model="scope.row.engravingCode"
+                size="small"
+                style="width: 100%"
+                placeholder="输入刻码"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column label="型号" align="center" prop="model">
+        </el-table-column> -->
+        <el-table-column label="规格" align="center" prop="specification">
+        </el-table-column>
+
+        <el-table-column label="数量" align="center" prop="unqualifiedQuantity">
+          <template slot-scope="scope">
+            <el-form-item
+              label-width="0px"
+              :prop="'poList.' + scope.$index + '.unqualifiedQuantity'"
+              :rules="[
+                {
+                  required: true,
+                  message: '请输入数量',
+                  trigger: 'blur'
+                },
+                { validator: validatePass, trigger: 'change' }
+              ]"
+            >
+              <el-input
+              :disabled="!!scope.row.id"
+                v-model.number="scope.row.unqualifiedQuantity"
+                size="small"
+                oninput="value=value.replace(/[^\d]/g,'')"
+                style="width: 100%"
+                placeholder="输入数量"
+                @input="
+                  inputNumber(scope.$index, scope.row.unqualifiedQuantity)
+                "
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="工艺路线"
+          align="center"
+          prop="produceRoutingName"
+        >
+        </el-table-column>
+        <el-table-column label="工序" align="center" prop="produceTaskName">
+        </el-table-column>
+        <el-table-column label="来源方式" align="center" prop="unqualifiedSource">
+        </el-table-column>
+        
+        <el-table-column label="原因" align="center" prop="unqualifiedReason">
+          <template slot-scope="scope">
+            <el-form-item
+              label-width="0px"
+              :prop="'poList.' + scope.$index + '.unqualifiedReason'"
+              :rules="{
+                required: true,
+                message: '请输入原因',
+                trigger: 'blur'
+              }"
+            >
+              <el-input
+                v-model="scope.row.unqualifiedReason"
+                size="small"
+                style="width: 100%"
+                placeholder="输入原因"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </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="addEquipment">
+        <i class="el-icon-circle-plus-outline"></i>
+      </div>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="save" :loading="loading">
+        确定
+      </el-button>
+    </template>
+
+    <!-- 选择产品 -->
+    <EquipmentDialog
+      ref="equipmentRefs"
+      @choose="confirmChoose"
+    >
+    </EquipmentDialog>
+    <ProductionVersion
+      ref="versionRefs"
+      @changeProduct="changeProduct"
+    ></ProductionVersion>
+  </ele-modal>
+</template>
+
+<script>
+import EquipmentDialog from '../components/EquipmentDialog.vue';
+import ProductionVersion from '@/components/ProductionVersion/ProductionVersion.vue';
+import { getProduceTaskList } from '@/api/aps';
+import {
+  unqualifiedProductsAdd,
+  getDetail,deleteUnacceptedProductDetail
+} from '@/api/unacceptedProduct/index';
+export default {
+  components: {
+    EquipmentDialog,
+    ProductionVersion
+  },
+  data() {
+    return {
+      validatePass: (rule, value, callback) => {
+        if (!value) {
+          callback(new Error('数量不能为0'));
+        } else {
+          callback();
+        }
+      },
+      visible: false,
+      loading: false,
+      produceTaskList: [],
+      form: {
+        poList: [],
+        code: '',
+        workOrderId: '',
+        productCode: '',
+        productName: '',
+        specifications: '',
+        unqualifiedQuantity: '',
+        type: '',
+        status: null,
+        reviewerId: null,
+        reviewerName: '',
+        createUserName: '',
+        brandNo: '',
+        produceRoutingId: '',
+        produceRoutingName: '',
+        produceTaskId: '',
+        produceTaskName: '',
+        batchNo: ''
+      },
+      // 表单验证规则
+      rules: {
+        deliveryTime: [
+          { required: true, message: '请选择交付日期', trigger: 'change' }
+        ]
+      },
+
+      title: '创建'
+    };
+  },
+
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  created() {},
+  methods: {
+    open(row) {
+      this.visible = true;
+      if (row) {
+        this.title = '修改';
+        this.detail(row);
+      } else {
+        this.title = '创建';
+      }
+    },
+    //选择工艺路线
+    openVersion() {
+      this.$refs.versionRefs.open();
+    },
+    //工艺路线回调
+    changeProduct(data) {
+      this.form.produceRoutingId = data.id;
+      this.form.produceRoutingName = data.name;
+      this.form.produceTaskId = '';
+      this.form.produceTaskName = '';
+      this.getProduceTaskList();
+    },
+    async getProduceTaskList() {
+      const res = await getProduceTaskList({
+        isDetail: true,
+        pageNum: 1,
+        routingId: this.form.produceRoutingId,
+        size: -1
+      });
+      this.produceTaskList = res.list;
+    },
+    produceTaskChange() {
+      if (!this.form.produceTaskId) {
+        return;
+      }
+      this.form.produceTaskName = this.produceTaskList.find(
+        (item) => item.id == this.form.produceTaskId
+      ).name;
+      this.form.poList.forEach((item, index) => {
+        this.$set(
+          this.form.poList[index],
+          'produceRoutingId',
+          this.form.produceRoutingId
+        );
+        this.$set(
+          this.form.poList[index],
+          'produceRoutingName',
+          this.form.produceRoutingName
+        );
+        this.$set(
+          this.form.poList[index],
+          'produceTaskId',
+          this.form.produceTaskId
+        );
+        this.$set(
+          this.form.poList[index],
+          'produceTaskName',
+          this.form.produceTaskName
+        );
+      });
+    },
+
+    detail(row) {
+      getDetail(row.id).then((res) => {
+        this.form = row;
+        this.getProduceTaskList();
+        this.form.poList = res;
+      });
+    },
+    cancel() {
+      this.form = {
+        poList: [],
+        code: '',
+        workOrderId: '',
+        productCode: '',
+        productName: '',
+        specifications: '',
+        unqualifiedQuantity: '',
+        type: '',
+        status: null,
+        reviewerId: null,
+        reviewerName: '',
+        createUserName: '',
+        brandNo: '',
+        produceRoutingId: '',
+        produceRoutingName: '',
+        produceTaskId: '',
+        produceTaskName: '',
+        batchNo: ''
+      };
+      this.$refs.form.clearValidate();
+      this.visible = false;
+    },
+    // 删除产品
+    handleDeleteItem(index, id) {
+      this.$confirm('确认删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancleButtonText: '取消',
+        type: 'warning'
+      })
+        .then((res) => {
+          if (id) {
+            deleteUnacceptedProductDetail([id]).then((res) => {
+              this.form.poList.splice(index, 1);
+            });
+          } else {
+            this.form.poList.splice(index, 1);
+          }
+        })
+        .catch(() => {});
+
+      this.inputNumber();
+    },
+    addEquipment() {
+      this.$refs.equipmentRefs.open();
+    },
+    /* 保存编辑 */
+    save() {
+      console.log(this.form.poList);
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return false;
+        }
+        if (!this.form.poList.length) {
+          return this.$message.warning('产品列表不能为空!');
+        }
+        for (let key in this.form) {
+          if (key.includes('create')) {
+            this.form[key] = '';
+          }
+        }
+        this.form.poList.forEach((item) => {
+          for (let key in item) {
+            if (key.includes('create')) {
+              item[key] = '';
+            }
+          }
+        });
+        this.loading = true;
+        unqualifiedProductsAdd(this.form)
+          .then((res) => {
+            this.loading = false;
+            this.$message.success('成功');
+            this.cancel();
+            this.$emit('refresh');
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      });
+    },
+
+    // 确定选择
+    confirmChoose(data) {
+      let list = [];
+      list = data.map((item, index) => {
+          if (item.productCode) {
+            return item;
+          } else {
+            return {
+              productCode: item.code,
+              productName: item.name,
+              // productUnitWeight: item.netWeight,
+              // weightUnit: item.weightUnit,
+              specification: item.specification,
+              brandNo: item.brandNum,
+              unqualifiedQuantity: '',
+              unqualifiedReason: '',
+              produceRoutingId: '',
+              produceRoutingName: '',
+              produceTaskId: '',
+              produceTaskName: ''
+            };
+          }
+        });
+
+      this.form.poList = this.form.poList.concat(list);
+    
+      this.produceTaskChange();
+      this.inputNumber();
+    },
+
+    inputNumber() {
+      this.form.unqualifiedQuantity = 0;
+      this.form.poList.forEach((item) => {
+        this.form.unqualifiedQuantity += Number(item.unqualifiedQuantity) || 0;
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.basic-details-title {
+  margin: 10px 0;
+}
+
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
+
+.create-form .el-form-item {
+  margin-bottom: 15px !important;
+}
+</style>

+ 110 - 0
src/views/unacceptedProduct/components/detail-search.vue

@@ -0,0 +1,110 @@
+<!-- 搜索表单 -->
+<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: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品名称:">
+          <el-input
+            clearable
+            v-model="where.productName"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品编码:">
+          <el-input
+            clearable
+            v-model="where.productCode"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品规格:">
+          <el-input
+            clearable
+            v-model="where.specification"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="状态:">
+          <el-input clearable v-model="where.status" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label-width="0px">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
+            >重置</el-button
+          >
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  props: [],
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      productName: '',
+      status: '',
+      createTime: []
+    };
+    return {
+      // 表单数据
+      where: { ...defaultWhere },
+      teamList: []
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  watch: {},
+  created() {},
+  methods: {
+    /* 搜索 */
+    search() {
+      const where = { ...this.where };
+      if (where.createTime?.length) {
+        where.startTime = where.createTime[0];
+        where.endTime = where.createTime[1];
+      }
+      delete where.createTime;
+      this.$emit('search', where);
+    },
+    /*  重置 */
+    reset() {
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.ele-form-actions {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+}
+</style>

+ 321 - 0
src/views/unacceptedProduct/components/edit.vue

@@ -0,0 +1,321 @@
+<template>
+  <ele-modal :visible.sync="visible" :title="title" width="40vw" append-to-body>
+    <div class="title">{{ title == '返工返修' ? '原' : '' }}产品信息</div>
+    <el-table :data="poList" border>
+      <el-table-column label="产品名称" align="center" prop="productName">
+      </el-table-column>
+      <el-table-column label="产品编号" align="center" prop="productCode">
+      </el-table-column>
+      <!-- <el-table-column label="刻码" align="center" prop="engravingCode">
+        </el-table-column> -->
+      <el-table-column label="规格" align="center" prop="specification">
+      </el-table-column>
+      <el-table-column label="数量" align="center" prop="unqualifiedQuantity">
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime">
+      </el-table-column>
+      <el-table-column label="创建人" align="center" prop="reviewerName">
+      </el-table-column>
+      <el-table-column
+        label="入库仓库"
+        align="center"
+        prop="depotId"
+        v-if="title != '返工返修'"
+      >
+        <template slot-scope="scope">
+          <el-select v-model="scope.row.depotId">
+            <el-option
+              v-for="item in warehouseList"
+              :key="item.id"
+              :value="item.id"
+              :label="item.name"
+              @click.native="handleChangeDepot(scope.row, item)"
+            ></el-option>
+          </el-select>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="title" v-if="title == '返工返修'">返工返修产品信息</div>
+    <el-form
+      ref="form"
+      label-width="90px"
+      class="create-form"
+      v-if="title == '返工返修'"
+    >
+      <el-table :data="newPoList" border height="20vh">
+        <el-table-column label="序号" align="center" width="60">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="产品名称" align="center" prop="productNameNew">
+        </el-table-column>
+        <el-table-column label="产品编号" align="center" prop="productCodeNew">
+        </el-table-column>
+        <!-- <el-table-column label="刻码" align="center" prop="engravingCode">
+        </el-table-column> -->
+        <!-- <el-table-column label="型号" align="center" prop="model">
+        </el-table-column> -->
+        <el-table-column label="规格" align="center" prop="specificationNew">
+        </el-table-column>
+
+        <el-table-column label="数量" align="center" prop="sumNew">
+          <template slot-scope="scope">
+            <el-form-item
+              label-width="0px"
+              :prop="'newPoList.' + scope.$index + '.sumNew'"
+            >
+              <el-input
+                v-model.number="scope.row.sumNew"
+                size="small"
+                oninput="value=value.replace(/[^\d]/g,'')"
+                style="width: 100%"
+                placeholder="输入数量"
+                @input="inputNumber(scope.row)"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </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)"
+            >
+              删除
+            </el-link>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-form>
+    <div class="add-product" @click="addEquipment" v-if="title == '返工返修'">
+      <i class="el-icon-circle-plus-outline"></i>
+    </div>
+
+    <template v-slot:footer>
+      <el-button @click="cancel">取消</el-button>
+
+      <el-button type="primary" @click="save" :loading="loading">
+        提交
+      </el-button>
+    </template>
+
+    <!-- 选择产品 -->
+    <EquipmentDialog ref="equipmentRefs" @choose="confirmChoose" :type="2">
+    </EquipmentDialog>
+  </ele-modal>
+</template>
+
+<script>
+import EquipmentDialog from './EquipmentDialog.vue';
+import {
+  getWarehouseList
+
+  // queryKilnXCH
+} from '@/api/mes';
+export default {
+  components: {
+    EquipmentDialog
+  },
+  data() {
+    return {
+      poList: [],
+      newPoList: [],
+      visible: false,
+      loading: false,
+      title: '返工返修',
+      originLong: '',
+      originHeight: '',
+      type: '',
+      warehouseList: []
+    };
+  },
+
+  computed: {},
+  created() {
+    getWarehouseList().then((res) => {
+      this.warehouseList = res;
+    });
+  },
+  methods: {
+    open(row, type) {
+      this.visible = true;
+      this.poList = row;
+      this.title = type == 1 ? '返工返修' : type == 2 ? '报废' : '试销品';
+      if (
+        !row[0].productName.includes('板材') &&
+        !row[0].productName.includes('砌块')
+      ) {
+        return;
+      }
+      this._calcVolume(this.poList[0].specification);
+    },
+    handleChangeDepot(row, item) {
+      row.depotName = item.name;
+    },
+    cancel() {
+      this.visible = false;
+    },
+    // 删除产品
+    handleDeleteItem(index, id) {
+      this.$confirm('确认删除吗?', '提示', {
+        confirmButtonText: '确定',
+        cancleButtonText: '取消',
+        type: 'warning'
+      })
+        .then((res) => {
+          this.newPoList.splice(index, 1);
+        })
+        .catch(() => {});
+    },
+    addEquipment() {
+      this.$refs.equipmentRefs.open();
+    },
+    /* 保存编辑 */
+    save() {
+      let isSumNew = true,
+        isDepotId = true;
+      let data = this.title == '返工返修' ? this.newPoList : this.poList;
+
+      data.forEach((item) => {
+        if (this.title == '返工返修' && !item.sumNew) {
+          isSumNew = false;
+        }
+        if (this.title != '返工返修' && !item.depotId) {
+          isDepotId = false;
+        }
+      });
+      if(data.length==0){
+        this.$alert('产品列表不能为空');
+        return;
+      }
+      if (!isSumNew) {
+        this.$alert('数量不能为空');
+        return;
+      }
+      if (!isDepotId) {
+        this.$alert('请选择入库仓库');
+        return;
+      }
+      this.$emit('success', data);
+      this.cancel();
+    },
+    // 封装计算体积方法
+    _calcVolume(string) {
+      let modelArr = string.split('*');
+      let originLong = Number(modelArr[0]);
+      let originWide = Number(modelArr[1]);
+      let originHeight = modelArr[2].substr(0, modelArr[2].indexOf('cm'));
+      this.originLong = originLong;
+      this.originHeight = originHeight;
+      return originLong * originWide * originHeight;
+    },
+    // 封装计算修补信息规格*块数的总体积
+    _calcModelVSWordcount() {
+      // 计算修补规格体积
+      let cutedVolume = 0;
+      let sumVolume = 0;
+      this.newPoList.map((item) => {
+        if (item.sumNew > 0 && item.specificationNew) {
+          cutedVolume =
+            this._calcVolume(item.specificationNew) * Number(item.sumNew);
+          sumVolume += cutedVolume;
+        }
+      });
+      return sumVolume;
+    },
+    // 输入块数计算规格体积是否超出原规格体积
+    inputNumber(row) {
+      if (
+        !row.productName.includes('板材') &&
+        !row.productName.includes('砌块')
+      ) {
+        return;
+      }
+      // 计算原规格体积
+      let originVolume = 0;
+      let sumVolume = 0;
+      originVolume = this._calcVolume(this.poList[0].specification);
+      console.log(originVolume, 'originVolume');
+      // 计算修补总体积
+      sumVolume = this._calcModelVSWordcount();
+      console.log(sumVolume, 'sumVolume');
+
+      if (sumVolume > originVolume) {
+        row.sumNew = 0;
+        this.$alert('修补规格总体积不能大于原规格体积!');
+      }
+    },
+    // 判断产品规格
+    modelChange(row) {
+      // 判断修补规格高度不能大于原规格高度
+      if (!row.name.includes('板材') && !row.name.includes('砌块')) {
+        return true;
+      }
+      let currentLong = Number(row.specification.split('*')[0]);
+      let currentHeight = row.specification.split('*')[2];
+      currentHeight = Number(
+        currentHeight.substr(0, currentHeight.indexOf('cm'))
+      );
+      if (currentLong > this.originLong) {
+        this.$alert('修补规格长度不能大于原规格长度!');
+        return false;
+      }
+      if (currentHeight > this.originHeight) {
+        this.$alert('修补规格高度不能大于原规格高度!');
+        return false;
+      }
+      return true;
+    },
+    // 确定选择
+    confirmChoose(data) {
+      console.log(data, 'data');
+      let list = [];
+      let is = true;
+      if (data.length > 0) {
+        list = JSON.parse(JSON.stringify(data)).map((item) => {
+          is = this.modelChange(item);
+          return {
+            productCodeNew: item.code,
+            productNameNew: item.name,
+            // productUnitWeight: item.netWeight,
+            // weightUnit: item.weightUnit,
+            specificationNew: item.specification,
+            sumNew: ''
+          };
+        });
+        if (!is) {
+          return;
+        }
+        this.newPoList = this.newPoList.concat(list);
+      }
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.basic-details-title {
+  margin: 10px 0;
+}
+.title {
+  font-size: 16px;
+  line-height: 45px;
+}
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
+
+.create-form .el-form-item {
+  // margin-bottom: 15px !important;
+}
+</style>

+ 147 - 0
src/views/unacceptedProduct/components/order-search.vue

@@ -0,0 +1,147 @@
+<!-- 搜索表单 -->
+<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: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="工单号:">
+          <el-input
+            clearable
+            v-model="where.workOrderId"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { 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: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="创建人:">
+          <el-input
+            clearable
+            v-model="where.reviewerName"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="创建时间:">
+          <el-date-picker
+            class="w100"
+            v-model="where.createTime"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="工序:">
+          <el-input
+            clearable
+            v-model="where.produceTaskName"
+            placeholder="请输入"
+          />
+        </el-form-item> </el-col
+      ><el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="状态:">
+         
+          <el-select v-model="where.status" style="width:100%">
+            <el-option
+              v-for="item in statusList"
+              :key="item.code"
+              :value="item.code"
+              :label="item.name"
+             
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label-width="0px">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
+            >重置</el-button
+          >
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  props: [],
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      productName: '',
+      status: '',
+      createTime: []
+    };
+    return {
+      // 表单数据
+      where: { ...defaultWhere },
+      statusList: [
+        {name:'待处理',code:0},
+        {name:'处理中',code:1},
+        {name:'已处理',code:2},
+      ],
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  watch: {},
+  created() {},
+  methods: {
+    /* 搜索 */
+    search() {
+      const where = { ...this.where };
+      if (where.createTime?.length) {
+        where.startTime = where.createTime[0];
+        where.endTime = where.createTime[1];
+      }
+      delete where.createTime;
+      this.$emit('search', where);
+    },
+    /*  重置 */
+    reset() {
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.ele-form-actions {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+}
+</style>

+ 142 - 0
src/views/unacceptedProduct/components/probationalGoods-search.vue

@@ -0,0 +1,142 @@
+<!-- 搜索表单 -->
+<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: 4, md: 12 } : { 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: 4, md: 12 } : { span: 4}">
+        <el-form-item label="批号:">
+          <el-input
+            clearable
+            v-model="where.batchNo"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品名称:">
+          <el-input
+            clearable
+            v-model="where.productName"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品编码:">
+          <el-input
+            clearable
+            v-model="where.productCode"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品规格:">
+          <el-input
+            clearable
+            v-model="where.specification"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+    
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="状态:">
+          
+          <el-select v-model="where.status" style="width:100%">
+            <el-option
+              v-for="item in statusList"
+              :key="item.code"
+              :value="item.code"
+              :label="item.name"
+             
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label-width="0px">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
+            >重置</el-button
+          >
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  props: [],
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      productName: '',
+      status: '',
+      createTime: []
+    };
+    return {
+      // 表单数据
+      where: { ...defaultWhere },
+      statusList: [
+        {name:'待处理',code:0},
+        {name:'处理中',code:1},
+        {name:'已处理',code:2},
+      ],
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  watch: {},
+  created() {},
+  methods: {
+    /* 搜索 */
+    search() {
+      const where = { ...this.where };
+      if (where.createTime?.length) {
+        where.startTime = where.createTime[0];
+        where.endTime = where.createTime[1];
+      }
+      delete where.createTime;
+      this.$emit('search', where);
+    },
+    /*  重置 */
+    reset() {
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.ele-form-actions {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+}
+</style>

+ 168 - 0
src/views/unacceptedProduct/components/rework-search.vue

@@ -0,0 +1,168 @@
+<!-- 搜索表单 -->
+<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: 4, md: 12 } : { 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: 4, md: 12 } : { span: 4}">
+        <el-form-item label="批号:">
+          <el-input
+            clearable
+            v-model="where.batchNo"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品名称:">
+          <el-input
+            clearable
+            v-model="where.productNameNew"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品编码:">
+          <el-input
+            clearable
+            v-model="where.productCodeNew"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="产品规格:">
+          <el-input
+            clearable
+            v-model="where.specificationNew"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="原产品名称:">
+          <el-input
+            clearable
+            v-model="where.productName"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="原产品编码:">
+          <el-input
+            clearable
+            v-model="where.productCode"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="原产品规格:">
+          <el-input
+            clearable
+            v-model="where.specification"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label="状态:">
+          
+          <el-select v-model="where.status" style="width:100%">
+            <el-option
+              v-for="item in statusList"
+              :key="item.code"
+              :value="item.code"
+              :label="item.name"
+             
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label-width="0px">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
+            >重置</el-button
+          >
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  props: [],
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      productName: '',
+      status: '',
+      createTime: []
+    };
+    return {
+      // 表单数据
+      where: { ...defaultWhere },
+      statusList: [
+        {name:'待处理',code:0},
+        {name:'处理中',code:1},
+        {name:'已处理',code:2},
+      ],
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  watch: {},
+  created() {},
+  methods: {
+    /* 搜索 */
+    search() {
+      const where = { ...this.where };
+      if (where.createTime?.length) {
+        where.startTime = where.createTime[0];
+        where.endTime = where.createTime[1];
+      }
+      delete where.createTime;
+      this.$emit('search', where);
+    },
+    /*  重置 */
+    reset() {
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.ele-form-actions {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+}
+</style>

+ 914 - 0
src/views/unacceptedProduct/components/salesToProduction.vue

@@ -0,0 +1,914 @@
+<template>
+  <el-dialog
+    :title="
+      type == 1
+        ? '返修返工转生产计划'
+        : type == 2
+        ? '返修返工转生产订单'
+        : '返修返工转生产工单'
+    "
+    :visible.sync="dialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="100%"
+  >
+    <div class="ele-body">
+      <el-card shadow="never">
+        <el-form
+          ref="form"
+          :model="form"
+          :rules="rules"
+          label-width="90px"
+          class="formbox"
+        >
+          <el-row :gutter="24">
+            <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+              <el-form-item label="计划类型:">
+                <DictSelection
+                  dictName="订单计划类型"
+                  clearable
+                  v-model="form.planType"
+                >
+                </DictSelection>
+              </el-form-item>
+            </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+              <el-form-item label="工艺路线:" prop="produceRoutingName">
+                <el-input
+                  @click.native="openVersion"
+                  placeholder="请选择工艺路线"
+                  readonly
+                  v-model="form.produceRoutingName"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 6 } : { span: 3 }">
+              <el-form-item label="使用改型:" prop="modification">
+                <el-checkbox
+                  v-model="form.modification"
+                  :true-label="1"
+                  :false-label="0"
+                ></el-checkbox>
+              </el-form-item>
+            </el-col>
+
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+              <el-form-item label="余量系数:" prop="marginCoefficient">
+              <!-- <DictSelection
+                @itemChange="itemChange"
+                style="width: 200px"
+                dictName="余量系数"
+                v-model="form.marginCoefficient"
+              ></DictSelection> -->
+              <el-select filterable allow-create @change="itemChange" v-model="form.marginCoefficient">
+                <el-option
+                  v-for="(item, index) in marginList"
+                  :key="index"
+                  :label="item.name"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+            </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+              <el-form-item label="原批号:">{{ form.oldBatchNo }}</el-form-item>
+            </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+              <el-form-item label="批号:" prop="batchNo">
+                <el-input
+                  v-model.number="form.batchNo"
+                  size="small"
+                  style="width: 100%"
+                  placeholder="请输入批号"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col
+              v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }"
+              v-if="type == 3"
+            >
+              <el-form-item label="班组:" prop="teamId">
+                <el-select v-model="form.teamId" @change="teamChange">
+                  <el-option
+                    v-for="item in teamList"
+                    :value="item.id"
+                    :key="item.id"
+                    :label="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="24" class="row-intro">
+            <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+              <el-form-item label="销售单数量:">{{
+                form.codeNum
+              }}</el-form-item>
+            </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+              <el-form-item label="订单总数量:">{{
+                form.contractNum
+              }}</el-form-item>
+            </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+              <el-form-item label="订单总重量:">{{
+                form.sumOrderWeight
+              }}</el-form-item>
+            </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+              <el-form-item label="产品编码:">{{
+                form.productCode
+              }}</el-form-item>
+            </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+              <el-form-item label="牌号:">{{ form.brandNo }}</el-form-item>
+            </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+              <el-form-item label="型号:">{{ form.model }}</el-form-item>
+            </el-col>
+
+            <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+              <el-form-item label="库存数量:">{{
+                form.stockCountBase
+              }}</el-form-item>
+            </el-col>
+          </el-row>
+          <el-table :data="form.salesOrders" border>
+            <el-table-column label="序号" align="center" width="60">
+              <template slot-scope="scope">
+                <span>{{ scope.$index + 1 }}</span>
+              </template>
+            </el-table-column>
+            <!-- <el-table-column
+              label="销售订单号"
+              align="center"
+              prop=""
+              width="120"
+              sortable
+            >
+            </el-table-column> -->
+            <!-- <el-table-column label="行号" align="center" prop="lineNumber">
+            </el-table-column> -->
+            <el-table-column
+              label="产品名称"
+              align="center"
+              prop="productNameNew"
+            >
+            </el-table-column>
+            <el-table-column label="合同数量" align="center" prop="contractNum">
+            </el-table-column>
+
+            <el-table-column
+              label="合同重量"
+              align="center"
+              prop="productSumWeight"
+            >
+              <template slot-scope="scope">
+                {{ scope.row.productSumWeight }} {{ form.weightUnit }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="规格"
+              align="center"
+              prop="specificationNew"
+            >
+            </el-table-column>
+            <el-table-column label="欠交数量" align="center" prop="lackNum">
+            </el-table-column>
+            <el-table-column
+              label="计划生产数量"
+              align="center"
+              prop="productNum"
+              width="140"
+            >
+              <template slot-scope="scope">
+                <el-form-item
+                  label-width="0px"
+                  :prop="'salesOrders.' + scope.$index + '.productNum'"
+                  :rules="{
+                    required: true,
+                    message: '请输入计划生产数量',
+                    trigger: 'blur'
+                  }"
+                  class="table-item"
+                >
+                  <el-input
+                    :disabled="isMoCount"
+                    v-model.number="scope.row.productNum"
+                    size="small"
+                    @input="
+                      tableHandleKeyUp(scope.row, scope.$index, $event, 'sum')
+                    "
+                    style="width: 100%"
+                    placeholder="输入数量"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="要求生产数量"
+              align="center"
+              prop="requiredFormingNum"
+              width="140"
+            >
+              <template slot-scope="scope">
+                <el-form-item
+                  label-width="0px"
+                  :prop="'salesOrders.' + scope.$index + '.requiredFormingNum'"
+                  :rules="{
+                    required: true,
+                    message: '请输入要求生产数量',
+                    trigger: 'blur'
+                  }"
+                  class="table-item"
+                >
+                  <el-input
+                    v-model.number="scope.row.requiredFormingNum"
+                    size="small"
+                    disabled
+                    style="width: 100%"
+                    placeholder="输入数量"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="模数"
+              align="center"
+              width="100"
+              v-if="isMoCount"
+            >
+              <template slot-scope="scope">
+                <div>
+                  <el-input
+                    disabled
+                    style="width: 100%"
+                    size="small"
+                    v-model="scope.row.moCount"
+                    oninput="value=value.replace(/[^0-9.]/g,'')"
+                    @input="
+                      tableHandleKeyUp(
+                        scope.row,
+                        scope.$index,
+                        $event,
+                        'moCount'
+                      )
+                    "
+                    placeholder="请输入"
+                  >
+                  </el-input>
+                </div>
+              </template>
+            </el-table-column>
+
+            <el-table-column align="center" width="100" v-if="isMoCount">
+              <template slot="header">
+                <span style="color: red">*</span>
+                <span>块数</span>
+              </template>
+              <template slot-scope="scope">
+                <el-form-item
+                  label-width="0px"
+                  :prop="'salesOrders.' + scope.$index + '.blockCount'"
+                  :rules="{
+                    required: true,
+                    message: '请输入块数',
+                    trigger: 'blur'
+                  }"
+                  class="table-item"
+                >
+                  <el-input
+                    size="small"
+                    style="width: 100%"
+                    oninput="value=value.replace(/[^0-9.]/g,'')"
+                    @input="
+                      tableHandleKeyUp(
+                        scope.row,
+                        scope.$index,
+                        $event,
+                        'blockCount'
+                      )
+                    "
+                    v-model="scope.row.blockCount"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="权重等级" align="center" width="120"   v-if="isMoCount">
+            <template slot-scope="scope">
+              <div>
+                <el-select v-model="scope.row.weight" style="width: 100%">
+                  <el-option
+                    v-for="item of weightList"
+                    :key="item.code"
+                    :label="item.name"
+                    :value="item.code"
+                  ></el-option>
+                </el-select>
+              </div>
+            </template>
+          </el-table-column>
+            <el-table-column
+              align="center"
+              width="120"
+              label="是否开槽"
+              v-if="isMoCount"
+            >
+              <template slot-scope="scope">
+                <div>
+                  <el-select
+                    style="width: 100%"
+                    v-model="scope.row.isSlotting"
+                    placeholder="请选择"
+                  >
+                    <el-option
+                      v-for="item of isSlotting"
+                      :key="item.code"
+                      :label="item.name"
+                      :value="item.code"
+                    />
+                  </el-select>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
+              width="120"
+              label="开槽类型"
+              v-if="isMoCount"
+            >
+              <template slot-scope="scope">
+                <DictSelection
+                  dictName="开槽类型"
+                  v-model="scope.row.slottingType"
+                  v-if="scope.row.isSlotting == 1"
+                >
+                </DictSelection>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="按单按库"
+              align="center"
+              prop="orderLibraryType"
+            >
+              <template slot-scope="{ row }">
+                {{ getDictValue('按单按库', row.orderLibraryType) }}
+              </template>
+            </el-table-column>
+            <el-table-column label="订单类型" align="center" prop="orderType">
+              <template slot-scope="{ row }">
+                <DictSelection
+                  dictName="订单类型"
+                  clearable
+                  v-model="row.orderType"
+                >
+                </DictSelection>
+              </template>
+            </el-table-column>
+
+            <el-table-column
+              label="交付日期"
+              align="center"
+              prop="deliveryTime"
+              width="160"
+            >
+            </el-table-column>
+            <el-table-column
+              label="要求生产日期"
+              align="center"
+              prop="reqMoldTime"
+              width="180"
+            >
+              <template slot-scope="scope">
+                <el-form-item
+                  label-width="0px"
+                  :prop="'salesOrders.' + scope.$index + '.reqMoldTime'"
+                  :rules="{
+                    required: true,
+                    message: '请选择要求生产日期',
+                    trigger: 'blur'
+                  }"
+                  class="table-item"
+                >
+                  <el-date-picker
+                    style="width: 100%"
+                    v-model="scope.row.reqMoldTime"
+                    :pickerOptions="{
+                      disabledDate: (time) =>
+                        time.getTime() <
+                        new Date(new Date().setHours(0, 0, 0, 0)).getTime()
+                    }"
+                    type="date"
+                    placeholder="选择日期"
+                    value-format="yyyy-MM-dd"
+                  >
+                  </el-date-picker>
+                  <!-- 	<el-date-picker
+						   style="width: 100%;"
+						   v-model="scope.row.reqMoldTime"
+						   type="datetime"
+						   placeholder="选择日期"
+						   value-format="yyyy-MM-dd HH:mm:ss">
+						 </el-date-picker> -->
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="客户名称"
+              align="center"
+              prop="customerName"
+            >
+            </el-table-column>
+            <el-table-column label="业务员" align="center" prop="salesman">
+            </el-table-column>
+            <el-table-column
+              label="交付要求"
+              align="center"
+              prop="deliveryRequirements"
+            >
+              <template slot-scope="{ row }">
+                {{ getDictValue('交付要求', row.deliveryRequirements) }}
+              </template>
+            </el-table-column>
+            <el-table-column
+            prop="priority"
+            label="优先级"
+            width="100"
+            align="center"
+            :min="0"
+            :max="10"
+          >
+            <template slot-scope="{ row, $index }">
+              <el-input
+                v-if="$index == 0"
+                v-model="row.priority"
+                type="number"
+                size="mini"
+                @change="priorityChange(row)"
+              ></el-input>
+              <el-popover
+                v-if="$index == 0"
+                placement="right"
+                width="200"
+                trigger="hover"
+                content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
+              >
+                <div class="sort-wrap" slot="reference">
+                  <i class="el-icon-caret-top" @click="sortTop(row)"></i>
+                  <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
+                </div>
+              </el-popover>
+            </template>
+          </el-table-column>
+          </el-table>
+
+          <el-row :gutter="24" style="margin-top: 15px">
+            <el-col
+              v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 24 }"
+            >
+              <el-form-item label="计划备注:">
+                <el-input
+                  type="textarea"
+                  :rows="4"
+                  v-model="form.notes"
+                  resize="none"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <!-- <AdditionalOrder
+          ref="additionalRefs"
+          :productCode="form.productCode"
+          :selectList="form.salesOrders"
+          @choose="confirmChoose"
+        ></AdditionalOrder> -->
+        <ProductionVersion
+          ref="versionRefs"
+          @changeProduct="changeProduct"
+        ></ProductionVersion>
+      </el-card>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="toSubmit">提交</el-button>
+      <el-button size="small" @click="handleClose">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+// import AdditionalOrder from './EquipmentDialog.vue';
+import ProductionVersion from '@/components/ProductionVersion/ProductionVersion.vue';
+import { transformation } from '@/api/unacceptedProduct/index';
+import { debounce } from 'lodash';
+import { getByCode } from '@/api/system/dictionary-data';
+
+import dictMixins from '@/mixins/dictMixins';
+import { getteampage } from '@/api/produceWord';
+import dayjs from 'dayjs';
+export default {
+  mixins: [dictMixins],
+  components: {
+    ProductionVersion
+  },
+  data() {
+    return {
+      dialog: false,
+      type: '',
+      teamList: [],
+      isMoCount: false,
+      weightList: [
+        { code: 1, name: 'A' },
+        { code: 2, name: 'B' },
+        { code: 3, name: 'C' }
+      ],
+      isSlotting: [
+        { code: 1, name: '是' },
+        { code: 2, name: '否' }
+      ], //是否开槽
+      form: {
+        planType: '',
+        produceRoutingId: '',
+        stockCountBase: '',
+        salesOrders: [],
+        produceRoutingName: '',
+        marginCoefficient: '1.0',
+        oldBatchNo: '',
+        batchNo: ''
+      },
+
+      // 表单验证规则
+      rules: {
+        produceRoutingName: [
+          { required: true, message: '请选择工艺路线', trigger: 'change' }
+        ]
+      },
+      // selection: [],
+      loading: false,
+      marginList: []
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  created() {
+    this.requestDict('按单按库');
+    this.requestDict('订单类型');
+    this.requestDict('交付要求');
+    this._teamPage();
+    this.getByCodeFn();
+  },
+  methods: {
+    async _teamPage() {
+      const res = await getteampage({
+        page: 1,
+        size: -1
+      });
+
+      this.teamList = res.list;
+    },
+    getByCodeFn() {
+      getByCode('margin_code').then((res) => {
+        let _arr = [];
+        res.data.map((item) => {
+          const key = Object.keys(item)[0];
+          const value = item[key];
+
+          _arr.push({ name: key, value: value });
+        });
+        console.log(_arr)
+        this.marginList = _arr;
+      });
+    },
+    open(row, type) {
+      this.type = type;
+      this.dialog = true;
+      let contractNum=0
+      let data = JSON.parse(JSON.stringify(row));
+      data.forEach((item) => {
+        if (
+          item.productNameNew.includes('板材') ||
+          item.productNameNew.includes('砌块')
+        ) {
+          this.isMoCount = true;
+          item.blockCount = item.sumNew;
+          this.tableHandleKeyUp(item, '', item.blockCount, 'blockCount');
+        } else {
+          item.contractNum = item.sumNew;
+          item.lackNum = item.sumNew;
+          item['productNum'] = item.sumNew;
+          item.requiredFormingNum = item.sumNew;
+          contractNum+=Number(item.sumNew)
+        }
+      });
+      this.form.oldBatchNo = data[0].batchNo;
+      this.form.contractNum = contractNum
+      this.form.productCode = data[0].productCodeNew;
+      this.form.brandNo = data[0].brandNo;
+      this.form.model = data[0].model;
+      this.form.salesOrders = data;
+    },
+
+    itemChange() {
+      this.form.salesOrders.map((item, index) => {
+        this.$set(
+          item,
+          'requiredFormingNum',
+          item.productNum * (this.form.marginCoefficient || 1)
+        );
+      });
+    },
+    teamChange(id) {
+      this.form.teamName = this.teamList.find((item) => (item.id = id)).name;
+    },
+    toInt(productNum) {
+      return productNum * (this.form.marginCoefficient || 1);
+    },
+
+    handleClose() {
+      this.dialog = false;
+      this.isMoCount=false
+      this.$refs.form= {
+        planType: '',
+        produceRoutingId: '',
+        stockCountBase: '',
+        salesOrders: [],
+        produceRoutingName: '',
+        marginCoefficient: '1.0',
+        oldBatchNo: '',
+        batchNo: ''
+      }
+    },
+
+     toSubmit() {
+      this.$refs.form.validate(async (valid) => {
+       if(valid){
+        let data = JSON.parse(JSON.stringify(this.form.salesOrders));
+      data.forEach((item) => {
+        item.produceRoutingId = this.form.produceRoutingId;
+        item.notes = this.form.notes;
+        item.planType = this.form.planType;
+        item.produceRoutingName = this.form.produceRoutingName;
+        item.teamName = this.form.teamName;
+        item.teamId = this.form.teamId;
+        item.batchNo = this.form.batchNo;
+        item.productName = item.productNameNew;
+        item.productCode = item.productCodeNew;
+        item.specification = item.specificationNew;
+      });
+      // console.log(data)
+      // return
+      const res = await transformation(data, this.type);
+      if (res.code == 0) {
+        this.handleClose();
+        this.$emit('success');
+      }
+       }
+      });
+  
+    },
+
+    sortTop(row) {
+      row.priority = Number(row.priority) + 1;
+      this.priorityChange(row);
+    },
+    sortBottom(row) {
+      if (row.priority <= 1) {
+        return;
+      }
+      row.priority = Number(row.priority) - 1;
+      this.priorityChange(row);
+    },
+
+    priorityChange(row) {
+      if (row.priority > 10) {
+        row.priority = 10; // 如果大于 10,则设置为 10
+      } else if (row.priority < 0) {
+        row.priority = 0; // 如果小于 0,则设置为 0
+      }
+
+      this.priorityFn(row);
+    },
+
+    priorityFn: debounce(function (row) {}, 800),
+
+    openVersion() {
+      this.$refs.versionRefs.open();
+    },
+    changeProduct(data) {
+      this.$set(this.form, 'produceRoutingName', data.name);
+      this.$set(this.form, 'produceRoutingId', data.id);
+      this.$set(this.form, 'produceVersionName', data.produceVersionName);
+    },
+    // 表格:模数、数量(方)、块数输入框 输入事件
+    tableHandleKeyUp(row, index, e, name) {
+      row.requiredFormingNum = this.toInt(row.productNum);
+      if (!this.isMoCount) {
+        return;
+      }
+      // console.log(row);
+      let modelArr = row.specificationNew.split('*');
+      let modelLong = modelArr[0]; // model规格长度
+      let modeWide = modelArr[1]; // model规格宽度
+      let modeHight = modelArr[2].substr(0, modelArr[2].indexOf('cm')); // model规格高度
+      modeHight = Number(modeHight);
+      if (name === 'moCount') {
+        // 模数
+        row.moCount = e;
+        // 计算块数的公式:
+        // (一模6米长度 / model规格长度) * (一模1.2米宽度 / model规格宽度) = 每一模的块数
+        // 每一模的块数*模数moCount = 总块数
+        if (row.productNameNew.includes('板材')) {
+          row.blockCount =
+            Math.floor(600 / modelLong) *
+            Math.floor(120 / modeHight) *
+            Math.floor(60 / modeWide) *
+            row.moCount;
+        } else if (row.productNameNew.includes('砌块')) {
+          let modelLongFixed = (600 / modelLong).toFixed(2);
+          modelLongFixed = modelLongFixed.substring(
+            0,
+            modelLongFixed.length - 1
+          );
+          let modeWideFixed = (120 / modeWide).toFixed(2);
+          modeWideFixed = modeWideFixed.substring(0, modeWideFixed.length - 1);
+          let modeHightFixed = (60 / modeHight).toFixed(2);
+          modeHightFixed = modeHightFixed.substring(
+            0,
+            modeHightFixed.length - 1
+          );
+          row.blockCount =
+            Math.floor(modelLongFixed * modeWideFixed * modeHightFixed) *
+            row.moCount;
+        }
+
+        row.productNum =
+          ((modelLong * modeWide * modeHight) / 1000000).toFixed(5) *
+          row.blockCount;
+      } else if (name === 'sum') {
+        //方数
+        row.productNum = e;
+
+        row.blockCount = Math.floor(
+          e / ((modelLong * modeWide * modeHight) / 1000000)
+        );
+        // console.log(e,'row.blockCount')
+        // console.log(modelLong,'row.blockCount')
+        // console.log(modeWide,'row.blockCount')
+        // console.log(modeHight,'row.blockCount')
+
+        if (row.productNameNew.includes('板材')) {
+          row.moCount = Math.ceil(
+            row.blockCount /
+              (Math.floor(600 / modelLong) *
+                Math.floor(120 / modeHight) *
+                Math.floor(60 / modeWide))
+          );
+        } else if (row.productNameNew.includes('砌块')) {
+          row.moCount = Math.ceil(
+            row.blockCount /
+              Math.floor(
+                (600 / modelLong) * (120 / modeHight) * (60 / modeWide)
+              )
+          );
+        }
+      } else if (name === 'blockCount') {
+        //块数
+        row.blockCount = e;
+
+        if (row.productNameNew.includes('板材')) {
+          row.moCount = Math.ceil(
+            row.blockCount /
+              (Math.floor(600 / modelLong) *
+                Math.floor(120 / modeHight) *
+                Math.floor(60 / modeWide))
+          );
+        } else if (row.productNameNew.includes('砌块')) {
+          row.moCount = Math.ceil(
+            row.blockCount /
+              Math.floor(
+                (600 / modelLong) * (120 / modeHight) * (60 / modeWide)
+              )
+          );
+        }
+
+        row.productNum = (
+          (Number(e) * modelLong * modeWide * modeHight) /
+          1000000
+        ).toFixed(5);
+      }
+      row.requiredFormingNum = this.toInt(row.productNum);
+    }
+    // confirmChoose(list) {
+    //   // 取出在弹窗中选中并且不在表格中的数据
+    //   const result = list.filter(
+    //     (i) => this.form.salesOrders.findIndex((p) => p.id === i.id) === -1
+    //   );
+    //   // 取出在表格中并且不在弹窗中选中的数据 即取消选中的数据
+    //   const del = this.form.salesOrders.filter(
+    //     (i) => list.findIndex((p) => p.id === i.id) === -1
+    //   );
+    //   for (let i = this.form.salesOrders.length - 1; i >= 0; i--) {
+    //     for (let j in del) {
+    //       if (this.form.salesOrders[i].id === del[j].id) {
+    //         this.form.salesOrders.splice(i, 1);
+    //       }
+    //     }
+    //   }
+    //   let priority =
+    //     this.form.salesOrders[this.form.salesOrders.length - 1]?.priority || 0;
+    //   this.form.salesOrders = this.form.salesOrders.concat(
+    //     result.map((item, index) => {
+    //       item.priority = ++priority;
+
+    //       item.productNum = item.lackNum;
+    //       item.requiredFormingNum = item.lackNum;
+    //       item.reqMoldTime = dayjs(
+    //         new Date(item.deliveryTime).getTime() - 3600 * 1000 * 24 * 10
+    //       ).format('YYYY-MM-DD');
+    //       return item;
+    //     })
+    //   );
+    //   this.changeData();
+    // },
+    // changeData() {
+    //   var productNum = 0;
+    //   var productWeight = 0;
+
+    //   this.form.salesOrders.map((item, index) => {
+    //     item.priority = index + 1;
+    //     productNum = productNum + item.requiredFormingNum;
+    //     productWeight = productWeight + Number(item.productSumWeight);
+    //   });
+    //   this.$set(this.form, 'codeNum', this.form.salesOrders.length);
+    //   this.$set(this.form, 'contractNum', productNum);
+    //   this.$set(this.form, 'sumOrderWeight', productWeight.toFixed(2));
+    // },
+  }
+};
+</script>
+<style lang="scss" scoped>
+.ele-body {
+  background: #fff;
+}
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+.body-title {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.title-left {
+  font-size: 20px;
+  color: #333;
+}
+
+.formbox {
+  margin: 20px auto;
+}
+
+.row-intro {
+  border-bottom: 1px dashed #ccc;
+  margin-bottom: 20px;
+}
+
+.sort-wrap {
+  i {
+    font-size: 30px;
+    cursor: pointer;
+  }
+
+  .el-icon-caret-top {
+    color: red;
+  }
+
+  .el-icon-caret-bottom {
+    color: #157a2c;
+  }
+}
+
+.add-product {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  font-size: 30px;
+  color: #1890ff;
+  margin: 10px 0;
+  cursor: pointer;
+}
+
+.table-item {
+  margin-bottom: 0;
+}
+</style>

+ 308 - 0
src/views/unacceptedProduct/detail.vue

@@ -0,0 +1,308 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <order-search @search="getList" ref="searchRef"> </order-search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+      >
+        <!-- 操作列 -->
+        <template v-slot:toolbar>
+          <el-button
+            type="primary"
+            slot="reference"
+            :disabled="selection.length == 0"
+            @click="disposeList(1)"
+            >批量处置</el-button
+          >
+
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove"
+            style="margin-left: 10px"
+          >
+            <template v-slot:reference>
+              <el-button :disabled="selection.length == 0" type="danger"
+                >批量删除</el-button
+              >
+            </template>
+          </el-popconfirm>
+        </template>
+        <template v-slot:action="{ row }">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            v-if="row.status == 0"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+          <el-link
+            slot="reference"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            v-if="row.status == 0"
+            @click="disposeList(2, row)"
+          >
+            处置
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <el-dialog :visible.sync="dialogVisible" width="10%" @close="close">
+      <DictSelection
+        dictName="不良品处理类型"
+        :filterArr="all ? ['返工返修'] : []"
+        v-model="disposeType"
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消 </el-button>
+        <el-button type="primary" @click="dispose()">确 定</el-button>
+      </span>
+    </el-dialog>
+    <Edit ref="edit" @success="save" />
+  </div>
+</template>
+
+<script>
+import OrderSearch from './components/detail-search.vue';
+import Edit from './components/edit.vue';
+
+import dictMixins from '@/mixins/dictMixins';
+import { unacceptedProductStatus } from '@/utils/util';
+
+import {
+  getDetail,
+  deleteUnacceptedProductDetail,
+  dispose
+} from '@/api/unacceptedProduct/index';
+export default {
+  components: {
+    OrderSearch,
+    Edit
+  },
+  mixins: [dictMixins],
+  data() {
+    return {
+      loading: false,
+      selection: [],
+      datasource: [],
+      disposeType: '',
+      dialogVisible: false,
+      current: null,
+      all: false
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      return [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          selectable: (row, index) => {
+            return row.status == 0; //
+          }
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '编码',
+          align: 'center'
+        },
+        {
+          prop: 'workOrderId',
+          label: '工单号',
+          align: 'center'
+        },
+        {
+          prop: 'batchNo',
+          label: '批号',
+          align: 'center'
+        },
+        {
+          prop: 'engravingCode',
+          label: '刻码',
+          align: 'center'
+        },
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center'
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center'
+        },
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center'
+        },
+
+        {
+          prop: 'unqualifiedQuantity',
+          label: '数量',
+          align: 'center',
+          width: 60
+        },
+        {
+          prop: 'produceRoutingName',
+          label: '工艺路线',
+          align: 'center'
+        },
+        {
+          prop: 'produceTaskName',
+          label: '工序',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedReason',
+          label: '原因',
+          align: 'center'
+        },
+
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          width: 160
+        },
+        {
+          prop: 'reviewerName',
+          label: '创建人',
+          align: 'center'
+        },
+        {
+          prop: 'type',
+          label: '处置类型',
+          align: 'center',
+          // slot: 'SlottingType'
+          formatter: (row, column, cellValue) => {
+            return this.getDictValue('不良品处理类型', cellValue + '');
+          }
+        },
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return unacceptedProductStatus(cellValue);
+          }
+        },
+
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          resizable: false,
+          fixed: 'right',
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ];
+    }
+  },
+  created() {
+    this.getList();
+  },
+
+  methods: {
+    getList() {
+      getDetail(this.$route.query.id).then((res) => {
+        this.datasource = res;
+      });
+    },
+    // /* 表格数据源 */
+    // async datasource({ page, limit, where }) {
+    //   const result = await getDetail(this.$route.query.id);
+    //   console.log(result, 'result');
+    //   return {
+    //     list: result,
+    //     count: result.length
+    //   };
+    // },
+    remove(row) {
+      let ids = row ? [row.id] : this.selection.map((item) => item.id);
+      deleteUnacceptedProductDetail(ids).then((res) => {
+        this.$message.success('删除' + res);
+        this.getList();
+      });
+    },
+    close() {
+      this.all = false;
+    },
+    // // 处置
+    disposeList(type, row) {
+      if (type == 1) {
+        this.all = true;
+      } else {
+        this.current = row;
+      }
+      this.dialogVisible = true;
+      // let ids = this.current ? [this.current.id] : this.selection.map((item) => item.id);
+    },
+    async dispose() {
+      if (!this.disposeType) {
+        return;
+      }
+      this.dialogVisible = false;
+      this.$refs.edit.open([this.current], this.disposeType);
+    },
+    async save(data) {
+      // console.log(data)
+      // return
+      if (data && data.length > 0) {
+        data.forEach((item) => {
+          item['fid'] = this.current.id;
+        });
+      }
+      let ids =
+        this.disposeType == 1 ? [this.current.id] : data.map((item) => item.id);
+      await dispose({
+        id: ids,
+        disposeType: Number(this.disposeType),
+        poList: data
+      });
+      this.dialogVisible = false;
+      this.current = null;
+      this.$message.success('处置成功!');
+      this.getList();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.unacceptedProductSelect {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+</style>

+ 225 - 0
src/views/unacceptedProduct/index.vue

@@ -0,0 +1,225 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <order-search @search="reload" ref="searchRef"> </order-search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        
+      >
+   
+ 
+        <!-- 操作列 -->
+        <template v-slot:toolbar>
+          <el-button type="success" @click="open()">新建</el-button>
+        </template>
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-truck"
+            v-if="row.status == 0"
+            @click="open(row)"
+          >
+            编辑
+          </el-link>
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            v-if="row.status == 0"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="detail(row)"
+          >
+            处置
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <Create ref="create" @refresh="reload" />
+  </div>
+</template>
+
+<script>
+import OrderSearch from './components/order-search.vue';
+import dictMixins from '@/mixins/dictMixins';
+import { unacceptedProductStatus } from '@/utils/util';
+import Create from './components/create';
+
+import { getList,deleteUnacceptedProduct } from '@/api/unacceptedProduct/index';
+export default {
+  components: {
+    OrderSearch,
+    Create
+  },
+  mixins: [dictMixins],
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      releasParams: {
+        teamId: '',
+        id: ''
+      },
+
+      current: null
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      return [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '编码',
+          align: 'center'
+        },
+        {
+          prop: 'workOrderId',
+          label: '工单号',
+          align: 'center'
+        },
+        {
+          prop: 'batchNo',
+          label: '批号',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedQuantity',
+          label: '数量',
+          align: 'center'
+        },
+        {
+          prop: 'produceRoutingName',
+          label: '工艺路线',
+          align: 'center'
+        },
+        {
+          prop: 'produceTaskName',
+          label: '工序',
+          align: 'center'
+        },
+    
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center'
+        },
+        {
+          prop: 'reviewerName',
+          label: '创建人',
+          align: 'center'
+        },
+        // {
+        //   prop: 'slottingType',
+        //   label: '状态',
+        //   align: 'center',
+        //   slot: 'SlottingType'
+        // },
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return unacceptedProductStatus(cellValue);
+          }
+        },
+
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 240,
+          align: 'center',
+          resizable: false,
+          fixed: 'right',
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ];
+    }
+  },
+  created() {
+  },
+  filters: {
+
+  },
+  methods: {
+    //处置
+    detail(row) {
+      this.$router.push({
+        path: '/unacceptedProduct/detailList',
+        query: {
+          id: row.id
+        }
+      });
+    },
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      return getList({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+    open(row) {
+      this.$refs.create.open(row?JSON.parse(JSON.stringify(row)):'');
+    },
+    remove(row) {
+      deleteUnacceptedProduct(row.id).then((res) => {
+        this.$message.success('删除'+res);
+        this.reload();
+      });
+    },
+    // // 下达
+    // toRelease(row) {
+    //   this.current = row;
+    //   this.visible = true;
+    // },
+    // // 下达
+    // confirm(row) {
+    //   this.$confirm('确认下发选中的任务吗?', '提示', {
+    //     confirmButtonText: '确定',
+    //     cancleButtonText: '取消',
+    //     type: 'warning'
+    //   })
+    //     .then(async () => {
+    //       const res = await issuedPutMeshWorkOrder({
+    //         id: [row.id],
+    //         status: 1
+    //       });
+    //       this.$message.success('任务下发成功!');
+    //       this.reload();
+    //     })
+    //     .catch(() => {});
+    // },
+    /* 刷新表格 */
+    reload(where) {
+      this.$nextTick(() => {
+        this.$refs.table.reload({ page: 1, where });
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 277 - 0
src/views/unacceptedProduct/probationalGoods/index.vue

@@ -0,0 +1,277 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <order-search @search="reload" ref="searchRef"> </order-search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+      >
+        <!-- 操作列 -->
+        <!-- <template v-slot:toolbar>
+          <el-button
+              type="primary"
+              slot="reference"
+              :disabled="selection.length == 0"
+              @click="dialogVisible=true"
+              >批量处置</el-button
+            >
+
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove"
+          >
+            <template v-slot:reference>
+              <el-button :disabled="selection.length == 0" type="danger"
+                >批量删除</el-button
+              >
+            </template>
+          </el-popconfirm>
+        </template> -->
+        <template v-slot:action="{ row }">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            v-if="row.status==1"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+          <el-link
+            slot="reference"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            v-if="row.status == 0"
+            @click="disposeList(row)"
+          >
+            处置
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <SalesToProduction ref="salesToProductionRef" @success="reload" />
+  </div>
+</template>
+
+<script>
+import OrderSearch from '../components/probationalGoods-search.vue';
+import SalesToProduction from '../components/salesToProduction.vue';
+import dictMixins from '@/mixins/dictMixins';
+
+import { trialProducts, deleteTrialProducts } from '@/api/unacceptedProduct/index';
+export default {
+  components: {
+    OrderSearch,
+    SalesToProduction
+  },
+  mixins: [dictMixins],
+  data() {
+    return {
+      loading: false,
+      dialogVisible: false,
+      current: null,
+      selection: [],
+      disposeType: '',
+      releasParams: {
+        teamId: '',
+        id: ''
+      }
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      return [
+        // {
+        //   width: 45,
+        //   type: 'selection',
+        //   columnKey: 'selection',
+        //   align: 'center',
+        //   // selectable: (row, index) => {
+        //   //   return row.status == 1; //
+        //   // }
+        // },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          width: 160,
+          label: '编码',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedProductsCode',
+          label: '不合格品编码',
+          align: 'center'
+        },
+        {
+          prop: 'batchNo',
+          label: '批号',
+          align: 'center'
+        },
+        {
+          prop: 'engravingCode',
+          label: '刻码',
+          align: 'center'
+        },
+     
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center'
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '产品规格',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedQuantity',
+          label: '数量',
+          align: 'center',
+          width: 60
+        },
+        {
+          prop: 'produceRoutingName',
+          label: '工艺路线',
+          align: 'center'
+        },
+        {
+          prop: 'produceTaskName',
+          label: '工序',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedReason',
+          label: '原因',
+          align: 'center'
+        },
+
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          width: 160
+        },
+        {
+          prop: 'reviewerName',
+          label: '创建人',
+          align: 'center'
+        },
+        {
+          prop: 'depotName',
+          label: '仓库名称',
+          align: 'center',
+       
+        },
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return cellValue==0?'未入库':cellValue==1?'已入库':''
+          }
+        },
+
+        // {
+        //   columnKey: 'action',
+        //   label: '操作',
+        //   width: 150,
+        //   align: 'center',
+        //   resizable: false,
+        //   fixed: 'right',
+        //   slot: 'action',
+        //   showOverflowTooltip: true
+        // }
+      ];
+    }
+  },
+  created() {},
+  filters: {},
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      return trialProducts({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+    remove(row) {
+      let ids = row ? [row.id] : this.selection.map((item) => item.id);
+      deleteTrialProducts(ids).then((res) => {
+        this.$message.success('删除' + res);
+        this.reload();
+      });
+    },
+    open(type) {
+      let isCode = true,
+        isBatchNo = true;
+      this.selection.forEach((item) => {
+        this.selection.forEach((item1) => {
+          if (item.productCodeNew != item1.productCodeNew) {
+            isCode = false;
+          }
+          if (item.batchNo != item1.batchNo) {
+            isBatchNo = false;
+          }
+        });
+      });
+      if (!isCode) {
+        this.$message.error('产品编码不一致!');
+        return;
+      }
+      if (!isBatchNo) {
+        this.$message.error('批号不一致!');
+        return;
+      }
+      this.$refs.salesToProductionRef.open(this.selection,type);
+    },
+    async disposeList(row) {
+      if (row && row.id) {
+        this.current = row;
+        this.dialogVisible = true;
+        return;
+      }
+      let ids = this.current
+        ? [this.current.id]
+        : this.selection.map((item) => item.id);
+      await dispose({
+        id: ids,
+        disposeType: Number(this.disposeType)
+      });
+      this.dialogVisible = false;
+      this.current = null;
+      this.$message.success('处置成功!');
+      this.getList();
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$nextTick(() => {
+        this.$refs.table.reload({ page: 1, where });
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 277 - 0
src/views/unacceptedProduct/refuseManagement/index.vue

@@ -0,0 +1,277 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <order-search @search="reload" ref="searchRef"> </order-search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+      >
+        <!-- 操作列 -->
+        <!-- <template v-slot:toolbar>
+          <el-button
+              type="primary"
+              slot="reference"
+              :disabled="selection.length == 0"
+              @click="dialogVisible=true"
+              >批量处置</el-button
+            >
+
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove"
+          >
+            <template v-slot:reference>
+              <el-button :disabled="selection.length == 0" type="danger"
+                >批量删除</el-button
+              >
+            </template>
+          </el-popconfirm>
+        </template> -->
+        <template v-slot:action="{ row }">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            v-if="row.status==1"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+          <el-link
+            slot="reference"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            v-if="row.status == 0"
+            @click="disposeList(row)"
+          >
+            处置
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <SalesToProduction ref="salesToProductionRef" @success="reload" />
+  </div>
+</template>
+
+<script>
+import OrderSearch from '../components/probationalGoods-search.vue';
+import SalesToProduction from '../components/salesToProduction.vue';
+import dictMixins from '@/mixins/dictMixins';
+
+import { scrapProducts, deleteScrapProducts } from '@/api/unacceptedProduct/index';
+export default {
+  components: {
+    OrderSearch,
+    SalesToProduction
+  },
+  mixins: [dictMixins],
+  data() {
+    return {
+      loading: false,
+      dialogVisible: false,
+      current: null,
+      selection: [],
+      disposeType: '',
+      releasParams: {
+        teamId: '',
+        id: ''
+      }
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      return [
+        // {
+        //   width: 45,
+        //   type: 'selection',
+        //   columnKey: 'selection',
+        //   align: 'center',
+        //   // selectable: (row, index) => {
+        //   //   return row.status == 1; //
+        //   // }
+        // },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          width: 160,
+          label: '编码',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedProductsCode',
+          label: '不合格品编码',
+          align: 'center'
+        },
+        {
+          prop: 'batchNo',
+          label: '批号',
+          align: 'center'
+        },
+        {
+          prop: 'engravingCode',
+          label: '刻码',
+          align: 'center'
+        },
+     
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center'
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '产品规格',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedQuantity',
+          label: '数量',
+          align: 'center',
+          width: 60
+        },
+        {
+          prop: 'produceRoutingName',
+          label: '工艺路线',
+          align: 'center'
+        },
+        {
+          prop: 'produceTaskName',
+          label: '工序',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedReason',
+          label: '原因',
+          align: 'center'
+        },
+
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          width: 160
+        },
+        {
+          prop: 'reviewerName',
+          label: '创建人',
+          align: 'center'
+        },
+        {
+          prop: 'depotName',
+          label: '仓库名称',
+          align: 'center',
+       
+        },
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return cellValue==0?'未入库':cellValue==1?'已入库':''
+          }
+        },
+
+        // {
+        //   columnKey: 'action',
+        //   label: '操作',
+        //   width: 150,
+        //   align: 'center',
+        //   resizable: false,
+        //   fixed: 'right',
+        //   slot: 'action',
+        //   showOverflowTooltip: true
+        // }
+      ];
+    }
+  },
+  created() {},
+  filters: {},
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      return scrapProducts({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+    remove(row) {
+      let ids = row ? [row.id] : this.selection.map((item) => item.id);
+      deleteScrapProducts(ids).then((res) => {
+        this.$message.success('删除' + res);
+        this.reload();
+      });
+    },
+    open(type) {
+      let isCode = true,
+        isBatchNo = true;
+      this.selection.forEach((item) => {
+        this.selection.forEach((item1) => {
+          if (item.productCodeNew != item1.productCodeNew) {
+            isCode = false;
+          }
+          if (item.batchNo != item1.batchNo) {
+            isBatchNo = false;
+          }
+        });
+      });
+      if (!isCode) {
+        this.$message.error('产品编码不一致!');
+        return;
+      }
+      if (!isBatchNo) {
+        this.$message.error('批号不一致!');
+        return;
+      }
+      this.$refs.salesToProductionRef.open(this.selection,type);
+    },
+    async disposeList(row) {
+      if (row && row.id) {
+        this.current = row;
+        this.dialogVisible = true;
+        return;
+      }
+      let ids = this.current
+        ? [this.current.id]
+        : this.selection.map((item) => item.id);
+      await dispose({
+        id: ids,
+        disposeType: Number(this.disposeType)
+      });
+      this.dialogVisible = false;
+      this.current = null;
+      this.$message.success('处置成功!');
+      this.getList();
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$nextTick(() => {
+        this.$refs.table.reload({ page: 1, where });
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 307 - 0
src/views/unacceptedProduct/rework/index.vue

@@ -0,0 +1,307 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <order-search @search="reload" ref="searchRef"> </order-search>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+      >
+        <!-- 操作列 -->
+        <template v-slot:toolbar>
+          <el-button
+            type="primary"
+            slot="reference"
+            :disabled="selection.length == 0"
+            @click="open(1)"
+            >转生产计划</el-button
+          >
+          <el-button
+            type="primary"
+            slot="reference"
+            :disabled="selection.length == 0"
+            @click="open(2)"
+            >转生产订单</el-button
+          >
+          <el-button
+            type="primary"
+            slot="reference"
+            :disabled="selection.length == 0"
+            @click="open(3)"
+            >转生产工单</el-button
+          >
+
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove"
+          >
+            <template v-slot:reference>
+              <el-button :disabled="selection.length == 0" type="danger"
+                >批量删除</el-button
+              >
+            </template>
+          </el-popconfirm>
+        </template>
+        <template v-slot:action="{ row }">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            v-if="row.status==1"
+            @confirm="remove(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+          <!-- <el-link
+            slot="reference"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            v-if="row.status == 0"
+            @click="disposeList(row)"
+          >
+            处置
+          </el-link> -->
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <SalesToProduction ref="salesToProductionRef" @success="reload" />
+  </div>
+</template>
+
+<script>
+import OrderSearch from '../components/rework-search.vue';
+import SalesToProduction from '../components/salesToProduction.vue';
+import dictMixins from '@/mixins/dictMixins';
+import { reworkStatus } from '@/utils/util';
+
+import { getReworkList, deleteReworkList } from '@/api/unacceptedProduct/index';
+export default {
+  components: {
+    OrderSearch,
+    SalesToProduction
+  },
+  mixins: [dictMixins],
+  data() {
+    return {
+      loading: false,
+      dialogVisible: false,
+      current: null,
+      selection: [],
+      disposeType: '',
+      releasParams: {
+        teamId: '',
+        id: ''
+      }
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      return [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          selectable: (row, index) => {
+            return row.status == 1; //
+          }
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '编码',
+          align: 'center'
+        },
+        {
+          prop: 'unqualifiedProductsCode',
+          label: '不合格品编码',
+          align: 'center'
+        },
+        {
+          prop: 'batchNo',
+          label: '批号',
+          align: 'center'
+        },
+        {
+          prop: 'engravingCode',
+          label: '刻码',
+          align: 'center'
+        },
+        {
+          prop: 'productNameNew',
+          label: '产品名称',
+          align: 'center'
+        },
+        {
+          prop: 'productCodeNew',
+          label: '产品编码',
+          align: 'center'
+        },
+        {
+          prop: 'specificationNew',
+          label: '产品规格',
+          align: 'center'
+        },
+        {
+          prop: 'sumNew',
+          label: '数量',
+          align: 'center',
+          width: 60
+        },
+        {
+          prop: 'productName',
+          label: '原产品名称',
+          align: 'center'
+        },
+        {
+          prop: 'productCode',
+          label: '原产品编码',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '原产品规格',
+          align: 'center'
+        },
+        // {
+        //   prop: 'produceRoutingName',
+        //   label: '工艺路线',
+        //   align: 'center'
+        // },
+        // {
+        //   prop: 'produceTaskName',
+        //   label: '工序',
+        //   align: 'center'
+        // },
+        {
+          prop: 'unqualifiedReason',
+          label: '原因',
+          align: 'center'
+        },
+
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          width: 160
+        },
+        {
+          prop: 'reviewerName',
+          label: '创建人',
+          align: 'center'
+        },
+        {
+          prop: 'disposalType',
+          label: '处置类型',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return cellValue==1?'转生产计划':cellValue==2?'生产订单':cellValue==3?'生产工单':''
+          }
+        },
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return reworkStatus(cellValue);
+          }
+        },
+
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          resizable: false,
+          fixed: 'right',
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ];
+    }
+  },
+  created() {},
+  filters: {},
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      return getReworkList({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+    remove(row) {
+      let ids = row ? [row.id] : this.selection.map((item) => item.id);
+      deleteReworkList(ids).then((res) => {
+        this.$message.success('删除' + res);
+        this.reload();
+      });
+    },
+    open(type) {
+      let isCode = true,
+        isBatchNo = true;
+      this.selection.forEach((item) => {
+        this.selection.forEach((item1) => {
+          if (item.productCodeNew != item1.productCodeNew) {
+            isCode = false;
+          }
+          if (item.batchNo != item1.batchNo) {
+            isBatchNo = false;
+          }
+        });
+      });
+      if (!isCode) {
+        this.$message.error('产品编码不一致!');
+        return;
+      }
+      if (!isBatchNo) {
+        this.$message.error('批号不一致!');
+        return;
+      }
+      this.$refs.salesToProductionRef.open(this.selection,type);
+    },
+    async disposeList(row) {
+      if (row && row.id) {
+        this.current = row;
+        this.dialogVisible = true;
+        return;
+      }
+      let ids = this.current
+        ? [this.current.id]
+        : this.selection.map((item) => item.id);
+      await dispose({
+        id: ids,
+        disposeType: Number(this.disposeType)
+      });
+      this.dialogVisible = false;
+      this.current = null;
+      this.$message.success('处置成功!');
+      this.getList();
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$nextTick(() => {
+        this.$refs.table.reload({ page: 1, where });
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>