From 95e34f7f11a54ebebbadc4a21d4f3e2af2baa9aa Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 06 八月 2024 17:01:17 +0800
Subject: [PATCH] 1.递交
---
src/views/basicSettings/meterPrice.vue | 173 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 148 insertions(+), 25 deletions(-)
diff --git a/src/views/basicSettings/meterPrice.vue b/src/views/basicSettings/meterPrice.vue
index 3c94848..4fee272 100644
--- a/src/views/basicSettings/meterPrice.vue
+++ b/src/views/basicSettings/meterPrice.vue
@@ -57,10 +57,10 @@
/>
</el-select>
</el-form-item>
- <el-form-item v-if="mesSetting.route" label="鍏宠仈宸ュ簭" style=" display: flex;">
+ <el-form-item label="鍏宠仈宸ュ簭" style=" display: flex;">
<el-select
v-model="form.stepcode"
- :disabled="form.routecode===''"
+ :disabled="mesSetting.route?form.routecode==='':form.partcode===''"
:popper-append-to-body="false"
style="width: 200px"
placeholder="璇烽�夋嫨"
@@ -192,7 +192,7 @@
:title="operation==='add'?'鏂板':'缂栬緫'"
:visible.sync="dialogVisible"
width="1100px"
- top="15vh"
+ top="5vh"
:close-on-click-modal="false"
@closed="handleClose"
@close="handleClose"
@@ -252,28 +252,101 @@
</el-form-item>
</div>
</el-form>
-
+ <!-- :expand-row-keys="expandRowKeys"-->
+ <!-- row-key="code"-->
<el-table
:data="stepDialogArr"
style="width: 100%"
- height="300"
+ height="600"
+
border
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
:row-class-name="tableRowClassName"
>
+ <el-table-column type="expand">
+ <template slot-scope="props">
+ <el-table
+ :data="props.row.children"
+ style="width: 96%;margin: auto;"
+ border
+ :row-class-name="tableRowClassName"
+ >
+ <el-table-column
+ prop="eqp_code"
+ label="璁惧/寰�鏉ョ紪鐮�"
+ min-width="120"
+ />
+ <el-table-column
+ prop="eqp_name"
+ label="璁惧/寰�鏉ュ悕绉�"
+ min-width="120"
+ />
+ <el-table-column
+ prop="eqp_value"
+ label="璁惧鑺傛媿"
+ min-width="150"
+ >
+ <template slot-scope="{row}">
+ <div style="display: flex;align-items: center">
+ <el-input
+ v-model="row.eqp_value"
+ placeholder="璇疯緭鍏�"
+ oninput="value=value.replace(/[^0-9.]/g,'')"
+ @change="val=>eqpValueChange(val,row)"
+ />
+ <div style="margin-left: 5px">绉�</div>
+ </div>
+
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="stand_value"
+ label="鐢熶骇鑺傛媿"
+ min-width="120"
+ >
+ <template slot-scope="{row}">
+ <div>{{ row.stand_value + ' ' + '绉�/娆�' }}</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="cavity_qty"
+ label="鑵斿瀷鏁�"
+ min-width="120"
+ >
+ <template slot-scope="{row}">
+ <el-input
+ v-model="row.cavity_qty"
+ placeholder="璇疯緭鍏�"
+ oninput="value=value.replace(/[^0-9.]/g,'')"
+ @change="val=>cavityQtyChange(val,row)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="unprice"
+ label="宸ュ簭宸ヤ环"
+ min-width="120"
+ >
+ <template slot-scope="{row}">
+ <el-input v-model="row.unprice" oninput="value=value.replace(/[^0-9.]/g,'')" />
+ </template>
+ </el-table-column>
+ </el-table>
+ </template>
+ </el-table-column>
<el-table-column
- prop="step_seq"
+ prop="seq"
label="宸ュ簭椤哄簭"
width="100"
/>
<el-table-column
- prop="step_code"
+ prop="code"
label="宸ュ簭缂栫爜"
width="200"
/>
<el-table-column
- prop="step_name"
+ prop="name"
label="宸ュ簭鍚嶇О"
width="200"
/>
@@ -318,6 +391,7 @@
directives: { elDragDialog, waves },
data() {
return {
+ mesSetting: JSON.parse(localStorage.getItem('mesSetting')),
mainHeight: 0,
tableHeight: 0,
form: {
@@ -432,7 +506,27 @@
width: false,
prop: 'unprice',
label: '璁′欢鍗曚环',
- id: 17,
+ id: 12,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'lm_user',
+ label: '鍒涘缓浜哄憳',
+ id: 13,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 14,
show: true,
fixed: false,
sortable: true
@@ -460,8 +554,7 @@
editStepName: '', // 缂栬緫鏃跺姞宸ュ伐搴忓悕绉�
operation: '',
- mesSetting: JSON.parse(localStorage.getItem('mesSetting'))
-
+ expandRowKeys: []// 榛樿灞曞紑
}
},
@@ -471,6 +564,10 @@
mounted() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
+
+ if (!this.mesSetting.route) {
+ this.tableColumnSettingsArray = this.tableColumnSettingsArray.filter(i => i.prop !== 'route_name')
+ }
},
methods: {
tableColumnUpdate(val, isCopyTrue) {
@@ -524,8 +621,12 @@
},
async partChange(val) {
const { data: res } = await PartSelectRpute({ partcode: val })
- this.routeArr = res
- this.form.routecode = ''
+ if (this.mesSetting.route) {
+ this.routeArr = res
+ this.form.routecode = ''
+ } else {
+ this.stepArr = res
+ }
this.form.stepcode = ''
},
async routeChange(val) {
@@ -554,6 +655,12 @@
async routeDialogChange(val) {
const { data: res } = await RouteSelectStep({ partcode: this.dialogForm.partcode, routecode: val })
this.stepDialogArr = res
+
+ this.expandRowKeys = this.stepDialogArr.map(i => {
+ if (i.children.length > 0) {
+ return i.code
+ }
+ })
},
// 鏂板鎸夐挳
@@ -627,22 +734,22 @@
this.$refs.dialogForm.validate(valid => {
if (valid) {
const children = []
- this.stepDialogArr.forEach(i => {
- children.push({
- 'code': i.step_code,
- 'name': i.step_name,
- 'seq': i.step_seq,
- 'isbott': i.isbott,
- 'isend': i.isend,
- 'unprice': i.unprice
- })
- })
+ // this.stepDialogArr.forEach(i => {
+ // children.push({
+ // 'code': i.step_code,
+ // 'name': i.step_name,
+ // 'seq': i.step_seq,
+ // 'isbott': i.isbott,
+ // 'isend': i.isend,
+ // 'unprice': i.unprice
+ // })
+ // })
const data = [
{
'partcode': this.dialogForm.partcode,
'defaultroute_code': this.dialogForm.routecode,
- 'children': children
+ 'children': this.stepDialogArr
}
]
SaveBeatRate(data).then(res => {
@@ -657,7 +764,23 @@
}
})
},
-
+ // 璁惧鑺傛媿鍊兼敼鍙�
+ eqpValueChange(val, row) {
+ console.log(val, row)
+ if (parseFloat(row.cavity_qty) !== 0) {
+ row.stand_value = parseFloat((parseFloat(val) / parseFloat(row.cavity_qty)).toFixed(2))
+ } else {
+ row.stand_value = 0
+ }
+ },
+ // 鑵斿瀷鏁板�兼敼鍙�
+ cavityQtyChange(val, row) {
+ if (parseFloat(val) !== 0) {
+ row.stand_value = parseFloat((parseFloat(row.eqp_value) / parseFloat(val)).toFixed(2))
+ } else {
+ row.stand_value = 0
+ }
+ },
// 鑾峰彇椤甸潰楂樺害
getHeight() {
this.$nextTick(() => {
--
Gitblit v1.9.3