瀏覽代碼

1、06-包装计件单据维护

Lexie 1 年之前
父節點
當前提交
044235bcda

+ 8 - 1
src/api/mes_api_gty/otherDocuments.js

@@ -37,7 +37,14 @@ export const getOtherInfo = (params) => {
     params
   })
 }
-
+// 获取员工姓名
+export const getYg = (params) => {
+  return service({
+    url: '/mes_server/packaging_count_document/getYg',
+    method: 'get',
+    params
+  })
+}
 // 拉料计件产量维护修改
 export const updateData = (data) => {
   return service({

+ 69 - 10
src/view/performance/06-packingDocuments/index.vue

@@ -144,10 +144,16 @@
                 />
               </el-form-item>
               <el-form-item label="组别">
-                <el-input
+                <!-- <el-input
                   v-model="detailData.sczl_bzdh"
                   style="width: 50px;"
-                />
+                /> -->
+				<el-select v-model="detailData.sczl_bzdh" placeholder="" style="width: 70px" 
+				           
+				>
+				  <el-option label="A班" value="A班"></el-option>
+				  <el-option label="B班" value="B班"></el-option>
+				</el-select>
               </el-form-item>
               <br>
               <el-form-item
@@ -160,10 +166,16 @@
                 />
               </el-form-item>
               <el-form-item label="冲月定额">
-                <el-input
+                <!-- <el-input
                   v-model="detailData.sczl_冲定额"
                   style="width: 50px;"
-                />
+                /> -->
+				<el-select v-model="detailData.sczl_冲定额" placeholder="" style="width: 70px"
+				           
+				>
+				  <el-option label="" value=""></el-option>
+				  <el-option label="是" value="B班"></el-option>
+				</el-select>
               </el-form-item>
 
               <el-table
@@ -396,7 +408,7 @@ const type = ref('')
 const searchInfo = ref('')
 const currentRow = ref({})
 const multipleSelection = ref([])
-
+const minUniqId = ref('')
 // 获取列表数据
 const getTableData = async() => {
   try {
@@ -404,10 +416,18 @@ const getTableData = async() => {
       date: params.date, sys_id: params.sys_id,
       page: page.value.toString(), limit: limit.value.toString(),
     })
-    if (response.code === 0) {
-      total.value = response.data.total
-      tableData.splice(0, tableData.length, ...response.data.rows)
-    }
+   if (response.code === 0) {
+         total.value = response.data.total;
+         // 清空原有数据并填充新数据
+         tableData.splice(0, tableData.length, ...response.data.rows);
+   
+         // 获取最大的 UniqId
+        minUniqId.value= Math.min(...tableData.map(row => row.UniqId));
+         console.log('最小的 UniqId:', minUniqId.value);
+       } else {
+         console.error('获取数据失败:', response.msg);
+       }
+	
   } catch (e) {
     console.log(e)
   }
@@ -636,7 +656,44 @@ const updateDetailData = async() => {
 // 新增数据
 const handleShowAdd = () => {
   type.value = '新增'
-  getTableInfo(currentRow.value?.UniqId)
+  getTableInfo2(minUniqId.value)
+}
+// 获取详细信息
+const getTableInfo2 = async(id) => {
+  try {
+    const response = await getInfo({ UniqId: id })
+    if (response.code === 0) {
+      const { sczl_bh, name, sczl_bzdh, sczl_jsss, sczl_冲定额, sczl_desc, ...rest } = response.data
+      // 直接赋值基础属性
+	  let sczl_rq = new Date();
+	  console.log(sczl_rq);
+	  sczl_rq.setDate(sczl_rq.getDate() - 1); // 今天的前N天的日期,N自定义
+	  sczl_rq = sczl_rq.getFullYear() + '-' + (sczl_rq.getMonth() + 1) + '-' + sczl_rq.getDate();
+	  console.log(sczl_rq);
+      Object.assign(detailData, { sczl_rq, sczl_bh, name, sczl_bzdh, sczl_jsss, sczl_冲定额, sczl_desc })
+      // 生成表格数据
+      detailData.table = Array.from({ length: 6 }, (_, i) => i + 1) // 创建一个长度为6的数组 [1, 2, 3, 4, 5, 6]
+        .map(num => {
+          return {
+            sczl_gdbh: rest[`sczl_gdbh${num}`],
+            sczl_yjGx: rest[`sczl_yjGx${num}`],
+            sczl_gxmc: rest[`sczl_gxmc${num}`],
+            Gd_cpmc: rest[`Gd_cpmc${num}`],
+            sczl_cl: rest[`sczl_cl${num}`],
+            sczl_返工产量: rest[`sczl_返工产量${num}`],
+            sczl_PgCl: rest[`sczl_PgCl${num}`],
+            sczl_计产系数: rest[`sczl_计产系数${num}`],
+            sczl_Jtbh1: rest[`sczl_Jtbh${num}`],
+            sczl_dedh: rest[`sczl_dedh${num}`],
+          }
+        })
+        // .filter(item => item.sczl_gdbh !== '') // 过滤掉空的工单编号
+      detailData.UniqId = id
+      dialogFormVisible.value = true
+    }
+  } catch (e) {
+    console.log(e)
+  }
 }
 const addDetailData = async() => {
   const restoredData = {
@@ -671,6 +728,8 @@ const addDetailData = async() => {
       message: '新增成功',
     })
     dialogFormVisible.value = false
+	getTableData()
+	getSideData()
   }
 }
 

+ 51 - 13
src/view/performance/07-otherDocuments/index.vue

@@ -135,10 +135,19 @@
               <el-form-item
                 label="工序类别"
               >
-                <el-input
+                <!-- <el-input
                   v-model="detailData.sczl_Type"
                   style="width: 150px"
-                />
+                /> -->
+				<el-select v-model="detailData.sczl_Type" placeholder="" style="width: 180px"
+				           
+				>
+				  <el-option label="拆片" value="拆片"></el-option>
+				  <el-option label="包装" value="包装"></el-option>
+				  <el-option label="打包" value="打包"></el-option>
+				  <el-option label="拉料" value="拉料"></el-option>
+				  <
+				</el-select>
               </el-form-item>
 
               <el-form-item
@@ -168,10 +177,30 @@
               <el-form-item
                 label="工艺流程"
               >
-                <el-input
+               <!-- <el-input
                   v-model="detailData.image"
                   style="width: 300px"
-                />
+                /> -->
+				<el-select v-model="detailData.image" placeholder="" style="width: 180px"
+				           
+				>
+				  <el-option label="01-01-光边" value="01-01-光边"></el-option>
+				  <el-option label="01-02-胶印" value="01-02-胶印"></el-option>
+				  <el-option label="01-04-圆+五角星" value="01-04-圆+五角星"></el-option>
+				  <el-option label="01-05-磨砂" value="01-05-磨砂"></el-option>
+				  <el-option label="01-06-凹切" value="01-06-凹切"></el-option>
+				  <el-option label="01-30-拆片" value="01-30-拆片"></el-option>
+				  <el-option label="01-31-未机检前" value="01-31-未机检前"></el-option>
+				  <el-option label="01-35-机检(初检)" value="01-35-机检(初检)"></el-option>
+				  <el-option label="01-36-首次机检后" value="01-36-首次机检后"></el-option>
+				  <el-option label="01-37-次品检" value="01-37-次品检"></el-option>
+				  <el-option label="01-41-二次机检" value="01-41-二次机检"></el-option>
+				  <el-option label="01-45-二次机检后" value="01-45-二次机检后"></el-option>
+				  <el-option label="01-51-废挑正" value="01-51-废挑正"></el-option>
+				  <el-option label="01-61-抽检" value="01-61-抽检"></el-option>
+				  <el-option label="01-65-核检" value="01-65-核检"></el-option>
+				  <el-option label="01-71-包装" value="01-71-包装"></el-option>
+				</el-select>
                 <el-input
                   v-model="detailData.image"
                   style="width: 100px; margin-left: 5px"
@@ -247,7 +276,7 @@ import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDow
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { Search, Refresh, Download } from '@element-plus/icons-vue'
 import { ref, reactive, onMounted, onBeforeMount } from 'vue'
-import { getSide, getTable, getInfo, getOtherInfo, updateData,add } from '@/api/mes_api_gty/otherDocuments'
+import { getSide, getTable, getInfo, getOtherInfo, updateData,add,getYg } from '@/api/mes_api_gty/otherDocuments'
 
 defineOptions({
   name: '07OtherDocuments'
@@ -311,18 +340,26 @@ const params = {
   page: page.value.toString(),
   limit: limit.value.toString(),
 }
-
+const minUniqId = ref('')
 // 获取表格数据
 const getTableData = async() => {
   try {
     const response = await getTable(params)
     if (response.code === 0) {
-      total.value = response.data.total
-      tableData.splice(0, tableData.length, ...response.data.rows)
+           total.value = response.data.total;
+           // 清空原有数据并填充新数据
+           tableData.splice(0, tableData.length, ...response.data.rows);
+     
+           // 获取最大的 UniqId
+          minUniqId.value= Math.min(...tableData.map(row => row.UniqId));
+           console.log('最小的 UniqId:', minUniqId.value);
+         } else {
+           console.error('获取数据失败:', response.msg);
+         }
+    	
+    } catch (e) {
+      console.log(e)
     }
-  } catch (e) {
-    console.log(e)
-  }
 }
 
 // 分页设置
@@ -377,9 +414,10 @@ const handleShowDetail = () => {
   dialogFormVisible.value = true
 }
 const handleYgbhEnter = async() => {
-  const res = await getOtherInfo({ Sczl_bh1: detailData.Sczl_bh1 })
+  const res = await getYg({ sczl_bh: detailData.Sczl_bh1 })
+  console.log(detailData.Sczl_bh1)
   if (res.code === 0) {
-    detailData.name = res.data.name
+    detailData.name = res.data.ygxm
   }
 }