chore: 上传当前工作区修改
This commit is contained in:
@@ -92,14 +92,14 @@
|
||||
<el-table-column align="center" prop="订单号" label="生产订单" width="80" fixed/>
|
||||
<!-- <el-table-column align="center" prop="计划号" label="计划号" width="80" fixed/> -->
|
||||
<el-table-column align="center" prop="产品编码" label="物料编码" width="150" fixed/>
|
||||
<el-table-column align="center" prop="产品名称" label="物料名称" width="150" fixed/>
|
||||
<el-table-column align="center" prop="产品名称" label="物料名称" width="120" fixed/>
|
||||
<el-table-column align="center" prop="计划数量" label="计划数" width="70" fixed/>
|
||||
<el-table-column align="center" label="要求完工日期" width="100" fixed>
|
||||
<template slot-scope="scope">
|
||||
{{ formatDate(scope.row.要求完工日期) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="标准工时" label="工时" width="80" fixed/>
|
||||
<el-table-column align="center" prop="标准工时" label="工时" width="60" fixed/>
|
||||
<el-table-column align="center" prop="工序名称" label="工序名称" width="80" fixed/>
|
||||
<!-- <el-table-column align="center" prop="性质" label="性质" width="100" /> -->
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column align="center" prop="工序计划数量" label="工序计划数" width="100" /> -->
|
||||
<el-table-column align="center" prop="指派对象" label="指派对象" width="150" >
|
||||
<el-table-column align="center" prop="指派对象" label="指派对象" width="130" >
|
||||
<template slot-scope="scope">
|
||||
<div v-if="!scope.row.editingTarget" class="editable-cell" @click="startEditingTarget(scope.row)">
|
||||
{{ scope.row.指派对象 ? scope.row.指派对象: "请选择"}}
|
||||
@@ -133,7 +133,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="指派数量" label="指派数量" width="200" >
|
||||
<el-table-column align="center" prop="指派数量" label="指派数量" width="80" >
|
||||
|
||||
<template slot-scope="scope">
|
||||
<div v-if="!scope.row.editingNum" class="editable-cell" @click="startEditingNum(scope.row)">
|
||||
@@ -191,15 +191,15 @@
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="原料状态" width="100">
|
||||
<el-table-column align="center" label="原料状态" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini"
|
||||
<el-button type="text" size="mini" style="margin-right: 5px; padding:0; width:auto"
|
||||
@click="getitemdata(scope.row.订单号)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="历史工时" width="100">
|
||||
<el-table-column align="center" label="历史工时" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini"
|
||||
<el-button type="text" size="mini" style="margin-right: 5px; padding:0; width:auto"
|
||||
@click="getWorkHour(scope.row.产品编码)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -5,9 +5,43 @@
|
||||
<span class="show-text">任务ID:</span>
|
||||
<el-input v-model="searchForm.did" clearable size="small" style="width: 90px; margin-right: 8px" />
|
||||
<span class="show-text">项目号:</span>
|
||||
<el-input v-model="searchForm.projectNo" clearable size="small" style="width: 130px; margin-right: 8px" />
|
||||
<el-select
|
||||
v-model="searchForm.projectNo"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="queryProjects"
|
||||
size="small"
|
||||
style="width: 170px; margin-right: 8px"
|
||||
@clear="loadDefaultProjectOptions"
|
||||
@visible-change="handleProjectVisibleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in projectOptions"
|
||||
:key="item.项目号"
|
||||
:label="formatProjectLabel(item)"
|
||||
:value="item.项目号"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="show-text">物料编码:</span>
|
||||
<el-input v-model="searchForm.itemCode" clearable size="small" style="width: 170px; margin-right: 8px" />
|
||||
<el-select
|
||||
v-model="searchForm.itemCode"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="queryMaterialOptions"
|
||||
size="small"
|
||||
style="width: 190px; margin-right: 8px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.物料编码"
|
||||
:label="formatMaterialLabel(item)"
|
||||
:value="item.物料编码"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="show-text">类别:</span>
|
||||
<el-input v-model="searchForm.category" clearable size="small" style="width: 120px; margin-right: 8px" />
|
||||
<span class="show-text">操作人:</span>
|
||||
<el-input v-model="searchForm.operator" clearable size="small" style="width: 120px; margin-right: 8px" />
|
||||
<span class="show-text">开始日期:</span>
|
||||
@@ -21,7 +55,7 @@
|
||||
<el-option label="全部" value="全部" />
|
||||
</el-select>
|
||||
<el-button :loading="loading" icon="el-icon-search" plain size="small" type="primary" @click="searchTable">查询</el-button>
|
||||
<el-button :disabled="!multipleSelection.length" icon="el-icon-check" plain size="small" type="success" @click="batchValidate">批量校验</el-button>
|
||||
<el-button :disabled="!multipleSelection.length" icon="el-icon-check" plain size="small" type="success" @click="batchValidate" style="width: auto">批量校验</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
@@ -46,6 +80,7 @@
|
||||
<el-table-column align="left" label="物料编码" prop="物料编码" width="170" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="物料名称" prop="物料名称" width="180" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="图号" prop="图号" width="120" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="类别" prop="类别" width="120" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="任务描述" prop="任务描述" width="220" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="操作人" prop="操作人" width="110" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="开始时间" prop="开始时间" width="150" />
|
||||
@@ -54,11 +89,13 @@
|
||||
<el-table-column align="left" label="校验人" prop="校验人" width="110" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="校验时间" prop="校验时间" width="150" />
|
||||
<el-table-column align="left" label="备注" prop="备注" width="180" show-overflow-tooltip />
|
||||
<el-table-column align="center" fixed="right" label="操作" width="90">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" :disabled="!!scope.row.已校验" @click="openValidate(scope.row)">
|
||||
{{ scope.row.已校验 ? '已校验' : '校验' }}
|
||||
</el-button>
|
||||
<div class="design-action-buttons">
|
||||
<el-button type="text" size="mini" :disabled="!!scope.row.已校验" @click="openValidate(scope.row)">
|
||||
{{ scope.row.已校验 ? '已校验' : '校验' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -112,10 +149,13 @@ export default {
|
||||
dialogVisible: false,
|
||||
tableData: [],
|
||||
multipleSelection: [],
|
||||
projectOptions: [],
|
||||
materialOptions: [],
|
||||
searchForm: {
|
||||
did: '',
|
||||
projectNo: '',
|
||||
itemCode: '',
|
||||
category: '',
|
||||
operator: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
@@ -147,14 +187,28 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadDefaultProjectOptions()
|
||||
this.loadDefaultMaterialOptions()
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
loadDefaultProjectOptions() {
|
||||
this.queryProjects('')
|
||||
},
|
||||
loadDefaultMaterialOptions() {
|
||||
this.queryMaterialOptions('')
|
||||
},
|
||||
handleProjectVisibleChange(visible) {
|
||||
if (visible && this.projectOptions.length === 0) {
|
||||
this.loadDefaultProjectOptions()
|
||||
}
|
||||
},
|
||||
buildSearchParams() {
|
||||
return [
|
||||
['DID', this.searchForm.did || 0],
|
||||
['项目号', this.searchForm.projectNo || ''],
|
||||
['物料编码', this.searchForm.itemCode || ''],
|
||||
['类别', this.searchForm.category || ''],
|
||||
['操作人', this.searchForm.operator || ''],
|
||||
['开始日期', this.searchForm.startDate || ''],
|
||||
['结束日期', this.searchForm.endDate || ''],
|
||||
@@ -174,6 +228,24 @@ export default {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async queryProjects(query) {
|
||||
const data = this.CreateData('11', '设计报工_项目查询', [['过滤', query || '']])
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
this.projectOptions = response.data || []
|
||||
} catch (error) {
|
||||
this.projectOptions = []
|
||||
}
|
||||
},
|
||||
async queryMaterialOptions(query) {
|
||||
const data = this.CreateData('11', '设计报工_物料查询', [['过滤', query || '']])
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
this.materialOptions = response.data || []
|
||||
} catch (error) {
|
||||
this.materialOptions = []
|
||||
}
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.multipleSelection = selection
|
||||
},
|
||||
@@ -261,6 +333,12 @@ export default {
|
||||
},
|
||||
currentUserName() {
|
||||
return (this.$store && this.$store.getters && this.$store.getters.name) || ''
|
||||
},
|
||||
formatMaterialLabel(item) {
|
||||
return item.物料名称 ? `${item.物料编码} | ${item.物料名称}` : item.物料编码
|
||||
},
|
||||
formatProjectLabel(item) {
|
||||
return item.项目名称 ? `${item.项目号} | ${item.项目名称}` : item.项目号
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -278,4 +356,24 @@ export default {
|
||||
.show-text {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.design-action-buttons {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.design-action-buttons ::v-deep .el-button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-width: 32px;
|
||||
}
|
||||
|
||||
.design-action-buttons ::v-deep .el-button + .el-button {
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -23,9 +23,43 @@
|
||||
<span class="show-text">操作人:</span>
|
||||
<el-input v-model="searchForm.operator" clearable size="small" style="width: 120px; margin-right: 8px" />
|
||||
<span class="show-text">项目号:</span>
|
||||
<el-input v-model="searchForm.projectNo" clearable size="small" style="width: 130px; margin-right: 8px" />
|
||||
<el-select
|
||||
v-model="searchForm.projectNo"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="queryProjects"
|
||||
size="small"
|
||||
style="width: 170px; margin-right: 8px"
|
||||
@clear="loadDefaultProjectOptions"
|
||||
@visible-change="handleProjectVisibleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in projectOptions"
|
||||
:key="item.项目号"
|
||||
:label="formatProjectLabel(item)"
|
||||
:value="item.项目号"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="show-text">物料编码:</span>
|
||||
<el-input v-model="searchForm.itemCode" clearable size="small" style="width: 170px; margin-right: 8px" />
|
||||
<el-select
|
||||
v-model="searchForm.itemCode"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="queryMaterialOptions"
|
||||
size="small"
|
||||
style="width: 190px; margin-right: 8px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.物料编码"
|
||||
:label="formatMaterialLabel(item)"
|
||||
:value="item.物料编码"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="show-text">类别:</span>
|
||||
<el-input v-model="searchForm.category" clearable size="small" style="width: 120px; margin-right: 8px" />
|
||||
<span class="show-text">任务ID:</span>
|
||||
<el-input v-model="searchForm.did" clearable size="small" style="width: 90px; margin-right: 8px" />
|
||||
<el-button :loading="loading" icon="el-icon-search" plain size="small" type="primary" @click="searchTable">查询</el-button>
|
||||
@@ -54,6 +88,7 @@
|
||||
<el-table-column align="left" label="物料编码" prop="物料编码" width="170" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="物料名称" prop="物料名称" width="180" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="图号" prop="图号" width="120" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="类别" prop="类别" width="120" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="报工次数" prop="报工次数" width="90" />
|
||||
<el-table-column align="right" label="工时(h)" prop="工时小时" width="90">
|
||||
<template slot-scope="scope">
|
||||
@@ -80,12 +115,15 @@ export default {
|
||||
return {
|
||||
loading: false,
|
||||
tableData: [],
|
||||
projectOptions: [],
|
||||
materialOptions: [],
|
||||
searchForm: {
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
operator: '',
|
||||
projectNo: '',
|
||||
itemCode: '',
|
||||
category: '',
|
||||
did: ''
|
||||
}
|
||||
}
|
||||
@@ -97,9 +135,22 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadDefaultProjectOptions()
|
||||
this.loadDefaultMaterialOptions()
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
loadDefaultProjectOptions() {
|
||||
this.queryProjects('')
|
||||
},
|
||||
loadDefaultMaterialOptions() {
|
||||
this.queryMaterialOptions('')
|
||||
},
|
||||
handleProjectVisibleChange(visible) {
|
||||
if (visible && this.projectOptions.length === 0) {
|
||||
this.loadDefaultProjectOptions()
|
||||
}
|
||||
},
|
||||
buildSearchParams() {
|
||||
return [
|
||||
['开始日期', this.searchForm.startDate || ''],
|
||||
@@ -107,6 +158,7 @@ export default {
|
||||
['操作人', this.searchForm.operator || ''],
|
||||
['项目号', this.searchForm.projectNo || ''],
|
||||
['物料编码', this.searchForm.itemCode || ''],
|
||||
['类别', this.searchForm.category || ''],
|
||||
['DID', this.searchForm.did || 0]
|
||||
]
|
||||
},
|
||||
@@ -123,6 +175,24 @@ export default {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async queryProjects(query) {
|
||||
const data = this.CreateData('11', '设计报工_项目查询', [['过滤', query || '']])
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
this.projectOptions = response.data || []
|
||||
} catch (error) {
|
||||
this.projectOptions = []
|
||||
}
|
||||
},
|
||||
async queryMaterialOptions(query) {
|
||||
const data = this.CreateData('11', '设计报工_物料查询', [['过滤', query || '']])
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
this.materialOptions = response.data || []
|
||||
} catch (error) {
|
||||
this.materialOptions = []
|
||||
}
|
||||
},
|
||||
buildTree(rows) {
|
||||
const personMap = new Map()
|
||||
const dateMap = new Map()
|
||||
@@ -154,13 +224,19 @@ export default {
|
||||
getTreeTitle(row) {
|
||||
if (row.Level === 1) return row.操作人 || '未填写操作人'
|
||||
if (row.Level === 2) return row.工作日期 ? `日期 ${row.工作日期}` : '未填写日期'
|
||||
return row.任务描述 || `${row.DID || ''}`
|
||||
return row.类别 ? `${row.类别} | ${row.任务描述 || row.DID || ''}` : (row.任务描述 || `${row.DID || ''}`)
|
||||
},
|
||||
formatHours(value) {
|
||||
if (value === null || value === undefined || value === '') return ''
|
||||
const numberValue = Number(value)
|
||||
if (Number.isNaN(numberValue)) return ''
|
||||
return numberValue.toFixed(2)
|
||||
},
|
||||
formatMaterialLabel(item) {
|
||||
return item.物料名称 ? `${item.物料编码} | ${item.物料名称}` : item.物料编码
|
||||
},
|
||||
formatProjectLabel(item) {
|
||||
return item.项目名称 ? `${item.项目号} | ${item.项目名称}` : item.项目号
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,62 @@
|
||||
<span class="show-text">任务ID:</span>
|
||||
<el-input v-model="searchForm.did" clearable size="small" style="width: 90px; margin-right: 8px" />
|
||||
<span class="show-text">项目号:</span>
|
||||
<el-input v-model="searchForm.projectNo" clearable size="small" style="width: 130px; margin-right: 8px" />
|
||||
<el-select
|
||||
v-model="searchForm.projectNo"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="queryProjects"
|
||||
size="small"
|
||||
style="width: 170px; margin-right: 8px"
|
||||
@clear="loadDefaultProjectOptions"
|
||||
@visible-change="handleProjectVisibleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in projectOptions"
|
||||
:key="item.项目号"
|
||||
:label="formatProjectLabel(item)"
|
||||
:value="item.项目号"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="show-text">物料编码:</span>
|
||||
<el-input v-model="searchForm.itemCode" clearable size="small" style="width: 170px; margin-right: 8px" />
|
||||
<el-select
|
||||
v-model="searchForm.itemCode"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="queryMaterialOptions"
|
||||
size="small"
|
||||
style="width: 190px; margin-right: 8px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.物料编码"
|
||||
:label="formatMaterialLabel(item)"
|
||||
:value="item.物料编码"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="show-text">图号:</span>
|
||||
<el-input v-model="searchForm.drawingNo" clearable size="small" style="width: 120px; margin-right: 8px" />
|
||||
<span class="show-text">父件编码:</span>
|
||||
<el-input v-model="searchForm.parentItemCode" clearable size="small" style="width: 170px; margin-right: 8px" />
|
||||
<el-select
|
||||
v-model="searchForm.parentItemCode"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:remote-method="queryParentMaterialOptions"
|
||||
size="small"
|
||||
style="width: 190px; margin-right: 8px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in parentMaterialOptions"
|
||||
:key="item.物料编码"
|
||||
:label="formatMaterialLabel(item)"
|
||||
:value="item.物料编码"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="show-text">类别:</span>
|
||||
<el-input v-model="searchForm.category" clearable size="small" style="width: 120px; margin-right: 8px" />
|
||||
<span class="show-text">状态:</span>
|
||||
<el-select v-model="searchForm.status" clearable size="small" style="width: 110px; margin-right: 8px">
|
||||
<el-option label="全部" value="全部" />
|
||||
@@ -42,20 +91,24 @@
|
||||
<el-table-column align="left" label="物料编码" prop="物料编码" width="170" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="物料名称" prop="物料名称" width="180" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="图号" prop="图号" width="120" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="类别" prop="类别" width="120" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="任务描述" prop="任务描述" width="220" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="指派对象" prop="指派对象" width="180" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="预计开始" prop="预计开始时间" width="150" />
|
||||
<el-table-column align="center" label="预计结束" prop="预计结束时间" width="150" />
|
||||
<el-table-column align="center" label="报工次数" prop="报工次数" width="90" />
|
||||
<el-table-column align="center" label="未结束" prop="未结束报工数" width="80" />
|
||||
<el-table-column align="left" label="未结束人员" prop="未结束报工人员" width="150" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="最后开始" prop="最后开始时间" width="150" />
|
||||
<el-table-column align="center" label="最后结束" prop="最后结束时间" width="150" />
|
||||
<el-table-column align="left" label="设计要求" prop="设计要求" width="220" show-overflow-tooltip />
|
||||
<el-table-column align="center" fixed="right" label="操作" width="180">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="210">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" :disabled="!canStart(scope.row)" @click="startTask(scope.row)">开始</el-button>
|
||||
<el-button type="text" size="mini" :disabled="!canEnd(scope.row)" @click="endTask(scope.row)">结束</el-button>
|
||||
<el-button type="text" size="mini" :disabled="!canComplete(scope.row)" @click="completeTask(scope.row)">完成</el-button>
|
||||
<div class="design-action-buttons">
|
||||
<el-button type="text" size="mini" :disabled="!canStart(scope.row)" @click="startTask(scope.row)">开始</el-button>
|
||||
<el-button type="text" size="mini" :disabled="!canEnd(scope.row)" @click="endTask(scope.row)">结束</el-button>
|
||||
<el-button type="text" size="mini" :disabled="!canComplete(scope.row)" @click="completeTask(scope.row)">完成</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -71,32 +124,53 @@ export default {
|
||||
loading: false,
|
||||
actionLoading: false,
|
||||
tableData: [],
|
||||
projectOptions: [],
|
||||
materialOptions: [],
|
||||
parentMaterialOptions: [],
|
||||
searchForm: {
|
||||
did: '',
|
||||
projectNo: '',
|
||||
itemCode: '',
|
||||
drawingNo: '',
|
||||
parentItemCode: '',
|
||||
category: '',
|
||||
status: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadDefaultProjectOptions()
|
||||
this.loadDefaultMaterialOptions()
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
loadDefaultProjectOptions() {
|
||||
this.queryProjects('')
|
||||
},
|
||||
loadDefaultMaterialOptions() {
|
||||
this.queryMaterialOptions('')
|
||||
this.queryParentMaterialOptions('')
|
||||
},
|
||||
handleProjectVisibleChange(visible) {
|
||||
if (visible && this.projectOptions.length === 0) {
|
||||
this.loadDefaultProjectOptions()
|
||||
}
|
||||
},
|
||||
buildSearchParams() {
|
||||
return [
|
||||
['DID', this.searchForm.did || 0],
|
||||
['项目号', this.searchForm.projectNo || ''],
|
||||
['物料编码', this.searchForm.itemCode || ''],
|
||||
['图号', this.searchForm.drawingNo || ''],
|
||||
['类别', this.searchForm.category || ''],
|
||||
['关联父件物料编码', this.searchForm.parentItemCode || ''],
|
||||
['预计开始时间_Start', ''],
|
||||
['预计开始时间_End', ''],
|
||||
['预计结束时间_Start', ''],
|
||||
['预计结束时间_End', ''],
|
||||
['单据状态', this.searchForm.status || '']
|
||||
['单据状态', this.searchForm.status || ''],
|
||||
['当前操作人ID', this.currentUserId()],
|
||||
['当前操作人', this.currentUserName()]
|
||||
]
|
||||
},
|
||||
async searchTable() {
|
||||
@@ -112,18 +186,57 @@ export default {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async queryProjects(query) {
|
||||
const data = this.CreateData('11', '设计报工_项目查询', [['过滤', query || '']])
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
this.projectOptions = response.data || []
|
||||
} catch (error) {
|
||||
this.projectOptions = []
|
||||
}
|
||||
},
|
||||
async queryMaterialOptions(query) {
|
||||
const data = this.CreateData('11', '设计报工_物料查询', [['过滤', query || '']])
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
this.materialOptions = response.data || []
|
||||
} catch (error) {
|
||||
this.materialOptions = []
|
||||
}
|
||||
},
|
||||
async queryParentMaterialOptions(query) {
|
||||
const data = this.CreateData('11', '设计报工_物料查询', [['过滤', query || '']])
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
this.parentMaterialOptions = response.data || []
|
||||
} catch (error) {
|
||||
this.parentMaterialOptions = []
|
||||
}
|
||||
},
|
||||
canStart(row) {
|
||||
return row.单据状态 !== '已完成' && Number(row.未结束报工数 || 0) === 0
|
||||
return row.单据状态 !== '已完成' && Number(row.当前用户未结束报工数 || 0) === 0
|
||||
},
|
||||
canEnd(row) {
|
||||
return row.单据状态 !== '已完成' && Number(row.未结束报工数 || 0) > 0
|
||||
return Number(row.当前用户未结束报工数 || 0) > 0
|
||||
},
|
||||
canComplete(row) {
|
||||
return row.单据状态 !== '已完成' && Number(row.未结束报工数 || 0) === 0 && Number(row.报工次数 || 0) > 0
|
||||
return row.单据状态 !== '已完成' && Number(row.报工次数 || 0) > 0
|
||||
},
|
||||
startTask(row) {
|
||||
async startTask(row) {
|
||||
const latest = await this.getLatestTask(row.DID)
|
||||
if (!latest) return
|
||||
Object.assign(row, latest)
|
||||
if (latest.单据状态 === '已完成') {
|
||||
this.$message.error('任务已完成,不能开始')
|
||||
this.searchTable()
|
||||
return
|
||||
}
|
||||
if (Number(latest.当前用户未结束报工数 || 0) > 0) {
|
||||
this.$message.warning('当前人员已存在未结束的报工记录')
|
||||
return
|
||||
}
|
||||
this.runAction('设计报工_任务_开始', [
|
||||
['DID', row.DID],
|
||||
['DID', latest.DID],
|
||||
['操作人ID', this.currentUserId()],
|
||||
['操作人', this.currentUserName()]
|
||||
], '开始成功')
|
||||
@@ -135,16 +248,65 @@ export default {
|
||||
['操作人', this.currentUserName()]
|
||||
], '结束成功')
|
||||
},
|
||||
completeTask(row) {
|
||||
this.$confirm(`确定完成设计任务 DID ${row.DID} 吗?`, '提示', { type: 'warning' })
|
||||
async completeTask(row) {
|
||||
const latest = await this.getLatestTask(row.DID)
|
||||
if (!latest) return
|
||||
Object.assign(row, latest)
|
||||
if (Number(latest.未结束报工数 || 0) > 0) {
|
||||
const people = latest.未结束报工人员 || '有人员'
|
||||
this.$message.warning(`${people} 还未点击结束,不能完成任务`)
|
||||
return
|
||||
}
|
||||
if (latest.单据状态 === '已完成') {
|
||||
this.$message.warning('任务已完成')
|
||||
this.searchTable()
|
||||
return
|
||||
}
|
||||
if (!this.canComplete(latest)) {
|
||||
this.$message.warning('任务未产生已结束报工,不能完成')
|
||||
return
|
||||
}
|
||||
this.$confirm(`确定完成设计任务 DID ${latest.DID} 吗?`, '提示', { type: 'warning' })
|
||||
.then(() => {
|
||||
this.runAction('设计报工_任务_完成', [
|
||||
['DID', row.DID],
|
||||
['DID', latest.DID],
|
||||
['操作人', this.currentUserName()]
|
||||
], '完成成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
async getLatestTask(did) {
|
||||
const params = [
|
||||
['DID', did || 0],
|
||||
['项目号', ''],
|
||||
['物料编码', ''],
|
||||
['图号', ''],
|
||||
['类别', ''],
|
||||
['关联父件物料编码', ''],
|
||||
['预计开始时间_Start', ''],
|
||||
['预计开始时间_End', ''],
|
||||
['预计结束时间_Start', ''],
|
||||
['预计结束时间_End', ''],
|
||||
['单据状态', ''],
|
||||
['当前操作人ID', this.currentUserId()],
|
||||
['当前操作人', this.currentUserName()]
|
||||
]
|
||||
const data = this.CreateData('11', '设计报工_任务_查询', params)
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
const rows = response.data || []
|
||||
if (rows.length === 0) {
|
||||
this.$message.error('任务不存在或已被删除')
|
||||
this.searchTable()
|
||||
return null
|
||||
}
|
||||
return rows[0]
|
||||
} catch (error) {
|
||||
console.error('设计报工任务实时查询失败:', error)
|
||||
this.$message.error('完成前校验失败')
|
||||
return null
|
||||
}
|
||||
},
|
||||
async runAction(procedure, params, defaultMessage) {
|
||||
if (this.actionLoading) return
|
||||
this.actionLoading = true
|
||||
@@ -177,6 +339,12 @@ export default {
|
||||
currentUserName() {
|
||||
return (this.$store && this.$store.getters && this.$store.getters.name) || ''
|
||||
},
|
||||
formatMaterialLabel(item) {
|
||||
return item.物料名称 ? `${item.物料编码} | ${item.物料名称}` : item.物料编码
|
||||
},
|
||||
formatProjectLabel(item) {
|
||||
return item.项目名称 ? `${item.项目号} | ${item.项目名称}` : item.项目号
|
||||
},
|
||||
getStatusType(status) {
|
||||
if (status === '已完成') return 'success'
|
||||
if (status === '执行中') return 'warning'
|
||||
@@ -199,4 +367,24 @@ export default {
|
||||
.show-text {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.design-action-buttons {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.design-action-buttons ::v-deep .el-button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-width: 32px;
|
||||
}
|
||||
|
||||
.design-action-buttons ::v-deep .el-button + .el-button {
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
:remote-method="queryProjects"
|
||||
size="small"
|
||||
style="width: 150px; margin-right: 8px"
|
||||
@clear="loadDefaultProjectOptions"
|
||||
@visible-change="handleProjectVisibleChange"
|
||||
>
|
||||
<el-option v-for="item in projectOptions" :key="item.项目号" :label="item.项目号" :value="item.项目号" />
|
||||
<el-option v-for="item in projectOptions" :key="item.项目号" :label="formatProjectLabel(item)" :value="item.项目号" />
|
||||
</el-select>
|
||||
<span class="show-text">物料编码:</span>
|
||||
<el-select
|
||||
@@ -52,6 +54,8 @@
|
||||
:value="item.物料编码"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="show-text">类别:</span>
|
||||
<el-input v-model="searchForm.category" clearable size="small" style="width: 120px; margin-right: 8px" />
|
||||
<span class="show-text">状态:</span>
|
||||
<el-select v-model="searchForm.status" clearable size="small" style="width: 110px; margin-right: 8px">
|
||||
<el-option label="全部" value="全部" />
|
||||
@@ -120,6 +124,7 @@
|
||||
<el-table-column align="left" label="物料编码" prop="物料编码" width="170" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="物料名称" prop="物料名称" width="180" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="图号" prop="图号" width="130" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="类别" prop="类别" width="120" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="任务描述" prop="任务描述" width="220" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="父件物料编码" prop="关联父件物料编码" width="160" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="设计要求" prop="设计要求" width="220" show-overflow-tooltip />
|
||||
@@ -133,10 +138,12 @@
|
||||
<el-table-column align="center" label="创建日期" prop="创建日期" width="150" />
|
||||
<el-table-column align="left" label="创建人" prop="创建人" width="110" show-overflow-tooltip />
|
||||
<el-table-column align="left" label="备注" prop="备注" width="180" show-overflow-tooltip />
|
||||
<el-table-column align="center" fixed="right" label="操作" width="130">
|
||||
<el-table-column align="center" fixed="right" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="openEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="text" size="mini" class="danger-action" @click="deleteTask(scope.row)">删除</el-button>
|
||||
<div class="design-action-buttons">
|
||||
<el-button type="text" size="mini" @click="openEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="text" size="mini" class="danger-action" @click="deleteTask(scope.row)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -165,15 +172,16 @@
|
||||
<el-form-item label="项目号">
|
||||
<el-select
|
||||
v-model="formData.项目号"
|
||||
allow-create
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
default-first-option
|
||||
:remote-method="queryProjects"
|
||||
style="width: 100%"
|
||||
@clear="loadDefaultProjectOptions"
|
||||
@visible-change="handleProjectVisibleChange"
|
||||
>
|
||||
<el-option v-for="item in projectOptions" :key="item.项目号" :label="item.项目号" :value="item.项目号" />
|
||||
<el-option v-for="item in projectOptions" :key="item.项目号" :label="formatProjectLabel(item)" :value="item.项目号" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -199,7 +207,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料名称">
|
||||
<el-input v-model="formData.物料名称" />
|
||||
<el-input v-model="formData.物料名称" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -207,9 +215,14 @@
|
||||
<el-input v-model="formData.图号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类别">
|
||||
<el-input v-model="formData.类别" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="任务描述" prop="任务描述">
|
||||
<el-input v-model="formData.任务描述" />
|
||||
<el-input v-model="formData.任务描述" type="textarea" :rows="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -234,7 +247,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="父件物料名称">
|
||||
<el-input v-model="formData.关联父件物料名称" />
|
||||
<el-input v-model="formData.关联父件物料名称" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -318,6 +331,7 @@ export default {
|
||||
itemCode: '',
|
||||
drawingNo: '',
|
||||
parentItemCode: '',
|
||||
category: '',
|
||||
planStartFrom: '',
|
||||
planStartTo: '',
|
||||
planEndFrom: '',
|
||||
@@ -327,14 +341,14 @@ export default {
|
||||
formData: this.getEmptyForm(),
|
||||
rules: {
|
||||
物料编码: [{ required: true, message: '请选择物料编码', trigger: 'change' }],
|
||||
任务描述: [{ required: true, message: '请输入任务描述', trigger: 'blur' }],
|
||||
assigneeIds: [{ type: 'array', required: true, message: '请选择指派对象', trigger: 'change' }]
|
||||
任务描述: [{ required: true, message: '请输入任务描述', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.queryProjects('')
|
||||
this.loadDefaultProjectOptions()
|
||||
this.queryPersonnel('')
|
||||
this.loadDefaultMaterialOptions()
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
@@ -345,6 +359,7 @@ export default {
|
||||
物料编码: '',
|
||||
物料名称: '',
|
||||
图号: '',
|
||||
类别: '',
|
||||
任务描述: '',
|
||||
关联父件物料编码: '',
|
||||
关联父件物料名称: '',
|
||||
@@ -366,6 +381,7 @@ export default {
|
||||
['项目号', this.searchForm.projectNo || ''],
|
||||
['物料编码', this.searchForm.itemCode || ''],
|
||||
['图号', this.searchForm.drawingNo || ''],
|
||||
['类别', this.searchForm.category || ''],
|
||||
['关联父件物料编码', this.searchForm.parentItemCode || ''],
|
||||
['预计开始时间_Start', this.searchForm.planStartFrom || ''],
|
||||
['预计开始时间_End', this.searchForm.planStartTo || ''],
|
||||
@@ -390,6 +406,8 @@ export default {
|
||||
openAdd() {
|
||||
this.isEdit = false
|
||||
this.formData = this.getEmptyForm()
|
||||
this.loadDefaultProjectOptions()
|
||||
this.loadDefaultMaterialOptions()
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => this.$refs.taskForm && this.$refs.taskForm.clearValidate())
|
||||
},
|
||||
@@ -412,9 +430,23 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.loadDefaultProjectOptions()
|
||||
this.loadDefaultMaterialOptions()
|
||||
this.dialogVisible = true
|
||||
this.$nextTick(() => this.$refs.taskForm && this.$refs.taskForm.clearValidate())
|
||||
},
|
||||
loadDefaultProjectOptions() {
|
||||
this.queryProjects('')
|
||||
},
|
||||
loadDefaultMaterialOptions() {
|
||||
this.queryMaterialOptions('')
|
||||
this.queryParentMaterialOptions('')
|
||||
},
|
||||
handleProjectVisibleChange(visible) {
|
||||
if (visible && this.projectOptions.length === 0) {
|
||||
this.loadDefaultProjectOptions()
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs.taskForm.validate(async valid => {
|
||||
if (!valid) return
|
||||
@@ -447,6 +479,7 @@ export default {
|
||||
params.push(['物料编码', this.formData.物料编码 || ''])
|
||||
params.push(['物料名称', this.formData.物料名称 || ''])
|
||||
params.push(['图号', this.formData.图号 || ''])
|
||||
params.push(['类别', this.formData.类别 || ''])
|
||||
params.push(['任务描述', this.formData.任务描述 || ''])
|
||||
params.push(['关联父件物料编码', this.formData.关联父件物料编码 || ''])
|
||||
params.push(['关联父件物料名称', this.formData.关联父件物料名称 || ''])
|
||||
@@ -464,18 +497,68 @@ export default {
|
||||
deleteTask(row) {
|
||||
this.$confirm(`确定删除设计任务 DID ${row.DID} 吗?已有报工记录的任务不能删除。`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
const data = this.CreateData('12', '设计报工_任务_删除', [['DID', row.DID]])
|
||||
const response = await this.ExecDatabase(data)
|
||||
const result = this.getResult(response)
|
||||
if (String(result.result) === '1') {
|
||||
this.$message.success(result.message || '删除成功')
|
||||
const latest = await this.getLatestTask(row.DID)
|
||||
if (!latest) return
|
||||
Object.assign(row, latest)
|
||||
const blockMessage = this.getDeleteBlockMessage(latest)
|
||||
if (blockMessage) {
|
||||
this.$message.error(blockMessage)
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error(result.message || '删除失败')
|
||||
return
|
||||
}
|
||||
try {
|
||||
const data = this.CreateData('12', '设计报工_任务_删除', [['DID', row.DID]])
|
||||
const response = await this.ExecDatabase(data)
|
||||
const result = this.getResult(response)
|
||||
if (String(result.result) === '1') {
|
||||
this.$message.success(result.message || '删除成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error(result.message || '删除失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('设计任务删除失败:', error)
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
async getLatestTask(did) {
|
||||
const params = [
|
||||
['DID', did || 0],
|
||||
['项目号', ''],
|
||||
['物料编码', ''],
|
||||
['图号', ''],
|
||||
['类别', ''],
|
||||
['关联父件物料编码', ''],
|
||||
['预计开始时间_Start', ''],
|
||||
['预计开始时间_End', ''],
|
||||
['预计结束时间_Start', ''],
|
||||
['预计结束时间_End', ''],
|
||||
['单据状态', '']
|
||||
]
|
||||
const data = this.CreateData('11', '设计报工_任务_查询', params)
|
||||
try {
|
||||
const response = await this.ExecDatabase(data)
|
||||
const rows = response.data || []
|
||||
if (rows.length === 0) {
|
||||
this.$message.error('删除失败:任务不存在或已被删除')
|
||||
this.searchTable()
|
||||
return null
|
||||
}
|
||||
return rows[0]
|
||||
} catch (error) {
|
||||
console.error('设计任务删除前查询失败:', error)
|
||||
this.$message.error('删除失败')
|
||||
return null
|
||||
}
|
||||
},
|
||||
getDeleteBlockMessage(row) {
|
||||
if (Number(row.报工次数 || 0) > 0) return '删除失败:该任务已有设计报工记录,不能删除'
|
||||
if (row.单据状态 === '已完成') return '删除失败:任务已完成,不能删除'
|
||||
if (row.单据状态 && row.单据状态 !== '待开始') return `删除失败:任务状态为${row.单据状态},不能删除`
|
||||
return ''
|
||||
},
|
||||
async queryProjects(query) {
|
||||
const data = this.CreateData('11', '设计报工_项目查询', [['过滤', query || '']])
|
||||
try {
|
||||
@@ -528,6 +611,9 @@ export default {
|
||||
formatMaterialLabel(item) {
|
||||
return item.物料名称 ? `${item.物料编码} | ${item.物料名称}` : item.物料编码
|
||||
},
|
||||
formatProjectLabel(item) {
|
||||
return item.项目名称 ? `${item.项目号} | ${item.项目名称}` : item.项目号
|
||||
},
|
||||
formatPersonLabel(item) {
|
||||
return item.账号 ? `${item.人员姓名} | ${item.账号}` : item.人员姓名
|
||||
},
|
||||
@@ -572,6 +658,26 @@ export default {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.design-action-buttons {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.design-action-buttons ::v-deep .el-button {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-width: 32px;
|
||||
}
|
||||
|
||||
.design-action-buttons ::v-deep .el-button + .el-button {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.danger-action {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user