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

字段变更,部分操作改动

parent 8bce84ab
<template> <template>
<BasePage @getRow='getRow' ref="basePage" :power='power' :toolButton='false' class="min_full" style="height: 100%;border-top: 0px;" :autoQuery='false' <BasePage @getRow='getRow' ref="basePage" :power='power' :toolButton='false' class="min_full"
:config="config"> style="height: 100%;border-top: 0px;" :autoQuery='false' :config="config">
<template #dialog="ctx"> <template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 --> <!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template> </template>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
}, },
mixins:[wlsx,wlphsx], mixins: [wlsx, wlphsx],
data() { data() {
return { return {
power: { power: {
...@@ -44,18 +44,18 @@ ...@@ -44,18 +44,18 @@
queryUrl: 'wms/ckgl/dbck/query/detail', queryUrl: 'wms/ckgl/dbck/query/detail',
tableTitle: [{ tableTitle: [{
title: "物料编号", title: "物料编号",
field: "wlcode", field: "wlxxCode",
fieldType: "upper", fieldType: "upper",
width: 140 width: 140
}, },
{ {
title: "物料名称", title: "物料名称",
field: "wlmc", field: "wlxxName",
width: 140 width: 140
}, },
{ {
title: "物料规格", title: "物料规格",
field: "gg", field: "wlxxGg",
width: 140 width: 140
}, },
{ {
...@@ -101,13 +101,13 @@ ...@@ -101,13 +101,13 @@
}, },
methods: { methods: {
getRow(val){ getRow(val) {
this.$emit('getRow',val) this.$emit('getRow', val)
}, },
demo(ctx){ demo(ctx) {
if(ctx.singleItem&&ctx.singleItem.id){ if (ctx.singleItem && ctx.singleItem.id) {
console.log(ctx.singleItem) console.log(ctx.singleItem)
}else{ } else {
this.$warning('请选中一条数据') this.$warning('请选中一条数据')
} }
} }
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
<el-row :gutter="20" :app="this" class="editRow"> <el-row :gutter="20" :app="this" class="editRow">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false " <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-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' :prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig' :rule="item.rule" />
:rule="item.rule" />
<!-- 额外数据 --> <!-- 额外数据 -->
</el-row> </el-row>
...@@ -54,8 +53,9 @@ ...@@ -54,8 +53,9 @@
list.forEach(item => { list.forEach(item => {
// 转换并且push // 转换并且push
item.wlid = item.id item.wlid = item.id
item.wlmc = item.name item.wlxxName = item.name
item.wlcode = item.code item.wlxxCode = item.code
item.wlxxGg = item.gg
item.xqsl = 0 item.xqsl = 0
item.xqrq = new Date().getTime() item.xqrq = new Date().getTime()
delete item.id delete item.id
...@@ -161,20 +161,21 @@ ...@@ -161,20 +161,21 @@
}, },
{ {
title: "物料编号", title: "物料编号",
field: "code", field: "wlxxCode",
width: 240, width: 240,
type: 'AuxInput', type: 'AuxInput',
typeConfig: { typeConfig: {
"code": "MATERIAL", "code": "MATERIAL",
"label": "wlcode", "label": "wlxxCode",
"transform": { "transform": {
"value": "code", "value": "code",
"label": "code" "label": "code"
}, },
give(data) { give(data) {
this.form.wlid = data.id this.form.wlid = data.id
this.form.wlmc = data.name this.form.wlxxName = data.name
this.form.wlcode = data.code this.form.wlxxCode = data.code
this.form.wlxxGg = data.gg
} }
...@@ -182,12 +183,12 @@ ...@@ -182,12 +183,12 @@
}, },
{ {
title: "物料名称", title: "物料名称",
field: "wlmc", field: "wlxxName",
width: 160 width: 160
}, },
{ {
title: "规格", title: "规格",
field: "gg", field: "wlxxGg",
width: 140 width: 140
}, },
{ {
......
...@@ -69,12 +69,22 @@ ...@@ -69,12 +69,22 @@
{ {
title: "单据来源", title: "单据来源",
field: "djly", field: "djly",
width: 140 width: 140,
"transform": {
"url": "wms/ckgl/dbck/init/djly",
"label": "name",
"value": "id"
}
}, },
{ {
title: "状态", title: "状态",
field: "zt", field: "zt",
width: 140 width: 140,
"transform": {
"url": "wms/ckgl/dbck/init/zt",
"label": "name",
"value": "id"
}
}, },
{ {
title: "备注", title: "备注",
......
...@@ -167,8 +167,6 @@ ...@@ -167,8 +167,6 @@
} }
} }
}, },
{ {
"label": "领料部门", "label": "领料部门",
"prop": "bmid", "prop": "bmid",
......
...@@ -44,18 +44,18 @@ ...@@ -44,18 +44,18 @@
queryUrl: 'wms/rkgl/dbrk/query/detail', queryUrl: 'wms/rkgl/dbrk/query/detail',
tableTitle: [{ tableTitle: [{
title: "物料编号", title: "物料编号",
field: "wlcode", field: "wlxxCode",
fieldType: "upper", fieldType: "upper",
width: 140 width: 140
}, },
{ {
title: "物料名称", title: "物料名称",
field: "wlmc", field: "wlxxName",
width: 140 width: 140
}, },
{ {
title: "物料规格", title: "物料规格",
field: "gg", field: "wlxxGg",
width: 140 width: 140
}, },
{ {
......
...@@ -42,18 +42,18 @@ ...@@ -42,18 +42,18 @@
queryUrl: 'wms/rkgl/dbrk/query/dbrkqd', queryUrl: 'wms/rkgl/dbrk/query/dbrkqd',
tableTitle: [{ tableTitle: [{
title: "物料编号", title: "物料编号",
field: "wlcode", field: "wlxxCode",
fieldType: "upper", fieldType: "upper",
width: 140 width: 140
}, },
{ {
title: "物料名称", title: "物料名称",
field: "wlmc", field: "wlxxName",
width: 140 width: 140
}, },
{ {
title: "物料规格", title: "物料规格",
field: "gg", field: "wlxxGg",
width: 140 width: 140
}, },
{ {
......
...@@ -54,8 +54,9 @@ ...@@ -54,8 +54,9 @@
list.forEach(item => { list.forEach(item => {
// 转换并且push // 转换并且push
item.wlid = item.id item.wlid = item.id
item.wlmc = item.name item.wlxxName = item.name
item.wlcode = item.code item.wlxxCode = item.code
item.wlxxGg = item.gg
item.xqsl = 0 item.xqsl = 0
item.xqrq = new Date().getTime() item.xqrq = new Date().getTime()
delete item.id delete item.id
...@@ -161,20 +162,21 @@ ...@@ -161,20 +162,21 @@
}, },
{ {
title: "物料编号", title: "物料编号",
field: "code", field: "wlxxCode",
width: 240, width: 240,
type: 'AuxInput', type: 'AuxInput',
typeConfig: { typeConfig: {
"code": "MATERIAL", "code": "MATERIAL",
"label": "wlcode", "label": "wlxxCode",
"transform": { "transform": {
"value": "code", "value": "code",
"label": "code" "label": "code"
}, },
give(data) { give(data) {
this.form.wlid = data.id this.form.wlid = data.id
this.form.wlmc = data.name this.form.wlxxName = data.name
this.form.wlcode = data.code this.form.wlxxCode = data.code
this.form.wlxxGg = data.gg
} }
...@@ -182,12 +184,12 @@ ...@@ -182,12 +184,12 @@
}, },
{ {
title: "物料名称", title: "物料名称",
field: "wlmc", field: "wlxxName",
width: 160 width: 160
}, },
{ {
title: "规格", title: "规格",
field: "gg", field: "wlxxGg",
width: 140 width: 140
}, },
{ {
......
...@@ -55,15 +55,20 @@ ...@@ -55,15 +55,20 @@
}, },
methods: { methods: {
mpSave(list) { mpSave(list) {
let length = this.formDetail.length /* 可持续添加*/
this.formDetail.splice(0, length) let iscf=false
list.forEach(item => { let lydjidList=this.formDetail.map(item=>item.lydjid)
item.lydjid = item.id list.forEach(item=>{
delete item.id if(lydjidList.includes(item.lydjid)){
iscf=true
}else{
this.formDetail.push(_.cloneDeep(item)) this.formDetail.push(_.cloneDeep(item))
}
}) })
if(iscf){
this.$warning('存在重复数据,已自动过滤')
}
this.$forceUpdate()
}, },
mp() { mp() {
if (!this.form.lydjid) { if (!this.form.lydjid) {
...@@ -76,45 +81,9 @@ ...@@ -76,45 +81,9 @@
}, },
/* 需要整体row时的回调 */ /* 需要整体row时的回调 */
computedRow(row) { computedRow(row) {
// this.$refs.editTableForEdit.$forceUpdate()
}, },
/* 选择list时的回调 */ /* 选择list时的回调 */
// save(list) {
// list[0]['lydjid'] = list[0]['djid']
// delete list[0]['djid']
// if (list.length > 1) {
// this.$warning('只能选取一条数据')
// } else {
// /* 清空数据*/
// let length = this.formDetail.length
// this.formDetail.splice(0, length)
// for (var key in this.form) {
// key != 'id' && (() => {
// list[0][key] && (this.form[key] = list[0][key])
// })()
// }
// this.$post('wms/rkgl/rktz/query/detail', {
// mid: list[0].id
// }).then(res => {
// if (res.data && res.data.records) {
// res.data.records.forEach(item => {
// item.yrksl = item.yrksl || 0
// item.rksl = item.yssl;
// item.frksl = item.fyssl;
// item.rkje = item.wsje || 0;
// item["lydjid"] = item["id"];
// delete item["id"];
// delete item[
// "mid"];
// this.formDetail.push(_.cloneDeep(item))
// })
// }
// })
// }
// }
}, },
data() { data() {
return { return {
...@@ -288,15 +257,15 @@ ...@@ -288,15 +257,15 @@
field: "packCode", field: "packCode",
width: 240 width: 240
}, },
{ // {
title: "维护人", // title: "维护人",
field: "whr" // field: "whr"
}, // },
{ // {
title: "维护时间", // title: "维护时间",
field: "whsj", // field: "whsj",
fieldType: "ftDateTime" // fieldType: "ftDateTime"
}, // },
] ]
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="full"> <div class="full">
<div class="mpSearch" style="position: relative;"> <div class="mpSearch" style="position: relative;">
<el-button @click="search" size="mini" style="position: absolute;right: 10px;z-index: 999999; " <el-button @click="search" size="mini" style="position: absolute;right: 10px;z-index: 999999; "
type="primary">搜索</el-button> type="primary">添加</el-button>
<!-- 选择容器--> <!-- 选择容器-->
<!-- 选择包装码--> <!-- 选择包装码-->
<el-row :gutter="20" class="search-row-1"> <el-row :gutter="20" class="search-row-1">
...@@ -34,17 +34,19 @@ ...@@ -34,17 +34,19 @@
<!-- --> <!-- -->
</div> </div>
<BasePage ref="basePage" :toolButton='false' :power='power' class="min_full" :config="config" <EditTable staticHeader ref="editTable" :app='editTableConfig' >
style="height:calc(100% - 45px) ;width: 100%;"> <template slot="tabCustom">
<template #dialog="ctx"> <el-table-column label="操作" width="90" header-align="center" fixed="right" >
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 --> <template slot-scope="scope">
<el-button style="text-align: center;color: red;width: 100%;"
@click.native.prevent="del(scope.$index)" type="text" size="small">
<i class="el-icon-delete"></i>删除
</el-button>
</template> </template>
<template #toolbar="ctx"> </el-table-column>
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<!-- <el-button @click="demo(ctx.basePage)" size='mini' type="primary">示例按钮</el-button> -->
</template> </template>
</BasePage> </EditTable>
</div> </div>
</div> </div>
...@@ -57,6 +59,10 @@ ...@@ -57,6 +59,10 @@
</DefaultDialog> </DefaultDialog>
</template> </template>
<script> <script>
/* 逻辑变更
容器+唯一码搜索并添加,清除容器+唯一码,可单条删除
可继续添加,可删除
*/
export default { export default {
props: { props: {
...@@ -74,101 +80,130 @@ ...@@ -74,101 +80,130 @@
}, },
data() { data() {
return { return {
form: { editTableConfig:{
rqid: '', editTableTitle:[
rqCode: '' {
label: "容器",
}, prop: "rqCode",
power: { width: 170
add: false,
copy: false,
delButton: false,
editButton: false,
operateButtons: false,
workFlow: false,
/* 表格 */
showSelection: false,
saveSelected: false
}, },
config: { {
/* 基本配置*/ label: "物料编码",
url: 'wms/common/queryPackByCode', prop: "wlxxCode",
queryUrl: "wms/common/queryPackmxByCode", width: 170
tableTitle: [{
title: "物料编码",
field: "wlxxCode",
width: 140
}, },
{ {
title: "物料名称", label: "物料名称",
field: "wlxxName", prop: "wlxxName",
width: 140 width: 170
}, },
{ {
title: "物料规格", label: "物料规格",
field: "wlxxGg", prop: "wlxxGg",
width: 140 width: 170
}, },
{ {
title: "物料批号", label: "物料批号",
field: "wlph", prop: "wlph",
width: 140 width: 170
}, },
{ {
title: "物料数量", label: "物料数量",
field: "sl", prop: "sl",
width: 140 width: 140
}, },
{ {
title: "制令号", label: "制令号",
field: "zlh", prop: "zlh",
width: 140 width: 140
}, },
{ {
title: "唯一码", label: "唯一码",
field: "packCode", prop: "packCode",
width: 240 width: 240
}, }
{
title: "维护人",
field: "whr"
},
{
title: "维护时间",
field: "whsj",
fieldType: "ftDateTime"
},
], ],
queryParams: [] editTableData:[]
},
form: {
rqid: '',
rqCode: '',
id:'',
code:''
} }
} }
}, },
methods: { methods: {
/* 重新渲染表格 */
del(index){
this.editTableConfig.editTableData.splice(index,1)
},
save() { save() {
if(this.form.rqid){ if(
let list =this.$refs.basePage.tabData||[] this.editTableConfig.editTableData.length>0
list.forEach(item=>{ ){
item.rqid=this.form.rqid let list =this.editTableConfig.editTableData||[]
item.rqCode=this.form.rqCode
})
this.$emit('save',list) this.$emit('save',list)
this.app.showDialog=false this.app.showDialog=false
/* 触发传递事件*/ /* 触发传递事件*/
}else{ }else{
this.$warning('请选择容器后保存') this.$warning('请添加数据后保存')
} }
}, },
search() { search() {
/* 卡下数据*/ /* 卡下数据*/
if (this.form.packid) { if (this.form.packid&&this.form.rqid) {
this.$refs.basePage.queryParams.code = this.form.packcode // this.$refs.basePage.queryParams.code = this.form.packcode
this.$refs.basePage.refresh() // this.$refs.basePage.refresh()
/* 查询*/ /* 查询*/
let params={
code:this.form.packcode
}
this.$post('wms/common/queryPackmxByCode',params).then(res=>{
if(res.success){
let list=res.data.records||[]
/* 判定1*/
if(list.length==0){
this.$warning('暂未查询到数据')
}else{
let newList=list.map(item=>{
item.rqid=this.form.rqid
item.rqCode=this.form.rqCode
item.lydjid=item.id
delete item.id
return item
})
/* 判定重复*/
let iscf=false
let lydjidList=this.editTableConfig.editTableData.map(item=>item.lydjid)
newList.forEach(item=>{
if(lydjidList.includes(item.lydjid)){
iscf=true
}else{
this.editTableConfig.editTableData.push(_.cloneDeep(item))
}
})
/* 添加完毕要做的*/
if(iscf){
this.$warning('存在重复数据,已自动过滤')
}
/* 清除数据*/
this.form['rqCode']=''
this.form['rqid']=''
this.form['packid']=''
this.form['packcode']=''
this.$forceUpdate()
}
}
})
} else { } else {
this.$warning('请选择唯一码') this.$warning('请选择唯一码和容器')
} }
} }
......
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