@@ -228,7 +217,8 @@ import {
getNewestProductPlanDetail,
getProductPlans,
startNextProductPlanDetail,
- getPlanDrawings
+ getPlanDrawings,
+ completeProductPlanDetailAttach
} from "@/api/board/laserLight";
const setState = (e) => {
@@ -273,9 +263,9 @@ export default {
this.$refs.table1.setCurrentRow(e.rows[0]);
this.getInfo(e.rows[0])
getNewestProductPlanDetail({planId: e.rows[0].planId}).then(val => {
- this.form = val.data
- this.form.materialId = e.rows[0].materialId
- this.form.materialName = e.rows[0].materialName
+ this.form = val.data || {}
+ this.form.materialId = e.rows[0]?.materialId
+ this.form.materialName = e.rows[0]?.materialName
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
})
@@ -467,23 +457,15 @@ export default {
})
},
async expandChange(e, rows) {
- console.log('rows',rows)
- if (rows.length === 0) return
- if (rows.length > 1) {
- this.$refs.table1.toggleRowExpansion(rows[0], false)
- }
+ this.drawingList = [e.planId]
const data = await getPlanDrawings({planId: e.planId, attachId: e.attachId})
- console.log(data)
- this.tableData = this.tableData.map(v=>{
- if(v.planId === e.planId){
- return {
- ...v,
- children:data?.data || []
- }
- }else{
- return v
+ this.$set(this.tableData,this.tableData.indexOf(e),{...e,drawing:data?.data.map((v,i)=>{
+ return {
+ ...v,
+ planId: e.planId + '-' + i
}
- })
+ }) || []})
+
},
// 设置图表信息
getInfo(e) {
@@ -509,7 +491,7 @@ export default {
center: ["50%", "50%"],
data: [
{
- value: e.planAmount === 0 ? 0.0001 : e.planAmount,
+ value: (e.attachId || '').split(',').length === 0 ? 0.0001 : (e.attachId || '').split(',').length,
label: {
normal: {
rich: {
@@ -667,7 +649,7 @@ export default {
center: ["50%", "50%"],
data: [
{
- value: (e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount),
+ value: Math.abs(((e.attachId || '').split(',').length - e.completeAmount) === 0 ? 0.0001 : ((e.attachId || '').split(',').length - e.completeAmount)),
label: {
normal: {
rich: {
@@ -746,7 +728,7 @@ export default {
center: ["50%", "50%"],
data: [
{
- value: ((e.completeAmount / e.planAmount) * 100).toFixed(2),
+ value: ((e.completeAmount / (e.attachId || '').split(',').length) * 100).toFixed(2),
label: {
normal: {
rich: {
@@ -788,7 +770,7 @@ export default {
},
},
{
- value: ((1 - (e.completeAmount / e.planAmount)) * 100).toFixed(2),
+ value: ((1 - (e.completeAmount / (e.attachId || '').split(',').length)) * 100).toFixed(2),
name: "invisible",
itemStyle: {
normal: {
@@ -805,12 +787,19 @@ export default {
})
},
// 开始继续
- async startNextProduction(e) {
- const data = await startNextProductPlanDetail({planId: e.planId})
+ async startNextProduction(val,e) {
+ const data = await startNextProductPlanDetail({planId: val.planId,attachId:e.attachId})
this.form = data.data
- this.form.materialId = e.materialId
- this.form.materialName = e.materialName
+ this.form.materialId = val.materialId
+ this.form.materialName = val.materialName
this.form.planDetailStatus = setState(data.data.planDetailStatus)
+ const data1 = await getPlanDrawings({planId: val.planId, attachId: val.attachId})
+ this.$set(this.tableData,this.tableData.indexOf(val),{...val,drawing:data1?.data.map((v,i)=>{
+ return {
+ ...v,
+ planId: val.planId + '-' + i
+ }
+ }) || []})
},
// 完成
accomplishPlan() {
@@ -820,7 +809,8 @@ export default {
type: 'success'
}).then(() => {
completeProductPlanDetail({
- planDetailId: this.form.planDetailId
+ planDetailId: this.form.planDetailId,
+ attachId: this.form.attachId
})
.then(() => {
this.$message({
diff --git a/hw-ui/src/views/login.vue b/hw-ui/src/views/login.vue
index f300cec..7a9c971 100644
--- a/hw-ui/src/views/login.vue
+++ b/hw-ui/src/views/login.vue
@@ -121,6 +121,11 @@ export default {
{
floor: 4,
processId: 43,
+ route: '/board/assemble'
+ },
+ {
+ floor: 4,
+ processId: 44,
route: '/board/weld'
},
{