From cb78b4fbcd31bbee7ed7882c7b5f6f660f20c511 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期一, 20 十月 2025 09:56:19 +0800
Subject: [PATCH] 最新版本541200007
---
admin/src/components/business/OperaJkSketchResultWindow.vue | 66 +++++++++++++++++++++++++--------
1 files changed, 50 insertions(+), 16 deletions(-)
diff --git a/admin/src/components/business/OperaJkSketchResultWindow.vue b/admin/src/components/business/OperaJkSketchResultWindow.vue
index 961e82f..22cea21 100644
--- a/admin/src/components/business/OperaJkSketchResultWindow.vue
+++ b/admin/src/components/business/OperaJkSketchResultWindow.vue
@@ -28,12 +28,16 @@
<el-table-column prop="dateInfo" label="閫佽揣鏃ユ湡" min-width="130px"></el-table-column>
<el-table-column prop="lineName" label="閫佽揣绾胯矾" min-width="130px"> </el-table-column>
<el-table-column prop="orderNum" label="瀹㈡埛鏁�(鎴�)" min-width="130px"> </el-table-column>
- <el-table-column prop="totalNum" label="閫佽揣閲�(鏉�)" min-width="130px"></el-table-column>
+ <el-table-column prop="totalNum" label="閫佽揣閲�/鏈�澶ч噺(鏉�)" min-width="130px">
+ <template slot-scope="{row}">
+ {{row.totalNum ||0}} / {{row.maxOrder || 0}}
+ </template>
+ </el-table-column>
<el-table-column prop="carCode" label="杞︾墝鍙�" min-width="100px"></el-table-column>
<el-table-column prop="memberName" label="閫佽揣鍙告満" min-width="100px"></el-table-column>
<el-table-column prop="distance" label="鎬昏矾绋�(鍏噷)" min-width="100px">
<template slot-scope="{row}">
- {{((row.distance ||0)/1000).toFixed(2)}}
+ {{((row.distance ||0)/1000).toFixed(2)}}(璋冩暣鍓�)
</template>
</el-table-column>
<el-table-column
@@ -42,11 +46,11 @@
align="left"
fixed="right"
>
- <template slot-scope="{row}">
+ <template slot-scope="{row}" v-if="dataList.length>1">
<el-button type="text" @click="updateDo(row)" icon="el-icon-edit" style="color: #0d68ff" v-if="!updating" >寰皟</el-button>
<template v-else-if="updating && currentRow.id ===row.id" >
<el-button type="text" style="color: #13ce66" >鏈溅</el-button>
- <el-button type="text" @click="cancelDo(row)" icon="el-icon-delete" style="color: red" >鍙栨秷</el-button>
+ <el-button type="text" @click="cancelDo(row)" icon="el-icon-circle-close" style="color: red" >鍙栨秷</el-button>
</template>
<el-button type="text" @click="addDo(row)" icon="el-icon-plus" style="color: red" v-else-if="updating && currentRow.id !==row.id" >鍔犲叆</el-button>
</template>
@@ -60,7 +64,8 @@
<div>
<p class="tip-warn"><i class="el-icon-warning"></i>鎿嶄綔璇存槑锛�<br>
1.璇烽�夋嫨鑻ュ共瀹㈡埛淇℃伅锛岀偣鍑讳笂杩板叾浠栫嚎璺悗鐨�<span class="red">銆愬姞鍏ャ��</span>鎸夐挳锛屽皢閫変腑鐨勫鎴风Щ鍔犲埌瀵瑰簲绾胯矾涓�;<br>
- 2.鐐瑰嚮鏈溅绾胯矾鍚庣殑<span class="red">銆愬彇娑堛��</span>鎸夐挳锛屽彲鎾ら攢鏈溅寰皟鎿嶄綔;<br>
+ 2.鐐瑰嚮鏈溅绾胯矾鍚庣殑<span class="red">銆愬彇娑堛��</span>鎸夐挳锛屽彲鎾ら攢鏈溅寰皟鎿嶄綔;<br>
+ 3.缁忚繃璋冩暣鍚庣殑绾胯矾璺▼鏁拌绛夊緟鎻愪氦鍚庢煡鐪�;<br>
</p>
<el-table :data="paginatedData" stripe @selection-change="handleSelectionChange">>
<el-table-column type="selection" width="55"></el-table-column>
@@ -87,6 +92,7 @@
</div>
<template v-slot:footer>
<el-button @click="confirmDo" type="primary" v-if="buttonName!==''">{{ buttonName||'纭' }}</el-button>
+ <el-button @click="resetData" type="danger" v-if="buttonName!==''">鎾ら攢鎵�鏈夎皟鏁�</el-button>
<el-button @click="visible=false">杩斿洖</el-button>
</template>
</GlobalWindow>
@@ -96,6 +102,7 @@
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { allList as customerList } from '@/api/business/jkSketchCustomer'
+import { updateSketchLine } from '@/api/business/jkSketch'
export default {
name: 'OperaJkSketchLineWindow',
extends: BaseOpera,
@@ -104,11 +111,13 @@
return {
// 琛ㄥ崟鏁版嵁
updating: false,
+ edited: false,
currentRow: null,
model: {
},
buttonName: '',
dataList: [],
+ originDataList: [],
currentPage: 1,
pageSize: 10,
totalItems: 0, // 鎬绘暟鎹潯鐩暟
@@ -131,8 +140,28 @@
}
},
methods: {
+ resetData () {
+ this.buttonName = ''
+ this.cancelDo()
+ this.loadList()
+ },
confirmDo () {
-
+ this.isWorking = true
+ updateSketchLine({
+ id: this.model.id,
+ sketchLineList: this.dataList
+ })
+ .then(() => {
+ this.visible = false
+ this.$tip.apiSuccess('绾胯矾璋冩暣宸插畬鎴愶紒')
+ this.$emit('success')
+ })
+ .catch(e => {
+ // this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking = false
+ })
},
open (title, target) {
this.title = title + target.categoryName
@@ -153,7 +182,7 @@
this.selectRows = []
this.updating = true
},
- cancelDo (row) {
+ cancelDo () {
this.selectRows = []
this.currentRow = null
this.updating = false
@@ -177,22 +206,22 @@
tarray.push(item)
}
})
- if(tarray.length === 0){
+ if (tarray.length === 0) {
this.$message.error('瀵逛笉璧凤紝鏈溅绾胯矾鑷冲皯鐣欏瓨涓�涓鎴蜂俊鎭紝鏃犳硶鍏ㄩ儴娓呯┖锛�')
return
}
- var rArray = row.customerList || []
- rArray = rArray.push(...this.selectRows)
+ var rArray = [...row.customerList || []]
+ rArray.push(...this.selectRows)
let ttNum = 0
rArray.forEach(item => {
ttNum += (item.totalNum || 0)
})
- if(tarray.length >= (row.maxCustomer||0)){
- this.$message.error('瀵逛笉璧凤紝鍔犲叆鐨勭嚎璺渶澶ф敮鎸�'+ (row.maxOrderNum||0) + '瀹㈡埛锛�')
+ if (tarray.length >= (row.maxCustomer || 0)) {
+ this.$message.error('瀵逛笉璧凤紝鍔犲叆鐨勭嚎璺渶澶ф敮鎸�' + (row.maxCustomer || 0) + '瀹㈡埛锛�')
return
}
- if(ttNum >= (row.maxOrder||0)){
- this.$message.error('瀵逛笉璧凤紝鍔犲叆鐨勭嚎璺渶澶ф敮鎸�'+ (row.maxOrder||0) + '閫佽揣閲忥紒')
+ if (ttNum >= (row.maxOrder || 0)) {
+ this.$message.error('瀵逛笉璧凤紝鍔犲叆鐨勭嚎璺渶澶ф敮鎸�' + (row.maxOrder || 0) + '閫佽揣閲忥紝褰撳墠鏂规锛�' + ttNum)
return
}
this.currentRow.customerList = tarray
@@ -204,6 +233,9 @@
this.currentRow = null
this.updating = false
this.buttonName = '淇濆瓨璋冩暣寮�濮嬩紭鍖�'
+
+ console.log(this.dataList)
+ console.log(this.originDataList)
},
handleSelectionChange (rows) {
this.selectRows = rows
@@ -227,9 +259,11 @@
},
loadList () {
this.api.allList({
- sketchId: this.model.id
+ sketchId: this.model.id,
+ type: 1
}).then(res => {
- this.dataList = res
+ this.dataList = [...(res || [])]
+ this.originDataList = JSON.parse(JSON.stringify(res||[]));
this.loadCustomerList()
})
},
--
Gitblit v1.9.3