Commit 093eefe5 authored by 李苏's avatar 李苏 💬

制令号变更弹框逻辑

parent bf5560f3
<template> <template>
<DefaultDialog :app='app'> <DefaultDialog :app='app'>
<div slot="form" style="display: flex;height: 70vh;"> <div slot="form" style="display: flex;height: 70vh;">
<Srzlh @changeZlh='changeZlh' :app='this' v-if="showDialog" />
<!-- basePage--> <!-- basePage-->
<BasePage ref="basePage" :power='power' :toolButton='false' class="min_full" style="height: 100%;" <BasePage ref="basePage" :power='power' :toolButton='false' class="min_full" style="height: 100%;"
:config="config"> :config="config">
<template #dialog="ctx"> <template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 --> <!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template> </template>
<template #toolbar="ctx"> <template #toolbar="ctx">
...@@ -22,6 +24,7 @@ ...@@ -22,6 +24,7 @@
</DefaultDialog> </DefaultDialog>
</template> </template>
<script> <script>
import Srzlh from './srzlh.vue'
export default { export default {
props: { props: {
...@@ -38,6 +41,10 @@ ...@@ -38,6 +41,10 @@
}, },
data() { data() {
return { return {
/* 单独控制本页的dialog*/
showDialog:false,
DialogTitle:'变更制令号',
DialogWidth:'30vw',
power: { power: {
add: false, add: false,
copy: false, copy: false,
...@@ -123,21 +130,25 @@ ...@@ -123,21 +130,25 @@
} }
}, },
components:{
Srzlh
},
methods: { methods: {
changeZlh(val){
let list =this.$refs.basePage.$refs.TablePager.selectedList
list.forEach(item=>{
item.bghzlh=val||''
})
/* 触发save事件 */
this.$emit('save',list)
},
save(){ save(){
/* 判定是否勾选*/ /* 判定是否勾选*/
let list =this.$refs.basePage.$refs.TablePager.selectedList let list =this.$refs.basePage.$refs.TablePager.selectedList
if(list.length!=0){ if(list.length!=0){
this.$prompt('请输入变更后的制令号', '', { this.showDialog=true
confirmButtonText: '确定', /*切换diglog弹框*/
cancelButtonText: '取消',
}).then(({ value }) => {
list.forEach(item=>{
item.bghzlh=value||''
})
/* 触发save事件 */
this.$emit('save',list)
})
}else{ }else{
this.$warning('请至少勾选一条数据') this.$warning('请至少勾选一条数据')
} }
......
<template>
<DefaultDialog :app='app'>
<div slot="form" style="">
<el-form slot="form" ref="form" :model="form" label-width="140px" :rules="rules">
<el-row :gutter="20" :app="this" class="editRow">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
v-for="(item,index) in editColItemList " :value="item.value" :span="item.span" :label="item.label"
v-if="(item.show==false)?false:true" :prop='item.prop' :key="item.prop" :type="item.type"
:typeConfig='item.typeConfig' :rule="item.rule" />
<!-- 额外数据 -->
</el-row>
</el-form>
</div>
<div slot="reFooter" class="refooter">
<span slot="footer" class="dialog-footer">
<el-button @click="app.showDialog=false">取 消</el-button>
<el-button type="primary" @click="save()">确 定</el-button>
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
editMixin,
editMixin_expand
} from 'common'
export default {
mixins: [editMixin, editMixin_expand],
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
async mounted() {
/* 初始化数据 */
}
,
data() {
return {
readonly:false,
editColItemList: [{
label: '变更后销售订单号',
prop: 'ddh',
span: 24,
type: 'input',
value: '',
"required": true,
},
{
label: '变更后行项目号',
prop: 'xmh',
span: 24,
type: 'input',
value: '',
"required": true,
}
]
}
},
methods: {
save() {
this.$refs['form'].validate((valid) => {
if (valid) {
/* */
let zlh=`${this.form.ddh}-${this.form.xmh}`
this.$emit('changeZlh',zlh)
this.app.showDialog=false
}
})
}
}
}
</script>
<style scoped>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment