guoyujia před 1 rokem
rodič
revize
8cc2a5e72f

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

@@ -71,6 +71,13 @@ export function getProducedLot(query) {
 		params: query
 	})
 }
+export function getItemProcess(query) {
+	return request({
+		url: baseUrl + '/business/productionDaywork/getItemProcess',
+		method: 'get',
+		params: query
+	})
+}
 /**
  * 获取 报工记录的工段
  * @param {*} data

+ 3 - 7
src/views/business/lot/index.vue

@@ -21,7 +21,7 @@
         <el-input
           placeholder="请输入生产计划单号"
           v-model.trim="queryParams.productionPlanNo"
-          style="width: 150px"
+          style="width: 120px"
           clearable
           @keyup.enter="handleQuerydaywork"
           @keydown.enter.prevent
@@ -94,7 +94,7 @@
           :editable="false"
           :clearable="false"
           placeholder="请选择开始时间"
-          style="width: 150px"
+          style="width: 130px"
           @change="handleDateChange"
         />
         <span>To</span>
@@ -105,7 +105,7 @@
           :editable="false"
           :clearable="false"
           placeholder="请选择结束时间"
-          style="width: 150px"
+          style="width: 130px"
           @change="handleDateChange"
         />
       </el-form-item>
@@ -320,21 +320,17 @@ import router from "@/router";
 import multiChange from "@/views/business/reviseBath/multiSingleChangeDialog.vue";
 import onceChange from "@/views/business/reviseBath/onceSingleChangeDialog.vue";
 import InBatchesDialog from "@/views/business/lot/InBatchesDialog.vue";
-import { listProcess } from "@/api/business/process";
 import { ref } from "vue";
 const route = useRoute();
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
-const { yes_no } = proxy.useDict("yes_no");
 const { is_identification } = proxy.useDict("is_identification");
 /** 表单抽屉 页变量 */
 const inBatchesDialogRef = ref(null);
 const loading = ref(false);
-const lotInfo = ref([]);
 const once = ref(true); //单批单改按钮是否可点击
 const multi = ref(true); //多批单改按钮是否可点击
 const lotList = ref([]);
-const value1 = ref(null);
 const total = ref(0);
 const processAlias = ref("");
 const deptName = ref("");

+ 60 - 50
src/views/business/reviseBath/producedLotForm.vue

@@ -48,6 +48,7 @@
         <el-form-item label="工段:">
           <el-select-v2
             v-model="queryParams.deptId"
+            clearable
             :options="deptList"
             placeholder="请选择工段"
             style="width: 140px"
@@ -55,13 +56,32 @@
         </el-form-item>
         <el-form-item label="工序:">
           <el-select-v2
-            v-model="processAlias"
+            v-model="queryParams.processId"
+            clearable
             :options="processList"
             placeholder="请选择工序"
             style="width: 140px"
-            @change="handleProcessChange"
           />
         </el-form-item>
+        <el-form-item label="标识:">
+        <el-select
+          style="width: 160px"
+          multiple
+          v-model="queryParams.flags"
+          collapse-tags
+          collapse-tags-tooltip
+          clearable
+          placeholder="请选择标识"
+          @change="handleFlagChange"
+        >
+          <el-option
+            v-for="item in is_identification"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
         <el-form-item>
           <el-button type="info" icon="Search" @click="handleQuerydaywork"
             >搜索</el-button
@@ -100,7 +120,7 @@
                 link
                 type="primary"
                 v-hasPermi="['business:productionPlan:query']"
-                @click="handleColumnClick(scope.row)"
+                @click="handleColumnClick(scope.row.lotCode)"
                 ><span>{{ scope.row.lotCode }}</span></el-button
               >
             </template>
@@ -146,24 +166,37 @@
             prop="processAlias"
             align="center"
           />
-          <el-table-column
-            label="废品回用"
-            width="70"
-            prop="isWasteRecycling"
-            align="center"
-          >
+          <el-table-column label="标识" width="300" align="center">
             <template #default="scope">
-              <dict-tag :options="yes_no" :value="scope.row.isWasteRecycling" />
+              <el-tag
+                v-if="scope.row.isWaste == 1"
+                class="spacing"
+                type="danger"
+                >{{ "批废" }}</el-tag
+              >
+              <el-tag
+                v-if="scope.row.isAmend == 1"
+                class="spacing"
+                type="danger"
+                >{{ "工艺修改" }}</el-tag
+              >
+              <el-tag
+                v-if="scope.row.isWasteRecycling == 1"
+                class="spacing"
+                type="primary"
+                >{{ "废品回用" }}</el-tag
+              >
             </template>
           </el-table-column>
-          <el-table-column
-            label="批废"
-            width="70"
-            prop="isWaste"
-            align="center"
-          >
+          <el-table-column label="母批号" prop="fromCode" align="center" >
             <template #default="scope">
-              <dict-tag :options="yes_no" :value="scope.row.isWaste" />
+              <el-button
+                link
+                type="primary"
+                width="150px"
+                @click="handleColumnClick(scope.row.fromCode)"
+                ><span>{{ scope.row.fromCode }}</span></el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -172,11 +205,11 @@
   </el-drawer>
 </template>
 <script setup>
-import { getProducedLot, getDeptList } from "@/api/business/daywork.js";
+import { getProducedLot, getDeptList,getItemProcess } from "@/api/business/daywork.js";
 import router from "@/router";
 const { proxy } = getCurrentInstance();
 /** 字典数组区 */
-const { yes_no } = proxy.useDict("yes_no");
+const { is_identification } = proxy.useDict("is_identification");
 /** 表单抽屉 页变量 */
 const currentProductionPlan = ref({});
 const loading = ref(false);
@@ -184,7 +217,6 @@ const lotList = ref([]);
 const lotInfo = ref([]);
 const visible = ref(false);
 const processList = ref([]);
-const processAlias = ref(null);
 const deptList = ref([]);
 /** 查询对象 */
 const queryParams = ref({
@@ -192,6 +224,7 @@ const queryParams = ref({
   pageSize: 10,
   lotCode: "",
   deptId: null,
+  processId:null,
 });
 const queryDeptParams = ref({
   lineNumber: "",
@@ -214,58 +247,35 @@ const open = (row) => {
       console.log("deptList", deptList);
     }
   });
+  getItemProcess(queryParams.value).then((response) => {
+    if (response.code == 200) {
+      processList.value = response.data;
+    }
+  });
   //获取工段信息
   getProducedLotList();
   visible.value = true;
 };
 /** 打开批次详情页 */
-function handleColumnClick(row) {
-  router.push({ path: "/reviseBath/lotFormParticulars/" + row.lotCode });
+function handleColumnClick(lotCode) {
+  router.push({ path: "/reviseBath/lotFormParticulars/" + lotCode });
 }
 /**获取生产计划列表 */
 function getProducedLotList() {
   loading.value = true;
-  processAlias.value = null;
   getProducedLot(queryParams.value).then((res) => {
     if (res.code == 200) {
       lotList.value = res.rows;
       lotInfo.value = res.rows;
-      res.rows.forEach((item) => {
-        // 如果 processList 中不存在当前 processAlias,则添加到 processList 中
-        if (
-          !processList.value.find(
-            (process) => process.label === item.processAlias
-          )
-        ) {
-          // 计算当前 processAlias 的唯一递增值
-          const count = processList.value.length;
-          processList.value.push({
-            label: item.processAlias,
-            value: count,
-          });
-        }
-      });
-      console.log(processList.value);
       loading.value = false;
     }
   });
 }
-/**工序切换 */
-function handleProcessChange() {
-  console.log(processList.value[processAlias.value].label);
-  // 使用 some 方法检查是否存在于 processList 中
-  lotList.value = lotInfo.value.filter((item) => {
-    // 检查当前对象的 processAlias 是否等于目标值
-    return item.processAlias == processList.value[processAlias.value].label;
-  });
-}
 
 /**搜索 */
 function handleQuerydaywork() {
   getProducedLotList();
 }
-/**查看 */
-function handleChecklot(row) {}
 /**
  * 对话框关闭 事件
  */