qinhb 1 год назад
Родитель
Сommit
0fdb0fc503

+ 7 - 0
src/api/order/index.ts

@@ -169,3 +169,10 @@ export function queryOrderList(
     data: queryParams,
   });
 }
+
+export function revokeWorkOrder(workOrderId: any) {
+  return request({
+    url: "/api/v1/plan/aps/revoke/" + workOrderId,
+    method: "get",
+  });
+}

+ 18 - 0
src/api/process/index.ts

@@ -20,3 +20,21 @@ export function updateOutSourceApply(
   });
 }
 
+
+export function prepareCheckInfo(
+    workOrderCode: string
+): AxiosPromise<any> {
+  return request({
+    url: "/api/v1/process/prepare/checkInfo/"+workOrderCode,
+    method: "get",
+  });
+}
+export function refreshPrepareCheckInfo(
+    workOrderCode: string
+): AxiosPromise<any> {
+  return request({
+    url: "/api/v1/process/prepare/refresh/"+workOrderCode,
+    method: "get",
+  });
+}
+

+ 8 - 0
src/api/system/dict/index.ts

@@ -146,3 +146,11 @@ export function deleteDict(ids: Array<string>) {
     data: { ids: ids },
   });
 }
+
+
+export function queryDictDataByType(str: string) {
+  return request({
+    url: "/api/v1/sys/dictData/queryByType/" + str,
+    method: "get",
+  });
+}

+ 191 - 71
src/views/plan/prepare/index.vue

@@ -16,7 +16,34 @@
         @current-change="dataList"
         @selection-change="selectionChange"
     >
-      <template #menu-left="{ size }">
+
+      <template #menu="{size,row,index}">
+        <el-button
+            type="primary"
+            link
+            v-if="row.bom === '0' || row.dataFile === '0'|| row.routeId === '0'|| row.craftFile === '0'"
+            size="small"
+            @click="handleEdit(row,0)"
+        ><i-ep-edit />编辑
+        </el-button>
+        <el-button
+            type="primary"
+            link
+            v-if="row.materialState === '0' || row.deviceState === '0'"
+            size="small"
+            @click="handleRefresh(row.workOrderCode)"
+        ><i-ep-edit />刷新
+        </el-button>
+        <el-button
+            type="primary"
+            link
+            v-if="row.bom === '0' || row.dataFile === '0'|| row.routeId === '0'|| row.craftFile === '0' || row.materialState === '0' || row.deviceState === '0'"
+            size="small"
+            @click="deleteRow(row)"
+        ><i-ep-edit />删除
+        </el-button>
+      </template>
+<!--      <template #menu-left="{ size }">
         <el-button
           :disabled="toDeleteIds.length < 1"
           type="danger"
@@ -25,7 +52,7 @@
           @click="multipleDelete"
           >删除</el-button
         >
-      </template>
+      </template>-->
     </avue-crud>
     <el-dialog
         v-model="dialog.visible"
@@ -41,10 +68,9 @@
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
-import ButtonPermKeys from "@/common/configs/buttonPermission";
+import {prepareCheckInfo,refreshPrepareCheckInfo} from "@/api/process"
 
 import { useCommonStoreHook } from "@/store";
-import dictDataUtil from "@/common/configs/dictDataUtil";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 const test = () => {
   isShowTable.value = true;
@@ -65,6 +91,27 @@ const dialog = reactive({
   title: "订单选择",
   visible: false,
 });
+const checkInfo = (code) =>{
+  prepareCheckInfo(code).then((data)=>{
+    form.value.deviceStr = data.data.deviceStr
+    form.value.deviceState = data.data.deviceState
+    form.value.materialState = data.data.materialState
+    form.value.materialStr = data.data.materialStr
+  })
+}
+const handleEdit =(row,index)=>{
+  crudRef.value && crudRef.value.rowEdit(row,index);
+}
+const handleRefresh =(code)=>{
+  refreshPrepareCheckInfo(code).then((data)=>{
+    if(data.code === '200'){
+      ElMessage.success("刷新成功")
+      dataList()
+    }else{
+      ElMessage.error(data.msg)
+    }
+  })
+}
 const orderInfo = (value) => {
   form.value.workOrderCode = value.workOrderCode
   form.value.orderCode = value.orderCode
@@ -77,7 +124,7 @@ const orderInfo = (value) => {
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   delBtn: false,
-  selection: true,
+  selection: false,
   editBtn: false,
   dialogWidth: '45%', // 设置编辑弹窗的宽度为50%
   column: [
@@ -85,8 +132,9 @@ option.value = Object.assign(option.value, {
       label: "工单号",
       prop: "workOrderCode",
       search: true,
-      width: 150,
+      width: 140,
       overHidden: true,
+      editDisabled : true,
       rules: [
         {
           required: true,
@@ -99,12 +147,17 @@ option.value = Object.assign(option.value, {
           dialog.visible = true
         }
       },
+      change:({ value, column }) =>{
+        if(value){
+          checkInfo(value)
+        }
+      }
     },
     {
       label: "计划单号",
       prop: "orderCode",
       search: true,
-      width: 150,
+      width: 140,
       overHidden: true,
       disabled: true,
       rules: [
@@ -134,7 +187,7 @@ option.value = Object.assign(option.value, {
       label: "产品编码",
       prop: "materialCode",
       search: true,
-      width: 150,
+      width: 140,
       overHidden: true,
       disabled: true,
       rules: [
@@ -177,84 +230,163 @@ option.value = Object.assign(option.value, {
     },
     {
       label: "工艺文件",
-      width: 150,
+      width: 115,
+      overHidden: true,
+      prop: "craftFile",
+      addDisplay: false,
+      viewDisplay: false,
+      editDisplay: false,
+      html: true,
+      formatter: (val) => {
+        if (val.craftFile === '1') {
+          return '<b class="el-tag el-tag--success el-tag--light">已齐套</b>';
+        }
+        return '<b class="el-tag el-tag--danger el-tag--light">未齐套</b>';
+      },
+    },
+    {
+      label: "工艺BOM",
+      width: 115,
+      overHidden: true,
+      prop: "bom",
+      viewDisplay: false,
+      addDisplay: false,
+      editDisplay: false,
+      html: true,
+      formatter: (val) => {
+        if (val.bom === '1') {
+          return '<b class="el-tag el-tag--success el-tag--light">已齐套</b>';
+        }
+        return '<b class="el-tag el-tag--danger el-tag--light">未齐套</b>';
+      },
+    },
+    {
+      label: "工艺路线",
+      width: 115,
+      overHidden: true,
+      viewDisplay: false,
+      addDisplay: false,
+      editDisplay: false,
+      prop: "routeId",
+      html: true,
+      formatter: (val) => {
+        if (val.routeId === '1') {
+          return '<b class="el-tag el-tag--success el-tag--light">已齐套</b>';
+        }
+        return '<b class="el-tag el-tag--danger el-tag--light">未齐套</b>';
+      },
+    },
+    {
+      label: "设计文件",
+      prop: "dataFile",
+      width: 115,
+      overHidden: true,
+      viewDisplay: false,
+      addDisplay: false,
+      editDisplay: false,
+      html: true,
+      formatter: (val) => {
+        if (val.dataFile === '1') {
+          return '<b class="el-tag el-tag--success el-tag--light">已齐套</b>';
+        }
+        return '<b class="el-tag el-tag--danger el-tag--light">未齐套</b>';
+      },
+    },
+    {
+      label: "工艺文件",
+      width: 115,
       overHidden: true,
       prop: "craftFiles",
       type: 'checkbox',
-      span: 24,
-      multiple: true,
-      dicUrl:
-          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.prepare_craft_file,
-      props: {
-        label: "dictLabel",
-        value: "dictValue",
-      },
+      span: 12,
+      hide: true,
+      dicData: [{label: '已齐套', value: '1'}],
+    },
+    {
+      label: "工艺BOM",
+      width: 150,
+      span: 12,
+      type: "checkbox",
+      overHidden: true,
+      prop: "boms",
+      hide: true,
+      dicData: [ { label: "已齐套", value: "1", }, ],
     },
     {
       label: "工艺路线",
       width: 150,
-      span: 24,
-      type: "radio",
+      span: 12,
+      type: "checkbox",
       overHidden: true,
-      prop: "routeId",
-      dicData: [
-        {
-          label: "版本正确",
-          value: "1",
-        },
-        {
-          label: "版本不正确",
-          value: "0",
-        },
-      ],
+      hide: true,
+      prop: "routeIds",
+      dicData: [ { label: "已齐套", value: "1", }, ],
     },
     {
-      label: "图纸资料",
+      label: "设计文件",
       prop: "dataFiles",
       width: 150,
       overHidden: true,
       type: 'checkbox',
-      span: 24,
+      span: 12,
       multiple: true,
-      dicUrl:
-          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.prepare_data_file,
-      props: {
-        label: "dictLabel",
-        value: "dictValue",
-      },
+      hide: true,
+      dicData: [ { label: "已齐套", value: "1", }, ],
     },
     {
       label: "设备状况",
-      prop: "deviceStates",
+      prop: "deviceState",
       width: 150,
+      hide: true,
+      addDisplay: false,
       overHidden: true,
-      type: 'checkbox',
+      viewDisplay: false,
+      editDisplay: false,
       span: 24,
+      dicData: [ { label: "已齐套", value: "1", },{ label: "未齐套", value: "0", }, ],
       multiple: true,
-      dicUrl:
-          dictDataUtil.request_url + dictDataUtil.TYPE_CODE.prepare_device_info,
-      props: {
-        label: "dictLabel",
-        value: "dictValue",
-      },
     },
     {
       label: "物料状态",
       prop: 'materialState',
-      type: "radio",
       width: 130,
+      hide: true,
+      editDisplay: false,
+      addDisplay: false,
+      viewDisplay: false,
       overHidden: true,
       span: 24,
-      dicData: [
-        {
-          label: "齐套",
-          value: 1,
-        },
-        {
-          label: "未齐套",
-          value: 0,
-        },
-      ],
+      dicData: [ { label: "已齐套", value: "1", },{ label: "未齐套", value: "0", },  ],
+    },
+    {
+      label: "设备状况",
+      prop: "deviceStr",
+      disabled: true,
+      width: 200,
+      overHidden: true,
+      span: 24,
+      html: true,
+      formatter: (val) => {
+        if (val.deviceState === '1') {
+          return '<b class="el-tag el-tag--success el-tag--light">已齐套</b>';
+        }
+        return '<b class="el-tag el-tag--danger el-tag--light">'+val.deviceStr+'</b>';
+      },
+    },
+    {
+      label: "物料状态",
+      prop: 'materialStr',
+      disabled: true,
+      width: 200,
+      overHidden: true,
+      span: 24,
+      html: true,
+      formatter: (val) => {
+        if (val.materialState === '1') {
+          return '<b class="el-tag el-tag--success el-tag--light">已齐套</b>';
+        }
+        return '<b class="el-tag el-tag--danger el-tag--light">未齐套</b>';
+      },
     },
     {
       label: "创建时间",
@@ -270,24 +402,12 @@ option.value = Object.assign(option.value, {
   ],
 });
 
+
 onMounted(() => {
   form.value.routeId = "1"
   form.value.materialState = 1
   // console.log("crudRef", crudRef)
   dataList();
 });
-/**
- * 上传excel相关
- */
-const uploadRef = ref(null);
-const uploadFinished = () => {
-  // 上传完成后的刷新操作
-  page.currentPage = 1;
-  dataList();
-};
-const importExcelData = () => {
-  if (uploadRef.value) {
-    uploadRef.value.show("/api/v1/device/import");
-  }
-};
+
 </script>

+ 40 - 14
src/views/plan/workOrder/index.vue

@@ -67,6 +67,13 @@
             @click="showSeqPage(row.workOrderCode)"
             type="primary"
             :size="size">流水</el-button>
+        <el-button
+            icon="el-icon-delete"
+            text
+            v-if="row.workOrderState === '3'"
+            @click="revoke(row.id)"
+            type="primary"
+            :size="size">撤销</el-button>
       </template>
     </avue-crud>
     <el-dialog
@@ -125,11 +132,12 @@
           :model="formData"
           :rules="rules"
           label-width="150px">
-      <el-form-item label="排程时间" prop="apsTime">
+      <el-form-item label="排程时间" prop="apsTime" >
         <el-date-picker
             v-model="formData.apsTime"
             type="date"
-            :picker-options="pickerOptions"
+            style="width:200px;"
+            :disabled-date="disabledDate"
             placeholder="请选择时间"
             format="YYYY/MM/DD"
             value-format="YYYY-MM-DD"
@@ -138,10 +146,10 @@
 <!--        <el-input width="250px" v-model="formData.apsTime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>-->
       </el-form-item>
       <el-form-item label="排程类型" prop="apsModel">
-        <el-radio-group v-model="formData.apsModel">
-          <el-radio :value="0">排产</el-radio>
-<!--          <el-radio :value="1">停用</el-radio>-->
-        </el-radio-group>
+        <el-select v-model="formData.apsModel" placeholder="排程类型"
+                   style="width:200px;">
+          <el-option v-for="item in schedulingTypes" :label="item.dictLabel" :value="item.dictValue" :key="item.dictValue"></el-option>
+        </el-select>
       </el-form-item>
       </el-form>
       <template #footer>
@@ -158,13 +166,14 @@
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
 import buttonPermission from "@/common/configs/buttonPermission";
-import {apsWorkOrder,distributeWorkOrder} from "@/api/order"
+import {apsWorkOrder,distributeWorkOrder,revokeWorkOrder} from "@/api/order"
 import { useCommonStoreHook } from "@/store";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import ChoiceRoutePage from "./components/choice-route-page.vue";
 import ChoiceWorkshopPage from "./components/choice-workshop-page.vue";
 import WorkOrderSeq from "./components/work-order-seq.vue";
 import { checkPerm } from "@/directive/permission";
+import {queryDictDataByType} from "@/api/system/dict"
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 const test = () => {
   isShowTable.value = true;
@@ -176,6 +185,9 @@ const permission = reactive({
   editBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_edit),
   menu: true,
 });
+const disabledDate = (time) =>{
+  return time.getTime() < Date.now(); // 8.64e7 毫秒数代表一天
+}
 const dialog = reactive({
   title: "订单选择",
   visible: false,
@@ -200,11 +212,6 @@ const dialog5 = reactive({
   title: "排程确认",
   visible: false,
 });
-const pickerOptions = ref({
-  disabledDate(time) {
-    return time.getTime() < Date.now() - 8.64e7;
-  }
-})
 const aps =(id)=>{
   formData.workOrderIds = [id]
   dialog5.visible = true
@@ -225,6 +232,22 @@ const distribute = (id)=>{
         // catch error
       });
 }
+const revoke = (id)=>{
+  ElMessageBox.confirm("当前操作不可逆,确定撤销工单吗?")
+      .then(() => {
+        revokeWorkOrder(id).then((data)=>{
+          if(data.code === '200'){
+            ElMessage.success(data.msg);
+            dataList()
+          }else{
+            ElMessage.error(data.msg)
+          }
+        })
+      })
+      .catch(() => {
+        // catch error
+      });
+}
 const handleEdit = (row, index) =>{
   crudRef.value && crudRef.value.rowEdit(row, index);
 }
@@ -233,10 +256,10 @@ const aps1 =()=>{
   dialog5.visible = true
 }
 const dataFormRef = ref(ElForm);
-
+const schedulingTypes = ref([])
 const formData = reactive({
   apsTime: null,
-  apsModel: 0,
+  apsModel: "0",
   workOrderId: 0
 });
 
@@ -521,5 +544,8 @@ option.value = Object.assign(option.value, {
 onMounted(() => {
   // console.log("crudRef", crudRef)
   dataList();
+  queryDictDataByType("order_scheduling_type").then((data)=>{
+    schedulingTypes.value = data.data
+  })
 });
 </script>

+ 6 - 3
src/views/storage/storage/index.vue

@@ -16,7 +16,7 @@
         @current-change="dataList"
         @selection-change="selectionChange"
     >
-      <template #menu-left="{ size }">
+<!--      <template #menu-left="{ size }">
         <el-button
           :disabled="toDeleteIds.length < 1"
           type="danger"
@@ -25,7 +25,7 @@
           @click="multipleDelete"
           >删除</el-button
         >
-      </template>
+      </template>-->
     </avue-crud>
     <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
   </div>
@@ -57,7 +57,8 @@ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   delBtn: false,
-  selection: true,
+  selection: false,
+  addBtn: false,
   column: [
     {
       label: "仓库编码",
@@ -83,6 +84,7 @@ option.value = Object.assign(option.value, {
     {
       label: "货区",
       prop: "area",
+      editDisabled: true,
       rules: [
         {
           required: true,
@@ -95,6 +97,7 @@ option.value = Object.assign(option.value, {
       label: "货位",
       prop: "coordinate",
       search: true,
+      editDisabled: true,
       rules: [
         {
           required: true,