Commit ba1d8292 authored by 李苏's avatar 李苏 💬

重写新增

parent b15bac68
......@@ -2,9 +2,12 @@
<BasePage ref="basePage" :power='power' class="min_full" :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
<Ph :app='ctx.basePage' v-if="ctx.basePage.showDialog==true" />
</template>
<template #toolbar="ctx">
<el-button v-if="ctx.basePage.powerObj['21']" @click="doConfirm(ctx.basePage)" size='mini' type="primary">解锁</el-button>
<el-button v-if="ctx.basePage.powerObj['01']" @click="add(ctx.basePage)" size='mini' type="primary">新增</el-button>
<el-button v-if="ctx.basePage.powerObj['21']" @click="doConfirm(ctx.basePage)" size='mini'
type="primary">解锁</el-button>
</template>
</BasePage>
......@@ -12,15 +15,26 @@
<script>
import Edit from './edit.vue'
import Ph from './ph.vue'
export default {
data() {
return {
power: {
add: false,
copy: false,
delButton: true,
editButton: false,
operateButtons: true,
workFlow: false,
/* 表格 */
showSelection: false,
saveSelected: false
},
config: {
queryDetail: true,
/* 基本配置*/
url: 'lxyl/zlgl/uLothold',
tableTitle: [
{
tableTitle: [{
title: "锁定状态",
field: "zt",
width: 80,
......@@ -66,8 +80,7 @@
},
],
queryParams: [
[
{
[{
label: '物料',
prop: 'wlxxInfo',
span: 5,
......@@ -97,7 +110,7 @@
"type": "RelSelect",
"value": "",
"typeConfig": {
"src":"lxyl/zlgl/uLothold/init/zt",
"src": "lxyl/zlgl/uLothold/init/zt",
"match": {
"value": "id",
"label": "name"
......@@ -112,6 +125,11 @@
}
},
methods: {
add(ctx) {
ctx.DialogTitle = '批号锁定'
ctx.DialogWidth = '60vw'
ctx.showDialog = true
},
doConfirm(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否确认?', '提示', {
......@@ -136,7 +154,8 @@
}
},
components: {
Edit
Edit,
Ph
}
}
......
<template>
<DefaultDialog :app='app'>
<div slot="form" style="display: flex;height: 450px;">
<Submit @save='savesdsm' :app='this' v-if="showDialog==true" />
<BasePage :power='{
add: false,
copy: false,
/* 手动控制删除 */
delButton: false,
/* 手动控制编辑按钮权限 */
editButton: false,
/* 是否渲染右侧操作按钮 */
operateButtons: false,
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: true,
saveSelected: true
}' ref="basePage" :changeQueryParams='changeQueryParams' class="min_full" :config="config" style="height: 100%;">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
</template>
</BasePage>
</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 Submit from './submit.vue'
export default {
props: {
app: {
type: Object,
default: ()=>{
return {}
}
}
},
async mounted() {
},
components:{
Submit
},
data() {
return {
showDialog:false,
DialogTitle:'提交',
DialogWidth:'40vw',
config: {
/* 基本配置*/
url: 'lxyl/zlgl/uLothold/queryWlphForHold',
queryUrl: 'lxyl/zlgl/uLothold/queryWlphForHold',
// queryUrl:'kc/wlph',
tableTitle: [{
title: "物料编码",
field: "wlxxCode",
width: 140
},
{
title: "物料批号",
field: "wlph",
width: 140
},
{
title: "物料名称",
field: "wlxxName",
width: 140
},
{
title: "物料规格",
field: "wlxxGg",
width: 140
},
{
title: "制令号",
field: "zlh",
width: 140
},
{
title: "数量",
field: "kcsl",
width: 140
}
],
queryParams: [
[{
label: '物料信息',
prop: 'wlxxInfo',
span: 6,
type: 'input',
},
{
label: '物料批号',
prop: 'wlph',
span: 6,
type: 'input',
},
{
label: '制令号',
prop: 'zlhInfos',
span: 12,
type: 'input',
},
]
],
/* 默认启停用 */
showqt: false,
}
}
},
methods: {
changeQueryParams(queryParams) {
let str = queryParams.zlhInfos
let trimmedStr = str.replace(/\s/g, ''); // 使用正则表达式去除空格
trimmedStr = trimmedStr.replace(/,/s, ',')
let arr = trimmedStr.split(",");
queryParams.zlhInfos = arr
},
save(){
let list = this.$refs.basePage.$refs.TablePager.selectedList
if(list.length==0){
this.$warning('请至少勾选一条数据')
}else{
/* 打开新的弹框*/
this.showDialog=true
}
},
savesdsm(form){
let list = this.$refs.basePage.$refs.TablePager.selectedList
let params = {
sdsm:form.sdsm,
datas:list.map(item=>item.wlph)
}
this.$post('lxyl/zlgl/uLothold/batchAdd',params).then(res=>{
if(res.success){
this.$success('操作成功')
this.app.showDialog=false
this.app.refresh()
}
}).catch(e=>{
// this.$success('操作成功')
// this.app.showDialog=false
// this.app.refresh()
})
}
},
}
</script>
<style scoped>
</style>
......@@ -11,9 +11,9 @@
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: false,
saveSelected: false
}' ref="basePage" class="min_full" :config="config">
showSelection: true,
saveSelected: true
}' ref="basePage" :changeQueryParams='changeQueryParams' class="min_full" :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
......@@ -25,7 +25,6 @@
</template>
<script>
export default {
data() {
return {
......@@ -33,10 +32,9 @@
config: {
/* 基本配置*/
url: 'lxyl/zlgl/uLothold/queryWlphForHold',
queryUrl:'lxyl/zlgl/uLothold/queryWlphForHold',
queryUrl: 'lxyl/zlgl/uLothold/queryWlphForHold',
// queryUrl:'kc/wlph',
tableTitle: [
{
tableTitle: [{
title: "物料编码",
field: "wlxxCode",
width: 140
......@@ -72,25 +70,39 @@
[{
label: '物料信息',
prop: 'wlxxInfo',
span: 8,
span: 6,
type: 'input',
},
{
label: '物料批号',
prop: 'wlph',
span: 8,
span: 6,
type: 'input',
}
},
{
label: '制令号',
prop: 'zlhInfos',
span: 12,
type: 'input',
},
]
],
/* 默认启停用 */
showqt:false,
showqt: false,
}
}
},
methods: {
changeQueryParams(queryParams) {
let str = queryParams.zlhInfos
let trimmedStr = str.replace(/\s/g, ''); // 使用正则表达式去除空格
trimmedStr = trimmedStr.replace(/,/s, ',')
let arr = trimmedStr.split(",");
queryParams.zlhInfos = arr
console.log(queryParams.zlhInfos)
},
},
components: {
......@@ -101,10 +113,11 @@
</script>
<style>
.font-success{
.font-success {
color: green;
}
.font-fail{
}
.font-fail {
color: red;
}
}
</style>
<template>
<DefaultDialog :app='app'>
<el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<!-- 辅助编码-->
<el-row :gutter="20" :app="this">
<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"
:prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig' :rule="item.rule" />
</el-row>
</el-form>
<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
} from 'common'
export default {
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
mixins: [editMixin],
async mounted() {
},
data() {
return {
readonly:false,
editColItemList: [
{
label: '锁定说明',
prop: 'sdsm',
span: 24,
type: 'input',
}
]
}
},
methods: {
save(){
this.$refs['form'].validate((valid) => {
if (valid) {
this.$emit('save',this.form)
}
})
}
}
}
</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