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

字段变更,部分操作改动

parent 8bce84ab
<template>
<BasePage @getRow='getRow' ref="basePage" :power='power' :toolButton='false' class="min_full" style="height: 100%;border-top: 0px;" :autoQuery='false'
:config="config">
<BasePage @getRow='getRow' ref="basePage" :power='power' :toolButton='false' class="min_full"
style="height: 100%;border-top: 0px;" :autoQuery='false' :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
......@@ -20,7 +20,7 @@
},
mixins:[wlsx,wlphsx],
mixins: [wlsx, wlphsx],
data() {
return {
power: {
......@@ -44,55 +44,55 @@
queryUrl: 'wms/ckgl/dbck/query/detail',
tableTitle: [{
title: "物料编号",
field: "wlcode",
field: "wlxxCode",
fieldType: "upper",
width: 140
},
{
title: "物料名称",
field: "wlmc",
width: 140
},
title: "物料名称",
field: "wlxxName",
width: 140
},
{
title: "物料规格",
field: "wlxxGg",
width: 140
},
{
title: "制令号",
field: "zlh",
width: 120,
},
{
title: "物料批号",
field: "wlph",
width: 140
},
{
title: "调拨数量",
field: "bcsl",
width: 100,
},
{
title: "出库数量",
field: "rksl",
width: 100,
},
{
title: "过账数量",
field: "cksl",
width: 100,
},
{
title: "物料规格",
field: "gg",
width: 140
},
{
title: "制令号",
field: "zlh",
width: 120,
},
{
title: "物料批号",
field: "wlph",
width: 140
},
{
title: "调拨数量",
field: "bcsl",
width: 100,
},
{
title: "出库数量",
field: "rksl",
width: 100,
},
{
title: "过账数量",
field: "cksl",
width: 100,
},
{
title: "状态",
field: "zt",
width: 100,
title: "状态",
field: "zt",
width: 100,
"transform": {
"url": "wms/ckgl/dbck/init/zt",
"label": "name",
"value": "id"
}
}
"url": "wms/ckgl/dbck/init/zt",
"label": "name",
"value": "id"
}
}
],
queryParams: [],
......@@ -101,13 +101,13 @@
},
methods: {
getRow(val){
this.$emit('getRow',val)
getRow(val) {
this.$emit('getRow', val)
},
demo(ctx){
if(ctx.singleItem&&ctx.singleItem.id){
demo(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
console.log(ctx.singleItem)
}else{
} else {
this.$warning('请选中一条数据')
}
}
......@@ -121,4 +121,4 @@
</script>
<style>
</style>
</style>
\ No newline at end of file
<template>
<RelDialog bigTitle detailTable='DBCKMX' @getFormDetail='getFormDetail' width="70%" :type='type' :editApp='editApp'
:app='app' :buttonApp='buttonApp'>
<el-form slot="form" ref="form" :model="form" label-width="100px" :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"
:prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig'
:rule="item.rule" />
<!-- 额外数据 -->
</el-row>
<RelDialog bigTitle detailTable='DBCKMX' @getFormDetail='getFormDetail' width="70%" :type='type' :editApp='editApp'
:app='app' :buttonApp='buttonApp'>
<el-form slot="form" ref="form" :model="form" label-width="100px" :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"
:prop='item.prop' :key="item.prop" :type="item.type" :typeConfig='item.typeConfig' :rule="item.rule" />
<!-- 额外数据 -->
</el-row>
<div class="editTab">
<editTableForEdit :indexApp='app' :type='type' @save='save' ref="editTableForEdit"
:editTableTitle='editTableTitle' v-if="editTableForEdit" :computedRow='computedRow'
:editTableData="formDetail" />
</div>
<el-row class="bottomInfo" :gutter="20">
<el-col class="center" :span="12">
创建人:{{
<div class="editTab">
<editTableForEdit :indexApp='app' :type='type' @save='save' ref="editTableForEdit"
:editTableTitle='editTableTitle' v-if="editTableForEdit" :computedRow='computedRow'
:editTableData="formDetail" />
</div>
<el-row class="bottomInfo" :gutter="20">
<el-col class="center" :span="12">
创建人:{{
form.cjr||localUser
}}
</el-col>
<el-col class="center" :span="12">
创建时间:{{
</el-col>
<el-col class="center" :span="12">
创建时间:{{
$moment(form.cjsj).format('YYYY-MM-DD HH:mm:ss')||$moment().format('YYYY-MM-DD HH:mm:ss')
}}
</el-col>
</el-row>
</el-form>
</el-col>
</el-row>
</el-form>
<!-- editTab数据 -->
</RelDialog>
<!-- editTab数据 -->
</RelDialog>
</template>
<script>
import {
toFixed,
doRkdChange
} from 'common/src/utils/blur.js'
import {
editMixin,
editMixin_expand
} from 'common'
import {
toFixed,
doRkdChange
} from 'common/src/utils/blur.js'
import {
editMixin,
editMixin_expand
} from 'common'
export default {
mixins: [editMixin, editMixin_expand],
methods: {
/* 需要整体row时的回调 */
computedRow(row) {
// this.$refs.editTableForEdit.$forceUpdate()
},
/* 选择list时的回调 */
save(list) {
list.forEach(item => {
// 转换并且push
item.wlid = item.id
item.wlmc = item.name
item.wlcode = item.code
item.xqsl = 0
item.xqrq = new Date().getTime()
delete item.id
this.formDetail.push(_.cloneDeep(item))
export default {
mixins: [editMixin, editMixin_expand],
methods: {
/* 需要整体row时的回调 */
computedRow(row) {
// this.$refs.editTableForEdit.$forceUpdate()
},
/* 选择list时的回调 */
save(list) {
list.forEach(item => {
// 转换并且push
item.wlid = item.id
item.wlxxName = item.name
item.wlxxCode = item.code
item.wlxxGg = item.gg
item.xqsl = 0
item.xqrq = new Date().getTime()
delete item.id
this.formDetail.push(_.cloneDeep(item))
})
}
},
data() {
return {
/* 常规edit数据 */
editColItemList: [{
label: '入库单号',
prop: 'djid',
span: 8,
type: 'input',
},
{
label: '入库日期',
prop: 'ywrq',
span: 8,
type: 'date',
value: new Date().getTime(),
"required": true,
},
{
"label": "仓库",
"prop": "ckid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "jcsj/common/ck/queryCkid",
"match": {
"value": "id",
"label": "name"
}
}
},
})
}
},
data() {
return {
/* 常规edit数据 */
editColItemList: [{
label: '入库单号',
prop: 'djid',
span: 8,
type: 'input',
},
{
label: '入库日期',
prop: 'ywrq',
span: 8,
type: 'date',
value: new Date().getTime(),
"required": true,
},
{
"label": "仓库",
"prop": "ckid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "jcsj/common/ck/queryCkid",
"match": {
"value": "id",
"label": "name"
}
}
},
{
"label": "调入仓库",
"prop": "dfckid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "jcsj/common/ck/queryCkid",
"match": {
"value": "id",
"label": "name"
}
}
},
{
"label": "调入仓库",
"prop": "dfckid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "jcsj/common/ck/queryCkid",
"match": {
"value": "id",
"label": "name"
}
}
"label": "事务类型",
"prop": "swlxid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "wms/ckgl/dbck/init/swlx",
"match": {
"value": "id",
"label": "name"
}
}
},
{
"label": "部门",
"prop": "bmid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "jcsj/common/bm/query",
"match": {
"value": "id",
"label": "bmmc"
}
}
},
{
label: '备注',
prop: 'bz',
span: 24,
type: 'input',
},
{
"label": "事务类型",
"prop": "swlxid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "wms/ckgl/dbck/init/swlx",
"match": {
"value": "id",
"label": "name"
}
}
},
{
"label": "部门",
"prop": "bmid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "jcsj/common/bm/query",
"match": {
"value": "id",
"label": "bmmc"
}
}
},
{
label: '备注',
prop: 'bz',
span: 24,
type: 'input',
},
],
/* 从表编辑数据 */
editTableTitle: [{
title: "序号",
field: "xh",
width: 50,
align: "center"
},
{
title: "物料编号",
field: "code",
width: 240,
type: 'AuxInput',
typeConfig: {
"code": "MATERIAL",
"label": "wlcode",
"transform": {
"value": "code",
"label": "code"
},
give(data) {
this.form.wlid = data.id
this.form.wlmc = data.name
this.form.wlcode = data.code
],
/* 从表编辑数据 */
editTableTitle: [{
title: "序号",
field: "xh",
width: 50,
align: "center"
},
{
title: "物料编号",
field: "wlxxCode",
width: 240,
type: 'AuxInput',
typeConfig: {
"code": "MATERIAL",
"label": "wlxxCode",
"transform": {
"value": "code",
"label": "code"
},
give(data) {
this.form.wlid = data.id
this.form.wlxxName = data.name
this.form.wlxxCode = data.code
this.form.wlxxGg = data.gg
}
}
}
},
{
title: "物料名称",
field: "wlmc",
width: 160
},
{
title: "规格",
field: "gg",
width: 140
},
{
title: "计量单位",
field: "jldwname",
width: 100,
allowEdit: false
},
}
},
{
title: "制令号",
field: "zlh",
title: "物料名称",
field: "wlxxName",
width: 160
},
{
title: "规格",
field: "wlxxGg",
width: 140
},
{
title: "计量单位",
field: "jldwname",
width: 100,
allowEdit: false
},
{
title: "制令号",
field: "zlh",
type: 'inputText',
width: 100,
allowEdit: true
width: 100,
allowEdit: true
},
{
title: "调拨数量",
field: "bcsl",
allowEdit: true,
type: 'inputNumber',
width: 200,
blur: toFixed(null),
},
{
title: "调拨数量",
field: "bcsl",
allowEdit: true,
type: 'inputNumber',
width: 200,
blur: toFixed(null),
},
/* 不可编辑*/
{
title: "出库数量",
field: "cksl",
width: 200,
title: "出库数量",
field: "cksl",
width: 200,
},
{
title: "物料批号",
field: "wlph",
type: 'inputText',
width: 200,
show: JSON.parse(localStorage.getItem('isPhgl'))
},
{
title: "库位",
field: "kwid",
width: 240,
type: 'AuxInput',
typeConfig: {
isRequest: false,
"code": "KWWH",
"label": "kwName",
queryParams: (row) => {
return {
ckid: this.form.ckid
}
},
"transform": {
"value": "id",
"label": "name"
}
{
title: "物料批号",
field: "wlph",
type: 'inputText',
width: 200,
show: JSON.parse(localStorage.getItem('isPhgl'))
},
{
title: "库位",
field: "kwid",
width: 240,
type: 'AuxInput',
typeConfig: {
isRequest: false,
"code": "KWWH",
"label": "kwName",
queryParams: (row) => {
return {
ckid: this.form.ckid
}
},
"transform": {
"value": "id",
"label": "name"
}
},
show: JSON.parse(localStorage.getItem('isKwgl')),
},
{
title: "备注",
field: "bz",
width: 200,
type: 'inputText',
allowEdit: true
}
},
show: JSON.parse(localStorage.getItem('isKwgl')),
},
{
title: "备注",
field: "bz",
width: 200,
type: 'inputText',
allowEdit: true
}
]
}
}
}
]
}
}
}
</script>
<style lang="scss" scoped>
@import url("~common/src/assets/styles/editDetail.scss");
@import url("~common/src/assets/styles/editDetail.scss");
</style>
......@@ -69,12 +69,22 @@
{
title: "单据来源",
field: "djly",
width: 140
width: 140,
"transform": {
"url": "wms/ckgl/dbck/init/djly",
"label": "name",
"value": "id"
}
},
{
title: "状态",
field: "zt",
width: 140
width: 140,
"transform": {
"url": "wms/ckgl/dbck/init/zt",
"label": "name",
"value": "id"
}
},
{
title: "备注",
......
......@@ -167,8 +167,6 @@
}
}
},
{
"label": "领料部门",
"prop": "bmid",
......
......@@ -44,18 +44,18 @@
queryUrl: 'wms/rkgl/dbrk/query/detail',
tableTitle: [{
title: "物料编号",
field: "wlcode",
field: "wlxxCode",
fieldType: "upper",
width: 140
},
{
title: "物料名称",
field: "wlmc",
field: "wlxxName",
width: 140
},
{
title: "物料规格",
field: "gg",
field: "wlxxGg",
width: 140
},
{
......
......@@ -42,18 +42,18 @@
queryUrl: 'wms/rkgl/dbrk/query/dbrkqd',
tableTitle: [{
title: "物料编号",
field: "wlcode",
field: "wlxxCode",
fieldType: "upper",
width: 140
},
{
title: "物料名称",
field: "wlmc",
field: "wlxxName",
width: 140
},
{
title: "物料规格",
field: "gg",
field: "wlxxGg",
width: 140
},
{
......
......@@ -54,8 +54,9 @@
list.forEach(item => {
// 转换并且push
item.wlid = item.id
item.wlmc = item.name
item.wlcode = item.code
item.wlxxName = item.name
item.wlxxCode = item.code
item.wlxxGg = item.gg
item.xqsl = 0
item.xqrq = new Date().getTime()
delete item.id
......@@ -161,20 +162,21 @@
},
{
title: "物料编号",
field: "code",
field: "wlxxCode",
width: 240,
type: 'AuxInput',
typeConfig: {
"code": "MATERIAL",
"label": "wlcode",
"label": "wlxxCode",
"transform": {
"value": "code",
"label": "code"
},
give(data) {
this.form.wlid = data.id
this.form.wlmc = data.name
this.form.wlcode = data.code
this.form.wlxxName = data.name
this.form.wlxxCode = data.code
this.form.wlxxGg = data.gg
}
......@@ -182,12 +184,12 @@
},
{
title: "物料名称",
field: "wlmc",
field: "wlxxName",
width: 160
},
{
title: "规格",
field: "gg",
field: "wlxxGg",
width: 140
},
{
......
......@@ -55,15 +55,20 @@
},
methods: {
mpSave(list) {
let length = this.formDetail.length
this.formDetail.splice(0, length)
list.forEach(item => {
item.lydjid = item.id
delete item.id
this.formDetail.push(_.cloneDeep(item))
/* 可持续添加*/
let iscf=false
let lydjidList=this.formDetail.map(item=>item.lydjid)
list.forEach(item=>{
if(lydjidList.includes(item.lydjid)){
iscf=true
}else{
this.formDetail.push(_.cloneDeep(item))
}
})
if(iscf){
this.$warning('存在重复数据,已自动过滤')
}
this.$forceUpdate()
},
mp() {
if (!this.form.lydjid) {
......@@ -76,45 +81,9 @@
},
/* 需要整体row时的回调 */
computedRow(row) {
// this.$refs.editTableForEdit.$forceUpdate()
},
/* 选择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() {
return {
......@@ -288,15 +257,15 @@
field: "packCode",
width: 240
},
{
title: "维护人",
field: "whr"
},
{
title: "维护时间",
field: "whsj",
fieldType: "ftDateTime"
},
// {
// title: "维护人",
// field: "whr"
// },
// {
// title: "维护时间",
// field: "whsj",
// fieldType: "ftDateTime"
// },
]
......
......@@ -4,7 +4,7 @@
<div class="full">
<div class="mpSearch" style="position: relative;">
<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">
......@@ -34,17 +34,19 @@
<!-- -->
</div>
<BasePage ref="basePage" :toolButton='false' :power='power' class="min_full" :config="config"
style="height:calc(100% - 45px) ;width: 100%;">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<!-- <el-button @click="demo(ctx.basePage)" size='mini' type="primary">示例按钮</el-button> -->
</template>
<EditTable staticHeader ref="editTable" :app='editTableConfig' >
<template slot="tabCustom">
<el-table-column label="操作" width="90" header-align="center" fixed="right" >
<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>
</el-table-column>
</template>
</BasePage>
</EditTable>
</div>
</div>
......@@ -57,6 +59,10 @@
</DefaultDialog>
</template>
<script>
/* 逻辑变更
容器+唯一码搜索并添加,清除容器+唯一码,可单条删除
可继续添加,可删除
*/
export default {
props: {
......@@ -74,101 +80,130 @@
},
data() {
return {
form: {
rqid: '',
rqCode: ''
},
power: {
add: false,
copy: false,
delButton: false,
editButton: false,
operateButtons: false,
workFlow: false,
/* 表格 */
showSelection: false,
saveSelected: false
},
config: {
/* 基本配置*/
url: 'wms/common/queryPackByCode',
queryUrl: "wms/common/queryPackmxByCode",
tableTitle: [{
title: "物料编码",
field: "wlxxCode",
width: 140
},
editTableConfig:{
editTableTitle:[
{
title: "物料名称",
field: "wlxxName",
width: 140
label: "容器",
prop: "rqCode",
width: 170
},
{
title: "物料规格",
field: "wlxxGg",
width: 140
label: "物料编码",
prop: "wlxxCode",
width: 170
},
{
title: "物料批号",
field: "wlph",
width: 140
label: "物料名称",
prop: "wlxxName",
width: 170
},
{
title: "物料数量",
field: "sl",
width: 140
label: "物料规格",
prop: "wlxxGg",
width: 170
},
{
title: "制令号",
field: "zlh",
width: 140
label: "物料批号",
prop: "wlph",
width: 170
},
{
title: "唯一码",
field: "packCode",
width: 240
label: "物料数量",
prop: "sl",
width: 140
},
{
title: "维护人",
field: "whr"
label: "制令号",
prop: "zlh",
width: 140
},
{
title: "维护时间",
field: "whsj",
fieldType: "ftDateTime"
},
],
queryParams: []
label: "唯一码",
prop: "packCode",
width: 240
}
],
editTableData:[]
},
form: {
rqid: '',
rqCode: '',
id:'',
code:''
}
}
},
methods: {
/* 重新渲染表格 */
del(index){
this.editTableConfig.editTableData.splice(index,1)
},
save() {
if(this.form.rqid){
let list =this.$refs.basePage.tabData||[]
list.forEach(item=>{
item.rqid=this.form.rqid
item.rqCode=this.form.rqCode
})
if(
this.editTableConfig.editTableData.length>0
){
let list =this.editTableConfig.editTableData||[]
this.$emit('save',list)
this.app.showDialog=false
/* 触发传递事件*/
}else{
this.$warning('请选择容器后保存')
this.$warning('请添加数据后保存')
}
},
search() {
/* 卡下数据*/
if (this.form.packid) {
this.$refs.basePage.queryParams.code = this.form.packcode
this.$refs.basePage.refresh()
if (this.form.packid&&this.form.rqid) {
// this.$refs.basePage.queryParams.code = this.form.packcode
// 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 {
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