فهرست منبع

计划任务自动排产接口

lph 11 ماه پیش
والد
کامیت
f00c9a811c
2فایلهای تغییر یافته به همراه43 افزوده شده و 6 حذف شده
  1. 12 0
      zkqy-ui/src/api/amichi/planTask/index.js
  2. 31 6
      zkqy-ui/src/views/amichi/planTask/index.vue

+ 12 - 0
zkqy-ui/src/api/amichi/planTask/index.js

@@ -0,0 +1,12 @@
+import request from '@/utils/request'
+
+
+// 自动投产接口
+export function addInstruction(data) {
+  return request({
+    url: '/amichi/exportproductionscheduling/automatic/scheduling',
+    method: 'post',
+    data: data
+  })
+}
+

+ 31 - 6
zkqy-ui/src/views/amichi/planTask/index.vue

@@ -389,10 +389,10 @@
           :inline="false"
           size="normal"
         >
-          <el-form-item label="排产类型" prop="planType">
-            <!-- <el-input v-model="form.planType"></el-input> -->
+          <el-form-item label="排产类型" prop="schedulingType">
+            <!-- <el-input v-model="form.schedulingType"></el-input> -->
             <el-select
-              v-model="autoForm.planType"
+              v-model="autoForm.schedulingType"
               placeholder="请选择排产类型"
               clearable
               filterable
@@ -411,7 +411,9 @@
         <template #footer>
           <span>
             <el-button type="info" @click="autoShow = false">取消</el-button>
-            <el-button type="primary" @click="autoShow = false">确认</el-button>
+            <el-button type="primary" @click="autoConfirmHandler"
+              >确认</el-button
+            >
           </span>
         </template>
       </el-dialog>
@@ -432,6 +434,7 @@ import {
   getStatisticList,
 } from "@/api/tablelist/commonTable";
 import { listData } from "@/api/system/tenant/data";
+import { addInstruction } from "@/api/amichi/planTask/index";
 import { getToken } from "@/utils/auth";
 import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
 import { camelCase, toUnderline } from "@/utils";
@@ -444,6 +447,7 @@ import FormList from "@/components/FormGroup/formList.vue";
 import { v4 as uuidv4 } from "uuid";
 import printHtml from "@/views/tablelist/commonTable/print";
 import LayoutIndex from "@/views/tablelist/components/FormGroupLayout/LayoutIndex.vue";
+import { async } from "@/components/updateModule/k-form-design/lib/k-form-design.common";
 // let times = 2; //请求次数
 export default {
   name: "listInfo",
@@ -461,10 +465,10 @@ export default {
       // 自动排产数据  start
       autoShow: false,
       autoForm: {
-        planType: "",
+        schedulingType: "",
       },
       autoFormRules: {
-        planType: [
+        schedulingType: [
           { required: true, message: "请选择排产类型", trigger: "change" },
         ],
       },
@@ -641,6 +645,27 @@ export default {
     // this.initFormGroupDialog();
   },
   methods: {
+    // 自动排产确认回调
+    autoConfirmHandler() {
+      this.$refs.autoForm.validate(async (valid) => {
+        if (valid) {
+          this.autoForm.planIds = this.selection.map(
+            (item) => item.productionPlanningManagementId
+          );
+          let res = await addInstruction(this.autoForm);
+          if (res.code == 200) {
+            this.getList(this.queryParams);
+            this.$message.success("排产成功");
+            this.autoFormVisible = false;
+          } else {
+            this.$message.error(res.msg);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
     // 自动排产回调
     handleAuto() {
       console.log(this.selection);