guoyujia vor 2 Monaten
Ursprung
Commit
1a68f2a3d8
2 geänderte Dateien mit 32 neuen und 5 gelöschten Zeilen
  1. 7 0
      src/api/business/daywork.js
  2. 25 5
      src/views/business/reviseBath/dayworkWasteDialog.vue

+ 7 - 0
src/api/business/daywork.js

@@ -89,6 +89,13 @@ export function getDayworkProcessList(query) {
 		params: query
 	})
 }
+export function getDayworkWasteProcessList(query) {
+	return request({
+		url: baseUrl + '/business/productionDaywork/getDayworkWasteProcessList',
+		method: 'get',
+		params: query
+	})
+}
 /**
  * 获取 计划查询的工段列表
  * @param {*} data

+ 25 - 5
src/views/business/reviseBath/dayworkWasteDialog.vue

@@ -83,13 +83,14 @@
         </el-form-item>
       </el-col>
       <el-col :span="9">
-        <el-form-item label="责任工序" label-width="100px" prop="technologicalProcessId">
+        <el-form-item label="责任工序" label-width="100px" prop="technologicalProcessDetailId">
           <el-select-v2
-              v-model="form.technologicalProcessId"
+              v-model="form.technologicalProcessDetailId"
               :options="processList"
               placeholder="请选择工序"
               :disabled="editStatus||form.deptId==null"
               style="width: 140px"
+              @change="getTechnologicalProcessDetail"
           >
           <template #default="{ index,item }">
             <span style="float: left;">{{ index +1 }}</span>
@@ -146,10 +147,11 @@
 <script setup>
 import { getDeptInfo } from "@/api/business/daywork.js"
 import {
-  getDayworkProcessList
+  getDayworkWasteProcessList
 } from "@/api/business/daywork.js";
 import {addLotWaste,updateLotWaste,delLotWaste} from "@/api/business/lotWaste.js";
 import useUserStore from '@/store/modules/user'
+import { ref } from "vue";
 const { proxy } = getCurrentInstance();
 const emit = defineEmits(["handleSaveSuccess"]);
 /** 字典数组区 */
@@ -160,6 +162,7 @@ const detailInfo = ref({})
 const processList = ref([]);
 const loading = ref(false);
 const editStatus = ref(true)
+const tempList = ref([])
 const visible = ref(false);
 const data = reactive({
   form: {},
@@ -196,10 +199,27 @@ const open = (row) => {
 //获得工序
 function getProcess() {
   form.value.technologicalProcessId = null
-  getDayworkProcessList({id:detailInfo.value.id,deptId:form.value.deptId}).then(response => {
-      processList.value = response.data
+  getDayworkWasteProcessList({id:detailInfo.value.id,deptId:form.value.deptId}).then(response => {
+    if(response.data && response.data.length > 0){
+      tempList.value = response.data
+      processList.value = response.data.map(v=>{
+        return {
+          label: v.processAlias,
+          value: v.technologicalProcessDetailId
+        }
+})
+    }else{
+      processList.value = []
+    }
     })
 }
+function getTechnologicalProcessDetail() {
+  let temp = tempList.value.find(v=>v.technologicalProcessDetailId == form.value.technologicalProcessDetailId)
+  if(temp) {
+    form.value.technologicalProcessId = temp.technologicalProcessId
+  }
+  console.log(form.value)
+}
 /** 取消按钮 */
 function handleCancel() {
   visible.value = false;