|
|
@@ -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()
|
|
|
}
|
|
|
}
|
|
|
|