chen 1 год назад
Родитель
Сommit
f9bc763774

+ 50 - 0
src/api/process/process.js

@@ -0,0 +1,50 @@
+import request from '@/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/pl-process/process/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/pl-process/process/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/pl-process/process/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/pl-process/process/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/pl-process/process/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 50 - 0
src/api/process/processItem.js

@@ -0,0 +1,50 @@
+import request from '@/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/pl-process/processItem/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/pl-process/processItem/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/pl-process/processItem/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/pl-process/processItem/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/pl-process/processItem/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 50 - 0
src/api/processConfig/processConfig.js

@@ -0,0 +1,50 @@
+import request from '@/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/pl-processConfig/processConfig/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/pl-processConfig/processConfig/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/pl-processConfig/processConfig/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/pl-processConfig/processConfig/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/pl-processConfig/processConfig/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 50 - 0
src/api/productProcess/productProcess.js

@@ -0,0 +1,50 @@
+import request from '@/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/pl-productProcess/productProcess/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/pl-productProcess/productProcess/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/pl-productProcess/productProcess/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/pl-productProcess/productProcess/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/pl-productProcess/productProcess/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 50 - 0
src/api/productProcess/productProcessItem.js

@@ -0,0 +1,50 @@
+import request from '@/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/pl-productProcess/productProcessItem/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const getDetail = (id) => {
+  return request({
+    url: '/pl-productProcess/productProcessItem/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/pl-productProcess/productProcessItem/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/pl-productProcess/productProcessItem/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/pl-productProcess/productProcessItem/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 317 - 0
src/option/process/process.js

@@ -0,0 +1,317 @@
+import { setStore, getStore } from '@/utils/store';
+export default {
+  height:'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  labelWidth:120,
+  border: true,
+  index: true,
+  viewBtn: true,
+  selection: true,
+  dialogClickModal: false,
+  columnBtn:false,
+  menuWidth: 300,
+  column: [
+    {
+      label: "主键",
+      prop: "id",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "租户ID",
+      prop: "tenantId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "所属工厂",
+      prop: "factoryId",
+      search: getStore({ name: 'userInfo' }).user_category==1,
+      hide: getStore({ name: 'userInfo' }).user_category!=1,
+      display: getStore({ name: 'userInfo' }).user_category==1,
+      type: "tree",
+      cascader: [getStore({ name: 'userInfo' }).user_category==1?'clientId':''],
+      dicUrl: "/api/pl-factory/factory/select",
+      props: {
+        label: "name",
+        value: "id",
+      },
+      rules: [
+        {
+          required: true,
+          message: '请选择所属工厂',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "工序号",
+      prop: "code",
+      type: "input",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: '请填写工序号',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "工序名称",
+      prop: "name",
+      type: "input",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: '请填写工序名称',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "过程类型",
+      prop: "type",
+      type: "radio",
+      search: true,
+      type:"select",
+      dicUrl:"/blade-system/dict-biz/dictionary?code=procedural_type",
+      props:{label:"dictValue",value:"dictKey"},
+      rules: [
+        {
+          required: true,
+          message: '请选择过程类型',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "设备/冶具",
+      prop: "equipment",
+      type: "input",
+      rules: [
+        {
+          required: true,
+          message: '请填写设备/冶具',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "使用寿命",
+      prop: "lifeSpan",
+      type: "input",
+      rules: [
+        {
+          required: true,
+          message: '请填写使用寿命',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "关键过程",
+      prop: "isCrux",
+      type: 'switch',
+      dicData: [{
+        label: '否',
+        value: 0
+      }, {
+        label: '是',
+        value: 1
+      }],
+      rules: [
+        {
+          required: true,
+          message: '请选择关键过程',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "是否拍照",
+      prop: "isPhotograph",
+      type: 'switch',
+      dicData: [{
+        label: '否',
+        value: 0
+      }, {
+        label: '是',
+        value: 1
+      }],
+      rules: [
+        {
+          required: true,
+          message: '请选择是否拍照',
+          trigger: 'click',
+        },
+      ],
+      control: (val, form) => {
+        if (val == 1) {
+          return {
+            isDownline: {
+              display: true
+            },
+          }
+        } else {
+          return {
+            isDownline: {
+              display: false
+            },
+          }
+        }
+      },
+    },
+    {
+      label: "是否下线",
+      prop: "isDownline",
+      type: 'switch',
+      dicData: [{
+        label: '否',
+        value: 0
+      }, {
+        label: '是',
+        value: 1
+      }],
+      rules: [
+        {
+          required: true,
+          message: '请选择是否下线',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "追溯要求",
+      prop: "isRetrospect",
+      type: 'switch',
+      dicData: [{
+        label: '否',
+        value: 0
+      }, {
+        label: '是',
+        value: 1
+      }],
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: '请选择追溯要求',
+          trigger: 'click',
+        },
+      ],
+      control: (val, form) => {
+        if (val == 1) {
+          return {
+            details: {
+              display: true
+            },
+          }
+        } else {
+          return {
+            details: {
+              display: false
+            },
+          }
+        }
+      },
+    },
+    {
+      label: "电子指导书",
+      prop: "guidebookUrls",
+      dataType: 'string',
+      type: 'upload',
+      propsHttp: {
+        res: 'data',
+        url: 'link',
+      },
+      action: '/blade-resource/oss/endpoint/put-file',
+      hide: true,
+      rules: [
+        {
+          required: true,
+          message: '请上传电子指导书',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      labelWidth: 0,
+      label: '',
+      prop: 'details',
+      span: 24,
+      hide: true
+    },
+    {
+      label: "创建人",
+      prop: "createUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建部门",
+      prop: "createDept",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建时间",
+      prop: "createTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+    },
+    {
+      label: "修改人",
+      prop: "updateUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改时间",
+      prop: "updateTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+    },
+    {
+      label: "状态",
+      prop: "status",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "是否已删除",
+      prop: "isDeleted",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+  ]
+}

+ 126 - 0
src/option/process/processItem.js

@@ -0,0 +1,126 @@
+export default {
+  columnBtn:false,
+  sortable: false,
+  addBtn: false,
+  editBtn: false,
+  addRowBtn: false,
+  cellBtn: false,
+  cancelBtn: false,
+  deleteBtn: false,
+  menuWidth: 100,
+  menu: true,
+  column: [
+    {
+      label: "主键",
+      prop: "id",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "租户ID",
+      prop: "tenantId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "工序id",
+      prop: "processId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "追溯范围",
+      prop: "name",
+      type: "input",
+      cell: true,
+      rules: [{
+        required: true,
+        message: "请输入追溯范围",
+        trigger: "blur"
+      }],
+    },
+    {
+      label: "预设达标值",
+      prop: "value",
+      type: "input",
+      cell: true,
+      rules: [{
+        required: true,
+        message: "请输入预设达标值",
+        trigger: "blur"
+      }],
+    },
+    {
+      label: "创建人",
+      prop: "createUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建部门",
+      prop: "createDept",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建时间",
+      prop: "createTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改人",
+      prop: "updateUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改时间",
+      prop: "updateTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "状态",
+      prop: "status",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "是否已删除",
+      prop: "isDeleted",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+  ]
+}

+ 153 - 0
src/option/processConfig/processConfig.js

@@ -0,0 +1,153 @@
+import { setStore, getStore } from '@/utils/store';
+export default {
+  height:'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  viewBtn: true,
+  selection: true,
+  dialogClickModal: false,
+  column: [
+    {
+      label: "主键",
+      prop: "id",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "租户ID",
+      prop: "tenantId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "所属工厂",
+      prop: "factoryId",
+      search: getStore({ name: 'userInfo' }).user_category==1,
+      hide: getStore({ name: 'userInfo' }).user_category!=1,
+      display: getStore({ name: 'userInfo' }).user_category==1,
+      type: "tree",
+      cascader: [getStore({ name: 'userInfo' }).user_category==1?'clientId':''],
+      dicUrl: "/api/pl-factory/factory/select",
+      props: {
+        label: "name",
+        value: "id",
+      },
+    },
+    {
+      label: "编号",
+      prop: "code",
+      type: "input",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: '请填写编号',
+          trigger: 'click',
+        },
+      ],
+    },
+    {
+      label: "工序",
+      prop: "processIds",
+      type: 'select',
+      multiple: true,
+      dataType:"String",
+      dicUrl:"/pl-process/process/select",
+      typeformat (item, label, value) {
+        return `${item.code}-${item.name}`
+      },
+      props: {
+        label: 'code',
+        value: 'id'
+      },
+      rules: [
+        {
+          required: true,
+          message: '请选择工序',
+          trigger: 'click',
+        },
+      ],
+      hide: true,
+    },
+    {
+      label: "工序名称s",
+      prop: "processNames",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      search: true,
+    },
+    {
+      label: "创建人",
+      prop: "createUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建部门",
+      prop: "createDept",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建时间",
+      prop: "createTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+    },
+    {
+      label: "修改人",
+      prop: "updateUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改时间",
+      prop: "updateTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+    },
+    {
+      label: "状态",
+      prop: "status",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "是否已删除",
+      prop: "isDeleted",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+  ]
+}

+ 59 - 14
src/option/productModel/productModel.js

@@ -86,13 +86,13 @@ export default {
       label: "是否直接入库",
       prop: "isDirectStorage",
       type: 'switch',
-          dicData: [{
-            label: '否',
-            value: 0
-          }, {
-            label: '是',
-            value: 1
-          }]
+      dicData: [{
+        label: '否',
+        value: 0
+      }, {
+        label: '是',
+        value: 1
+      }]
     },
     {
       label: "是否Ai检测",
@@ -110,13 +110,13 @@ export default {
       label: "入库数量",
       prop: "inStockNum",
       type: 'select',
-          dicData: [{
-            label: '7个',
-            value: 7
-          }, {
-            label: '10个',
-            value: 10
-          }],
+      dicData: [{
+        label: '7个',
+        value: 7
+      }, {
+        label: '10个',
+        value: 10
+      }],
       rules: [
         {
           required: true,
@@ -144,6 +144,51 @@ export default {
         },
       ],
     },
+    {
+      label: "是否启动工序",
+      prop: "isEnableProcess",
+      type: 'switch',
+      dicData: [{
+        label: '否',
+        value: 0
+      }, {
+        label: '是',
+        value: 1
+      }],
+      control: (val, form) => {
+        if (val == 1) {
+          return {
+            processConfigId: {
+              display: true
+            },
+          }
+        } else {
+          return {
+            processConfigId: {
+              display: false
+            },
+          }
+        }
+      }
+    },
+    {
+      label: "工序配置",
+      prop: "processConfigId",
+      type: 'select',
+      dataType:"String",
+      dicUrl: "/api/pl-processConfig/processConfig/select",
+      props: {
+        label: "code",
+        value: "id",
+      },
+      rules: [
+        {
+          required: true,
+          message: '请选择工序配置',
+          trigger: 'click',
+        },
+      ],
+    },
     {
       label: "创建人",
       prop: "createUser",

+ 133 - 0
src/option/productProcess/productProcess.js

@@ -0,0 +1,133 @@
+export default {
+  height:'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  viewBtn: true,
+  selection: true,
+  menuWidth: 300,
+  column: [
+    {
+      label: "主键",
+      prop: "id",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "租户ID",
+      prop: "tenantId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "产品id",
+      prop: "productId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "工序id",
+      prop: "processId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "工序名称",
+      prop: "processName",
+      type: "input",
+    },
+    {
+      label: "工序编码",
+      prop: "processCode",
+      type: "input",
+    },
+    {
+      label: "是否追溯 0否1是",
+      prop: "isRetrospect",
+      type: "input",
+    },
+    {
+      label: "是否达标 -1无需追溯 0未达标 1达标",
+      prop: "isStandards",
+      type: "input",
+    },
+    {
+      label: "创建人",
+      prop: "createUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建部门",
+      prop: "createDept",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建时间",
+      prop: "createTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改人",
+      prop: "updateUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改时间",
+      prop: "updateTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "状态",
+      prop: "status",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "是否已删除",
+      prop: "isDeleted",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+  ]
+}

+ 128 - 0
src/option/productProcess/productProcessItem.js

@@ -0,0 +1,128 @@
+export default {
+  height:'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  viewBtn: true,
+  selection: true,
+  menuWidth: 300,
+  column: [
+    {
+      label: "主键",
+      prop: "id",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "租户ID",
+      prop: "tenantId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "所属工厂",
+      prop: "productProcessId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "工序项id",
+      prop: "processItemId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "工序项名称",
+      prop: "processItemName",
+      type: "input",
+    },
+    {
+      label: "工序项值",
+      prop: "processItemValue",
+      type: "input",
+    },
+    {
+      label: "实际值",
+      prop: "value",
+      type: "input",
+    },
+    {
+      label: "创建人",
+      prop: "createUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建部门",
+      prop: "createDept",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建时间",
+      prop: "createTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改人",
+      prop: "updateUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改时间",
+      prop: "updateTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "状态",
+      prop: "status",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "是否已删除",
+      prop: "isDeleted",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+  ]
+}

+ 474 - 0
src/views/process/process.vue

@@ -0,0 +1,474 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               v-model:search="search"
+               v-model:page="page"
+               v-model="form"
+               :table-loading="loading"
+               :data="data"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template #menu-left>
+        <el-button type="danger"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.process_delete"
+                   @click="handleDelete">删 除
+        </el-button>
+        <el-button type="warning"
+                   plain
+                   icon="el-icon-download"
+                   @click="handleExport">导 出
+        </el-button>
+      </template>
+      
+      <template #details-form>
+        <view style="margin:0 20px">
+          <avue-crud :option="optionSub" ref="detailCrud"
+                    :data="form.details">
+                    <template #menu-left>
+                      <h2>追溯要求</h2>
+
+                      <el-button type="primary"
+                      :size="size"
+                      icon="el-icon-plus"
+                      v-if="optionSub.menu"
+                      @click="$refs.detailCrud.rowCellAdd()">新增</el-button>
+                    </template>
+                    
+                    <template #menu="{index,size}">
+                      <el-popconfirm title="确认删除数据么?" @confirm="delDetail(index)">
+                        <template #reference>
+                          <el-button :size="size" type="primary" text>删除</el-button>
+                        </template>
+                      </el-popconfirm>
+                    </template>
+
+          </avue-crud>
+        </view>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/process/process";
+  import {getList as getListSub, getDetail as getDetailSub, add as addSub, update as updateSub, remove as removeSub} from "@/api/process/processItem";
+  import option from "@/option/process/process";
+  import optionSub from "@/option/process/processItem";
+  import {mapGetters} from "vuex";
+  import {exportBlob} from "@/api/common";
+  import {getToken} from '@/utils/auth';
+  import {downloadXls} from "@/utils/util";
+  import {dateNow} from "@/utils/date";
+  import NProgress from 'nprogress';
+  import 'nprogress/nprogress.css';
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        search: {},
+        loading: true,
+        data: [],
+        selectionList: [],
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        option: option,
+        subVisible: false,
+        direction: 'rtl',
+        processId: 0,
+        processName: "工序表",
+        formSub: {},
+        querySub: {},
+        loadingSub: true,
+        dataSub: [],
+        selectionListSub: [],
+        pageSub: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        optionSub: optionSub
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.validData(this.permission.process_add, false),
+          viewBtn: this.validData(this.permission.process_view, false),
+          delBtn: this.validData(this.permission.process_delete, false),
+          editBtn: this.validData(this.permission.process_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      },
+      subIds() {
+        let ids = [];
+        this.selectionListSub.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      // 主表模块
+      rowSave(row, done, loading) {
+        if(row.isRetrospect==1){
+          this.$refs.detailCrud.$refs.cellForm.validate((valid) => {
+            if (valid) {
+              add(row).then(() => {
+                this.onLoad(this.page);
+                this.$message({
+                  type: "success",
+                  message: "操作成功!"
+                });
+                done();
+              }, error => {
+                window.console.log(error);
+                loading();
+              });
+            } else {
+              loading();
+              return false;
+            }
+          })
+        }else{
+          add(row).then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            done();
+          }, error => {
+            window.console.log(error);
+            loading();
+          });
+        }
+      },
+      rowUpdate(row, index, done, loading) {
+        if(row.isRetrospect==1){
+          this.$refs.detailCrud.$refs.cellForm.validate((valid) => {
+            if (valid) {
+              update(row).then(() => {
+                this.onLoad(this.page);
+                this.$message({
+                  type: "success",
+                  message: "操作成功!"
+                });
+                done();
+              }, error => {
+                window.console.log(error);
+                loading();
+              });
+            } else {
+              loading();
+              return false;
+            }
+          })
+        }else{
+          update(row).then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            done();
+          }, error => {
+            window.console.log(error);
+            loading();
+          });
+        }
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      handleExport() {
+        let downloadUrl = `/pl-process/process/export-process?${this.website.tokenHeader}=${getToken()}`;
+        const {
+            code,
+            name,
+            type,
+            isRetrospect,
+         } = this.query;
+        let values = {
+             code_like: code,
+             name_like: name,
+             type_: type,
+             isRetrospect_equal: isRetrospect,
+        };
+        this.$confirm("是否导出数据?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          NProgress.start();
+          exportBlob(downloadUrl, values).then(res => {
+            downloadXls(res.data, `工序表${dateNow()}.xlsx`);
+            NProgress.done();
+          })
+        });
+      },
+      beforeOpen(done, type) {
+        this.optionSub.menu = false;
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+            if(type == "edit"){
+            this.optionSub.menu = true;
+              this.form.details.forEach(item =>{
+                item["$cellEdit"] = true
+              })
+            }
+          });
+        }
+        if (["add"].includes(type)) {
+          this.optionSub.menu = true;
+          if(!this.form.details){
+            this.form.details = [{"$cellEdit":true}]
+          }
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        const {
+            code,
+            name,
+            type,
+            isRetrospect,
+        } = this.query;
+
+        let values = {
+            code_like: code,
+            name_like: name,
+            type_: type,
+            isRetrospect_equal: isRetrospect,
+        };
+        getList(page.currentPage, page.pageSize, values).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      },
+      // 子表模块
+      handleDataSub(row) {
+        this.subVisible = true;
+        this.processId = row.id;
+        this.onLoadSub(this.pageSub)
+      },
+      handleSubClose(hide) {
+        hide();
+      },
+      rowSaveSub(row, loading, done) {
+        row = {
+          ...row,
+          processId: this.processId,
+        };
+        addSub(row).then(() => {
+          loading();
+          this.onLoadSub(this.pageSub);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        }, error => {
+          done();
+          window.console.log(error);
+        });
+      },
+      rowUpdateSub(row, index, loading, done) {
+        row = {
+          ...row,
+          processId: this.processId,
+        };
+        updateSub(row).then(() => {
+          loading();
+          this.onLoadSub(this.pageSub);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        }, error => {
+          done();
+          window.console.log(error);
+        });
+      },
+      rowDelSub(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return removeSub(row.id);
+          })
+          .then(() => {
+            this.onLoadSub(this.pageSub);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDeleteSub() {
+        if (this.selectionListSub.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return removeSub(this.subIds);
+          })
+          .then(() => {
+            this.onLoadSub(this.pageSub);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crudSub.toggleSelection();
+          });
+      },
+      beforeOpenSub(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetailSub(this.formSub.id).then(res => {
+            this.formSub = res.data.data;
+          });
+        }
+        done();
+      },
+      searchResetSub() {
+        this.querySub = {};
+        this.onLoadSub(this.pageSub);
+      },
+      searchChangeSub(params) {
+        this.querySub = params;
+        this.onLoadSub(this.pageSub, params);
+      },
+      selectionChangeSub(list) {
+        this.selectionListSub = list;
+      },
+      currentChangeSub(currentPage) {
+        this.pageSub.currentPage = currentPage;
+      },
+      sizeChangeSub(pageSize) {
+        this.pageSub.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoadSub(page, params = {}) {
+        this.loadingSub = true;
+
+        let values = {
+          processId: this.processId,
+        }
+
+        const {
+        } = this.querySub;
+
+        values = {
+        ...values,
+        };
+
+        getListSub(page.currentPage, page.pageSize, values).then(res => {
+          const data = res.data.data;
+          this.pageSub.total = data.total;
+          this.dataSub = data.records;
+          this.selectionListSub = [];
+          this.loadingSub = false;
+        });
+      },
+    }
+  };
+</script>
+
+<style>
+</style>

+ 235 - 0
src/views/processConfig/processConfig.vue

@@ -0,0 +1,235 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               v-model:search="search"
+               v-model:page="page"
+               v-model="form"
+               :table-loading="loading"
+               :data="data"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template #menu-left>
+        <el-button type="danger"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.processConfig_delete"
+                   @click="handleDelete">删 除
+        </el-button>
+        <el-button type="warning"
+                   plain
+                   icon="el-icon-download"
+                   @click="handleExport">导 出
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/processConfig/processConfig";
+  import option from "@/option/processConfig/processConfig";
+  import {mapGetters} from "vuex";
+  import {exportBlob} from "@/api/common";
+  import {getToken} from '@/utils/auth';
+  import {downloadXls} from "@/utils/util";
+  import {dateNow} from "@/utils/date";
+  import NProgress from 'nprogress';
+  import 'nprogress/nprogress.css';
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        search: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: option,
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.validData(this.permission.processConfig_add, false),
+          viewBtn: this.validData(this.permission.processConfig_view, false),
+          delBtn: this.validData(this.permission.processConfig_delete, false),
+          editBtn: this.validData(this.permission.processConfig_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      handleExport() {
+        let downloadUrl = `/pl-processConfig/processConfig/export-processConfig?${this.website.tokenHeader}=${getToken()}`;
+        const {
+            code,
+            processNames,
+        } = this.query;
+        let values = {
+            code_like: code,
+            processNames_like: processNames,
+        };
+        this.$confirm("是否导出数据?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          NProgress.start();
+          exportBlob(downloadUrl, values).then(res => {
+            downloadXls(res.data, `工序配置表${dateNow()}.xlsx`);
+            NProgress.done();
+          })
+        });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }else{
+          this.form.processIds=''
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+
+        const {
+          code,
+          processNames,
+        } = this.query;
+
+        let values = {
+          code_like: code,
+          processNames_like: processNames,
+        };
+
+        getList(page.currentPage, page.pageSize, values).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 10 - 0
src/views/productModel/productModel.vue

@@ -82,6 +82,14 @@
         return ids.join(",");
       }
     },
+    watch: {
+      'form.isEnableProcess'(newValue, oldValue) {
+        if(newValue=='0'){
+          this.form.processConfigId = "";
+        }
+      }
+
+    },
     methods: {
       rowSave(row, done, loading) {
         add(row).then(() => {
@@ -213,11 +221,13 @@
 
         const {
           clientId,
+          factoryId,
           productName,
           productModel,
         } = this.query;
 
         let values = {
+          factoryId:factoryId,
           clientId: clientId,
           productName: productName,
           productModel: productModel,

+ 412 - 0
src/views/productProcess/productProcess.vue

@@ -0,0 +1,412 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               v-model:search="search"
+               v-model:page="page"
+               v-model="form"
+               :table-loading="loading"
+               :data="data"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template #menu-left>
+        <el-button type="danger"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.productProcess_delete"
+                   @click="handleDelete">删 除
+        </el-button>
+        <el-button type="warning"
+                   plain
+                   icon="el-icon-download"
+                   @click="handleExport">导 出
+        </el-button>
+      </template>
+      <template #menu="row">
+        <el-button type="text"
+                   icon="el-icon-setting"
+                   @click.stop="handleDataSub(row)">配 置
+        </el-button>
+      </template>
+    </avue-crud>
+    <el-drawer :title="`[${productProcessName}] 配置`" :visible.sync="subVisible" :direction="direction" append-to-body
+               :before-close="handleSubClose" size="1000px">
+      <basic-container>
+        <avue-crud :option="optionSub"
+                   :data="dataSub"
+                   v-model:page="pageSub"
+                   v-model="formSub"
+                   :table-loading="loadingSub"
+                   ref="crudSub"
+                   @row-del="rowDelSub"
+                   @row-update="rowUpdateSub"
+                   @row-save="rowSaveSub"
+                   :before-open="beforeOpenSub"
+                   @search-change="searchChangeSub"
+                   @search-reset="searchResetSub"
+                   @selection-change="selectionChangeSub"
+                   @current-change="currentChangeSub"
+                   @size-change="sizeChangeSub"
+                   @on-load="onLoadSub">
+          <template #menu-left>
+            <el-button type="danger"
+                       icon="el-icon-delete"
+                       plain
+                       @click="handleDeleteSub">删 除
+            </el-button>
+          </template>
+        </avue-crud>
+      </basic-container>
+    </el-drawer>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/productProcess/productProcess";
+  import {getList as getListSub, getDetail as getDetailSub, add as addSub, update as updateSub, remove as removeSub} from "@/api/productProcess/productProcessItem";
+  import option from "@/const/productProcess/productProcess";
+  import optionSub from "@/const/productProcess/productProcessItem";
+  import {mapGetters} from "vuex";
+  import {exportBlob} from "@/api/common";
+  import {getToken} from '@/utils/auth';
+  import {downloadXls} from "@/utils/util";
+  import {dateNow} from "@/utils/date";
+  import NProgress from 'nprogress';
+  import 'nprogress/nprogress.css';
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        search: {},
+        loading: true,
+        data: [],
+        selectionList: [],
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        option: option,
+        subVisible: false,
+        direction: 'rtl',
+        productProcessId: 0,
+        productProcessName: "商品工序记录表",
+        formSub: {},
+        querySub: {},
+        loadingSub: true,
+        dataSub: [],
+        selectionListSub: [],
+        pageSub: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        optionSub: optionSub
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.validData(this.permission.productProcess_add, false),
+          viewBtn: this.validData(this.permission.productProcess_view, false),
+          delBtn: this.validData(this.permission.productProcess_delete, false),
+          editBtn: this.validData(this.permission.productProcess_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      },
+      subIds() {
+        let ids = [];
+        this.selectionListSub.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      // 主表模块
+      rowSave(row, done, loading) {
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          window.console.log(error);
+          loading();
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          window.console.log(error);
+          loading();
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      handleExport() {
+        let downloadUrl = `/pl-productProcess/productProcess/export-productProcess?${this.website.tokenHeader}=${getToken()}`;
+        const {
+         } = this.query;
+        let values = {
+        };
+        this.$confirm("是否导出数据?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          NProgress.start();
+          exportBlob(downloadUrl, values).then(res => {
+            downloadXls(res.data, `商品工序记录表${dateNow()}.xlsx`);
+            NProgress.done();
+          })
+        });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+        const {
+        } = this.query;
+
+        let values = {
+        };
+        getList(page.currentPage, page.pageSize, values).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      },
+      // 子表模块
+      handleDataSub(row) {
+        this.subVisible = true;
+        this.productProcessId = row.id;
+        this.onLoadSub(this.pageSub)
+      },
+      handleSubClose(hide) {
+        hide();
+      },
+      rowSaveSub(row, loading, done) {
+        row = {
+          ...row,
+          productProcessId: this.productProcessId,
+        };
+        addSub(row).then(() => {
+          loading();
+          this.onLoadSub(this.pageSub);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        }, error => {
+          done();
+          window.console.log(error);
+        });
+      },
+      rowUpdateSub(row, index, loading, done) {
+        row = {
+          ...row,
+          productProcessId: this.productProcessId,
+        };
+        updateSub(row).then(() => {
+          loading();
+          this.onLoadSub(this.pageSub);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        }, error => {
+          done();
+          window.console.log(error);
+        });
+      },
+      rowDelSub(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return removeSub(row.id);
+          })
+          .then(() => {
+            this.onLoadSub(this.pageSub);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDeleteSub() {
+        if (this.selectionListSub.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return removeSub(this.subIds);
+          })
+          .then(() => {
+            this.onLoadSub(this.pageSub);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crudSub.toggleSelection();
+          });
+      },
+      beforeOpenSub(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetailSub(this.formSub.id).then(res => {
+            this.formSub = res.data.data;
+          });
+        }
+        done();
+      },
+      searchResetSub() {
+        this.querySub = {};
+        this.onLoadSub(this.pageSub);
+      },
+      searchChangeSub(params) {
+        this.querySub = params;
+        this.onLoadSub(this.pageSub, params);
+      },
+      selectionChangeSub(list) {
+        this.selectionListSub = list;
+      },
+      currentChangeSub(currentPage) {
+        this.pageSub.currentPage = currentPage;
+      },
+      sizeChangeSub(pageSize) {
+        this.pageSub.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoadSub(page, params = {}) {
+        this.loadingSub = true;
+
+        let values = {
+          productProcessId: this.productProcessId,
+        }
+
+        const {
+        } = this.querySub;
+
+        values = {
+        ...values,
+        };
+
+        getListSub(page.currentPage, page.pageSize, values).then(res => {
+          const data = res.data.data;
+          this.pageSub.total = data.total;
+          this.dataSub = data.records;
+          this.selectionListSub = [];
+          this.loadingSub = false;
+        });
+      },
+    }
+  };
+</script>
+
+<style>
+</style>