Commit 8311e188 authored by 李苏's avatar 李苏 💬

字段

parent db660f63
<template> <template>
<RelDialog bigTitle detailTable='LLCKMX' @getFormDetail='getFormDetail' width="70%" :type='type' :editApp='editApp' <RelDialog bigTitle detailTable='LLCKMX' @getFormDetail='getFormDetail' width="70%" :type='type' :editApp='editApp'
:app='app' :buttonApp='buttonApp'> :app='app' :buttonApp='buttonApp'>
<el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules"> <el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<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>
<div class="editTab"> <div class="editTab">
<editTableForEdit :indexApp='app' :type='type' @save='save' ref="editTableForEdit" <editTableForEdit :indexApp='app' :type='type' @save='save' ref="editTableForEdit"
:editTableTitle='editTableTitle' v-if="editTableForEdit" :computedRow='computedRow' :editTableTitle='editTableTitle' v-if="editTableForEdit" :computedRow='computedRow'
:editTableData="formDetail" > :editTableData="formDetail">
<!-- <template v-if="type!='view'" #toolbar="ctx"> <!-- <template v-if="type!='view'" #toolbar="ctx">
<AuxButton :queryParams="{ <AuxButton :queryParams="{
ckid:form.ckid ckid:form.ckid
}" rename='选择库存' code='WLKC' @save="savekc" /> }" rename='选择库存' code='WLKC' @save="savekc" />
</template> --> </template> -->
</editTableForEdit> </editTableForEdit>
</div> </div>
<el-row class="bottomInfo" :gutter="20"> <el-row class="bottomInfo" :gutter="20">
<el-col class="center" :span="12"> <el-col class="center" :span="12">
创建人:{{ 创建人:{{
form.cjr||localUser form.cjr||localUser
}} }}
</el-col> </el-col>
<el-col class="center" :span="12"> <el-col class="center" :span="12">
创建时间:{{ 创建时间:{{
$moment(form.cjsj).format('YYYY-MM-DD HH:mm:ss')||$moment().format('YYYY-MM-DD HH:mm:ss') $moment(form.cjsj).format('YYYY-MM-DD HH:mm:ss')||$moment().format('YYYY-MM-DD HH:mm:ss')
}} }}
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<!-- editTab数据 --> <!-- editTab数据 -->
</RelDialog> </RelDialog>
</template> </template>
<script> <script>
import { import {
toFixed, toFixed,
digit, digit,
doRkdChange doRkdChange
} from 'common/src/utils/blur.js' } from 'common/src/utils/blur.js'
import { import {
editMixin, editMixin,
editMixin_expand editMixin_expand
} from 'common' } from 'common'
export default { export default {
mixins: [editMixin, editMixin_expand], mixins: [editMixin, editMixin_expand],
methods: { methods: {
/* 需要整体row时的回调 */ /* 需要整体row时的回调 */
computedRow(row) { computedRow(row) {
// this.$refs.editTableForEdit.$forceUpdate() // this.$refs.editTableForEdit.$forceUpdate()
}, },
/* 选择list时的回调 */ /* 选择list时的回调 */
save(list) { save(list) {
list.forEach(async item => { list.forEach(async item => {
let res = await this.$post('kc/common/query/kcsl', { let res = await this.$post('kc/common/query/kcsl', {
ckid: this.form.ckid, ckid: this.form.ckid,
wlid: item.id wlid: item.id
}) })
item.kcsl = res.data.records.kcsl || 0 item.kcsl = res.data.records.kcsl || 0
// 转换并且push // 转换并且push
item.wlid = item.id item.wlid = item.id
item.wlxxName = item.name item.wlxxName = item.name
item.wlxxCode = item.code item.wlxxCode = item.code
item.wlxxGg = item.gg item.wlxxGg = item.gg
delete item.id delete item.id
this.formDetail.push(_.cloneDeep(item)) this.formDetail.push(_.cloneDeep(item))
}) })
}, },
/* 选择库存回调 */ /* 选择库存回调 */
savekc(list){ savekc(list) {
list.forEach( item => { list.forEach(item => {
// 转换并且push // 转换并且push
delete item.id delete item.id
this.formDetail.push(_.cloneDeep(item)) this.formDetail.push(_.cloneDeep(item))
}) })
} }
}, },
mounted() { mounted() {
this.form.llrName=this.username this.form.llrName = this.username
this.form.llrid=this.userid this.form.llrid = this.userid
}, },
data() { data() {
return { return {
/* 常规edit数据 */ /* 常规edit数据 */
editColItemList: [{ editColItemList: [{
label: '出库单号', label: '出库单号',
prop: 'djid', prop: 'djid',
span: 8, span: 8,
type: 'input', type: 'input',
// "required": true, // "required": true,
}, },
{ {
label: '出库日期', label: '出库日期',
prop: 'llrq', prop: 'llrq',
span: 8, span: 8,
type: 'date', type: 'date',
value: new Date().getTime(), value: new Date().getTime(),
"required": true, "required": true,
}, },
{ {
"label": "仓库", "label": "仓库",
"prop": "ckid", "prop": "ckid",
"span": 8, "span": 8,
"type": "RelSelect", "type": "RelSelect",
"value": "", "value": "",
"required": true, "required": true,
"typeConfig": { "typeConfig": {
"src": "jcsj/common/ck/queryCkid", "src": "jcsj/common/ck/queryCkid",
"match": { "match": {
"value": "id", "value": "id",
"label": "name" "label": "name"
}, },
change: (row) => { change: (row) => {
this.form.bgy = row.bgy this.form.bgy = row.bgy
} }
} }
}, },
{ {
label: '需求日期', label: '需求日期',
prop: 'xqrq', prop: 'xqrq',
span: 8, span: 8,
type: 'date', type: 'date',
value: new Date().getTime(), value: new Date().getTime(),
"required": true, "required": true,
}, },
{ {
"label": "事务类型", "label": "事务类型",
"prop": "swlxid", "prop": "swlxid",
"span": 8, "span": 8,
"type": "RelSelect", "type": "RelSelect",
"value": "", "value": "",
"required": true, "required": true,
"typeConfig": { "typeConfig": {
"src": "wms/ckgl/llck/init/swlx", "src": "wms/ckgl/llck/init/swlx",
"match": { "match": {
"value": "id", "value": "id",
"label": "name" "label": "name"
} }
} }
}, },
{ {
"label": "领料部门", "label": "领料部门",
"prop": "bmid", "prop": "bmid",
"span": 8, "span": 8,
"type": "RelSelect", "type": "RelSelect",
"value": "", "value": "",
"required": true, "required": true,
"typeConfig": { "typeConfig": {
"src": "jcsj/common/bm/query", "src": "jcsj/common/bm/query",
"match": { "match": {
"value": "id", "value": "id",
"label": "bmmc" "label": "bmmc"
} }
} }
}, },
{ {
label: '货主', label: '货主',
prop: 'hzid', prop: 'hzid',
span: 8, span: 8,
type: 'RelSelect', required: true,
"typeConfig": { type: 'AuxInput',
"src": "jcsj/common/hz/query", typeConfig: {
"match": { isRequest: true,
"value": "id", code: 'HZID',
"label": "name" label: 'hzName',
} transform: {
value: 'id',
label: 'name'
}
} }
}, },
{
label: '备注',
prop: 'bz',
span: 16,
type: 'input',
},
],
/* 从表编辑数据 */
editTableTitle: [{
title: "序号",
field: "xh",
width: 50,
align: "center"
},
{
title: "物料编号",
field: "wlxxCode",
width: 240,
},
{
title: "物料名称",
field: "wlxxName",
width: 160
},
{
title: "规格",
field: "wlxxGg",
width: 140
},
{
title: "应出数量",
field: "yfsl",
allowEdit: true,
type: 'inputNumber',
width: 200,
blur: toFixed(null),
},
{
title: "库存数量",
field: "kcsl",
width: 200,
blur: toFixed(null),
},
{
title: "计量单位",
field: "jldwname",
width: 100,
allowEdit: false
},
{
title: "物料批号",
field: "wlph",
type: 'inputText',
width: 200,
// show: JSON.parse(localStorage.getItem('isPhgl'))
},
{ {
title: "制令号", label: '备注',
field: "zlh", prop: 'bz',
type: 'inputText', span: 16,
width: 200, type: 'input',
// show: JSON.parse(localStorage.getItem('isPhgl'))
}, },
{ ],
show: JSON.parse(localStorage.getItem('isKwgl')), /* 从表编辑数据 */
title: "库位", editTableTitle: [{
field: "kwid", title: "序号",
width: 240, field: "xh",
type: 'AuxInput', width: 50,
typeConfig: { align: "center"
isRequest: false, },
"code": "KWWH", {
"label": "kwName", title: "物料编号",
queryParams: (row) => { field: "wlxxCode",
return { width: 240,
ckid: this.form.ckid },
} {
}, title: "物料名称",
"transform": { field: "wlxxName",
"value": "id", width: 160
"label": "name" },
} {
title: "规格",
field: "wlxxGg",
width: 140
},
{
title: "应出数量",
field: "yfsl",
allowEdit: true,
type: 'inputNumber',
width: 200,
blur: toFixed(null),
},
{
title: "库存数量",
field: "kcsl",
width: 200,
blur: toFixed(null),
},
{
title: "计量单位",
field: "jldwname",
width: 100,
allowEdit: false
},
{
title: "物料批号",
field: "wlph",
type: 'inputText',
width: 200,
// show: JSON.parse(localStorage.getItem('isPhgl'))
},
{
title: "制令号",
field: "zlh",
type: 'inputText',
width: 200,
// show: JSON.parse(localStorage.getItem('isPhgl'))
},
{
show: JSON.parse(localStorage.getItem('isKwgl')),
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: "备注", title: "备注",
field: "bz", field: "bz",
width: 200, width: 200,
type: 'inputText', type: 'inputText',
allowEdit: true, allowEdit: true,
} }
] ]
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import url("~common/src/assets/styles/editDetail.scss"); @import url("~common/src/assets/styles/editDetail.scss");
</style> </style>
\ No newline at end of file
...@@ -142,19 +142,21 @@ ...@@ -142,19 +142,21 @@
} }
}, },
{ {
label: '货主', label: '货主',
prop: 'hzid', prop: 'hzid',
span: 8, span: 8,
type: 'RelSelect', required: true,
"typeConfig": { type: 'AuxInput',
"src": "jcsj/common/hz/query", typeConfig: {
"match": { isRequest: true,
"value": "id", code: 'HZID',
"label": "name" label: 'hzName',
} transform: {
} value: 'id',
label: 'name'
}, }
}
},
{ {
label: '备注', label: '备注',
prop: 'bz', prop: 'bz',
......
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