From c552dfd69248938b68e349a047a599063402044c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 15 十一月 2023 19:06:06 +0800
Subject: [PATCH] modified: src/views/plan/customerorder/customerorder-form.vue modified: src/views/plan/customerorder/index.vue modified: src/views/plan/masterproductionschedule/auto-manufacturingorder.vue
---
src/views/common/param-mergeTemplate.vue | 133 ++++++++++++++++++++++++++------------------
1 files changed, 78 insertions(+), 55 deletions(-)
diff --git a/src/views/common/param-mergeTemplate.vue b/src/views/common/param-mergeTemplate.vue
index 63c4c4c..d8a0cb7 100644
--- a/src/views/common/param-mergeTemplate.vue
+++ b/src/views/common/param-mergeTemplate.vue
@@ -1,60 +1,68 @@
<template>
<div>
- <avue-crud ref="crud" class="l-mes" rowKey="oneId" :data="tableData" :option="option" :span-method="spanMethod"
- :page="page" :table-loading="loading">
+ <avue-crud
+ ref="crud"
+ class="l-mes"
+ rowKey="id"
+ :data="tableData"
+ :option="option"
+ :span-method="spanMethod"
+ :page="page"
+ :table-loading="loading">
<template slot="code" slot-scope="scope">
- <avue-text-ellipsis use-tooltip :text="scope.row.code" :height="40" :width="100">
+ <avue-text-ellipsis use-tooltip :text="scope.row.code" :height="textEllipsisHeight" :width="textEllipsisWidth">
<small slot="more">...</small>
</avue-text-ellipsis>
</template>
<template slot="paramValue" slot-scope="scope">
- <el-input @blur="checkType(scope.row)" :disabled="routingTemplateId!=null" :placeholder="'璇疯緭鍏�'+scope.row.paramType" v-model="scope.row.paramValue"/>
+ <el-input @blur="checkType(scope.row)" :disabled="routingTemplateId!=null || !scope.row.isUpdate" :placeholder="'璇疯緭鍏�'+scope.row.paramType" v-model="scope.row.paramValue"/>
+ </template>
+ <template slot="menu" slot-scope="scope">
+ <el-button type="text" v-if="scope.row.isUpdate && isModel" size="mini"
+ @click="handleParamSave(scope.$index, scope.row)">淇濆瓨</el-button>
+ <el-button type="text" v-if="!scope.row.isUpdate && isModel" size="mini"
+ @click="handleParamEdit(scope.$index, scope.row)">缂栬緫</el-button>
+ <el-button type="text" size="mini" v-if="isModel"
+ @click.stop="handleParamInsert(scope.row)">鎻掑叆</el-button>
+ <el-button type='text' :disabled="routingTemplateId!=null"
+ @click.stop="handleParamDelete(scope.row, scope.index)">鍒犻櫎</el-button>
</template>
</avue-crud>
- <!-- <el-table :data="tableData" ref="commonTree" :span-method="objectSpanMethod" border row-key="id" style="width: 100%">
- <el-table-column prop="code" label="缂栫爜"></el-table-column>
- <el-table-column prop="paramItem" label="涓�绾�"></el-table-column>
- <el-table-column prop="paramItemTwo" label="浜岀骇"></el-table-column>
- <el-table-column prop="paramItemThree" label="涓夌骇"></el-table-column>
- <el-table-column prop="paramType" label="绫诲瀷"></el-table-column>
- <el-table-column prop="paramValue" label="鍊�"></el-table-column>
- <el-table-column prop="unit" label="鍗曚綅"></el-table-column>
- </el-table> -->
</div>
</template>
<script>
export default {
- // props: ["tableTreeData"],
- data() {
- return {
- checkType(row) {
- if (row.paramType == '鏁板�兼牸寮�') {
- let val = row.paramValue
- const reg = /^[0-9]*$/
- if (!reg.test(val)) {
- row.paramValue = ''
- this.$message.warning("璇疯緭鍏ユ暟鍊兼牸寮忕殑鏁版嵁锛�")
- }
- }
- },
- mergeObj: {},
- mergeArr: ['code','paramItem', 'paramItemTwo',],
- tableData: [],
- // routingTemplateId: null
- }
- },
props: {
+ //鏄惁涓哄弬鏁版ā鏉�
+ isModel:{
+ type: Boolean,
+ default:()=>{
+ return false
+ }
+ },
+ textEllipsisWidth:{
+ type: Number,
+ default:()=>{
+ return 100
+ }
+ },
+ textEllipsisHeight:{
+ type: Number,
+ default:()=>{
+ return 40
+ }
+ },
option: {
type: Object,
default: () => {
return {
height: 600,
- loadingText: "鍔犺浇涓�...",
columnBtn: false,
index: true,
indexLabel: '搴忓彿',
- menu: false,
+ menu: true,
+ menuWidth: 100,
menuAlign: 'center',
editBtn: false,
delBtn: false,
@@ -105,7 +113,7 @@
message: "鍗曚綅涓嶈兘涓虹┖",
trigger: "blur"
}]
- },]
+ },]
}
}
},
@@ -115,10 +123,6 @@
return []
},
required: true
- },
- loading: {
- type: Boolean,
- default: false
},
page: {
type: Object,
@@ -148,36 +152,50 @@
routingTemplateId: {
type: String,
default: () => {
- return ''
+ return null
}
- }
+ },
+ handleParamDelete:{
+ type: Function
+ },
+ handleParamEdit:{
+ type: Function
+ },
+ handleParamInsert:{
+ type: Function
+ },
+ handleParamSave:{
+ type: Function
+ },
},
watch:{
+ table(val) {
+ this.doLayout()
+ },
tableTreeData:{
handler(old,newval){
- console.log(this.tableTreeData);
- this.tableData=JSON.parse(JSON.stringify(this.tableTreeData))
- // this.getSpanArr(this.tableData);
- this.rowSort()
- this.rowCalc()
+ this.loading = true
+ this.tableData=JSON.parse(JSON.stringify(this.tableTreeData))
+ this.rowSort()
+ this.rowCalc()
+ this.loading = false
},
deep: true
- }
+ },
},
created() {
- // this.$nextTick(() => {
- // this.$refs.crud.doLayout()
- // })
+ this.loading = true
this.tableData=JSON.parse(JSON.stringify(this.tableTreeData))
this.rowSort()
this.rowCalc()
- },
- beforeDestroy(){
- console.log("閿�姣佸墠");
+ setTimeout(()=>{
+ this.loading = false
+ },1000)
},
data(){
return {
-
+ tableData: [],
+ loading: false,
}
},
methods:{
@@ -260,7 +278,12 @@
</script>
<style>
-.avue-crud__menu {
+.avue-crud_menu{
display: none;
}
+.avue-crud .el-table th {
+ word-break: break-word;
+ color: rgba(102,102,102,1);
+ background-color: white;
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3