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

add function for bzzy

parent 70981a95
<template> <template>
<RelDialog width="50%" :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'> <RelDialog @getForm='getForm' bigTitle detailTable='BZZYMX' @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-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" /> <Mp @save='mpSave' :app='this' v-if="showDialog" />
<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> </el-row>
<div class="editTab">
<editTableForEdit :indexApp='app' :AuxButton='false' rename="按入库单开" code='WMSRKD' :type='type'
ref="editTableForEdit" :editTableTitle='editTableTitle' v-if="editTableForEdit" :computedRow='computedRow'
:editTableData="formDetail">
<template v-if="type!='view'" #toolbar="ctx">
<el-button @click="mp" size="mini" style="display: inline-block;margin-right: 10px;"
type="primary">选择物料</el-button>
</template>
</editTableForEdit>
</div>
<el-row :gutter="20" :app="this" class="editRow bottomInfo">
<!-- 判定readonlu是否是函数-->
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
v-for="(item,index) in editColItemList2 " :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> </el-form>
<!-- editTab数据 -->
</RelDialog> </RelDialog>
</template> </template>
<script> <script>
import { import {
editMixin toFixed,
doRkdChange
} from 'common/src/utils/blur.js'
import {
editMixin,
editMixin_expand
} from 'common' } from 'common'
import Mp from './mp.vue'
export default { export default {
mixins: [editMixin], mixins: [editMixin, editMixin_expand],
components: {
Mp
},
methods: {
formatMilliseconds(milliseconds) {
// 将毫秒转换为秒
var seconds = Math.floor(milliseconds / 1000);
// 计算小时数
var hours = Math.floor(seconds / 3600);
// 计算分钟数
var minutes = Math.floor((seconds % 3600) / 60);
// 计算剩余的秒数
var remainingSeconds = seconds % 60;
// 构建时间字符串
var timeString = '';
if (hours > 0) {
timeString += hours + '小时 ';
}
if (minutes > 0) {
timeString += minutes + '分钟 ';
}
timeString += remainingSeconds + '秒';
return timeString;
},
getForm(form){
if(form.timespan){
form.transtimespan=this.formatMilliseconds(form.timespan)
}
},
mpSave(list) {
this.formDetail.splice(0, this.formDetail.length);
/* 添加熬子表*/
list.forEach(item=>{
item.lydjid=item.id
delete item.id
item.zbsl=0
this.formDetail.push(_.cloneDeep(item))
})
},
mp() {
if (!this.form.lydjid) {
this.$warning('请选择一条入库单')
} else {
this.showDialog = true
/* 开启弹框*/
}
},
/* 需要整体row时的回调 */
computedRow(row) {
},
/* 选择list时的回调 */
},
mounted() {
this.form.zyrName=this.username
this.form.zyrid=this.userid
},
watch:{
formDetail(val){
console.log(val)
if(val&&val.length==0){
this.editColItemList[0].readonly=false
}else{
this.editColItemList[0].readonly=true
}
}
},
data() { data() {
return { return {
form:{
djly: 'M'
},
/* dialog*/
showDialog: false,
DialogTitle: '选择物料',
DialogWidth: '80vw',
/* 常规edit数据 */
editColItemList: [ editColItemList: [
/* 入库单 辅助输入 关联入库单*/
{ {
label: '编码', label: '入库单',
prop: 'code', "required": true,
span: 12, prop: 'lydjid',
type: 'input', span: 8,
required:true, type: 'AuxInput',
typeConfig: {
isRequest: false,
code: 'WMSRKD',
label: 'rktzDjid',
transform: {
value: 'id',
label: 'djid'
},
give(row){
for (var key in this.form) {
key != 'ywrq'&&key != 'zt'&&key != 'id'&& key != 'djid' && key != 'djly' && (() => {
row[key] && (this.form[key] = row[key])
})()
}
}
},
}, },
{ {
label: '名称', label: '单号',
prop: 'name', prop: 'djid',
span: 12, span: 8,
type: 'input', type: 'input',
required:true, },
{
label: '业务日期',
prop: 'ywrq',
span: 8,
type: 'date',
value: new Date().getTime(),
"required": true,
},
{
"label": "仓库",
"prop": "ckid",
"span": 8,
"type": "RelSelect",
"value": "",
readonly:true,
"required": true,
"typeConfig": {
"src": "jcsj/common/ck/queryCkid",
"match": {
"value": "id",
"label": "name"
}
}
},
{
readonly:true,
"label": "事务类型",
"prop": "swlxid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "wms/rkgl/rktz/init/swlx",
"match": {
"value": "id",
"label": "name"
}
}
},
{
readonly:true,
"label": "部门",
"prop": "bmid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "jcsj/common/bm/query",
"match": {
"value": "id",
"label": "bmmc"
}
}
},
{
label: '作业人',
prop: 'zyrid',
span: 8,
type: 'AuxInput',
typeConfig: {
code: 'USER',
label: 'zyrName',
transform: {
value: 'id',
label: 'username'
}
},
"required": true,
}, },
{ {
label: '备注', label: '备注',
prop: 'bz', prop: 'bz',
span: 24, span: 16,
type: 'input' type: 'input',
}, },
],
editColItemList2:[
{
"label": "状态",
"prop": "zt",
"span": 8,
"type": "RelSelect",
"value": "",
readonly:true,
"typeConfig": {
"src": "wms/kcgl/bzdj/init/zt",
"match": {
"value": "id",
"label": "name"
}
}
},
{
label: '维护人',
prop: 'whr',
type: 'input',
span: 8,
readonly:true,
},
{
label: '维护时间',
prop: 'whsj',
span: 8,
type: 'datetime',
readonly:true,
value:new Date().getTime()
}
],
/* 从表编辑数据 */
editTableTitle: [{
title: "容器",
field: "rqCode",
width: 140
},
{
title: "物料编码",
field: "wlxxCode",
width: 140
},
{
title: "物料名称",
field: "wlxxName",
width: 140
},
{
title: "物料规格",
field: "wlxxGg",
width: 140
},
{
title: "物料批号",
field: "wlph",
width: 180,
allowEdit: true,
type: 'inputText',
},
{
title: "装包数量",
field: "zbsl",
width: 140,
allowEdit: true,
type: 'inputNumber',
},
{
title: "制令号",
field: "zlh",
width: 180,
allowEdit: true,
type: 'inputText',
},
// {
// title: "货主",
// field: "hzid",
// width: 240
// },
{
title: "货主",
field: "hzid",
width: 240,
type: 'AuxInput',
typeConfig: {
isRequest: true,
"code": "HZID",
"label": "hzName",
"transform": {
"value": "id",
"label": "name"
}
}
}
] ]
} }
} }
} }
</script> </script>
<style lang="scss" scoped>
@import url("~common/src/assets/styles/editDetail.scss");
</style>
<template> <template>
<BasePage :power='power' @getRow='getRow' class="min_full" style="height: 100%;" :config="config"> <BasePage addRename='装包' :power='power' @getRow='getRow' class="min_full" style="height: 100%;" :config="config">
<template #dialog="ctx"> <template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 --> <!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
<zb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='装包'" /> <!-- <zb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='装包'" /> -->
<cb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='调整'" /> <cb :app='ctx.basePage' v-if="ctx.basePage.showDialog&&ctx.basePage.DialogTitle=='调整'" />
</template> </template>
<template #toolbar="ctx"> <template #toolbar="ctx">
<el-button @click="zb(ctx.basePage)" size='mini' type="primary">装包</el-button> <!-- <el-button @click="zb(ctx.basePage)" size='mini' type="primary">装包</el-button> -->
<el-button @click="cb(ctx.basePage)" size='mini' type="primary">调整</el-button> <!-- <el-button @click="cb(ctx.basePage)" size='mini' type="primary">调整</el-button> -->
</template> </template>
</BasePage> </BasePage>
</template> </template>
<script> <script>
import zb from './zb.vue'; // import zb from './zb.vue';
import cb from './cb.vue' import cb from './cb.vue'
import Edit from './edit.vue'
export default { export default {
data() { data() {
return { return {
power: { power: {
add: false, add: true,
copy: false, copy: false,
/* 手动控制删除 */ /* 手动控制删除 */
delButton: false, delButton: false,
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
queryDetail: true, queryDetail: true,
/* 基本配置*/ /* 基本配置*/
url: 'wms/kcgl/bzdj', url: 'wms/kcgl/bzdj',
// addUrl:'wms/kcgl/bzdj/install',
tableTitle: [{ tableTitle: [{
title: "类型", title: "类型",
field: "djlx", field: "djlx",
...@@ -66,6 +68,21 @@ ...@@ -66,6 +68,21 @@
fieldType: "ftString", fieldType: "ftString",
width: 260 width: 260
}, },
{
title: "仓库",
field: "ckName",
width: 140
},
{
title: "部门",
field: "bmName",
width: 140
},
{
title: "事务类型",
field: "swlxName",
width: 140
},
{ {
title: "单据来源", title: "单据来源",
field: "djly", field: "djly",
...@@ -146,11 +163,11 @@ ...@@ -146,11 +163,11 @@
getRow(val) { getRow(val) {
this.$emit('getRow', val) this.$emit('getRow', val)
}, },
zb(ctx){ // zb(ctx){
ctx.DialogWidth='50vw' // ctx.DialogWidth='50vw'
ctx.DialogTitle='装包' // ctx.DialogTitle='装包'
ctx.showDialog=true // ctx.showDialog=true
}, // },
cb(ctx){ cb(ctx){
if(ctx.singleItem&&ctx.singleItem.id){ if(ctx.singleItem&&ctx.singleItem.id){
ctx.DialogWidth='50vw' ctx.DialogWidth='50vw'
...@@ -163,7 +180,9 @@ ...@@ -163,7 +180,9 @@
}, },
}, },
components: { components: {
zb,cb // zb,
Edit,
cb
} }
} }
......
<template>
<DefaultDialog :app='app'>
<div slot="form" style="display: flex;height: 70vh;">
<BasePage @getRow='getRow' ref="basePage" :power='power' :toolButton='false' class="min_full" style="height: 100%;" :autoQuery='false'
:config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
</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>
export default {
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
mounted() {
this.$nextTick(()=>{
this.$refs.basePage.queryParams.mid=this.app.form.lydjid
this.$refs.basePage.refresh()
})
},
data() {
return {
power: {
add: false,
copy: false,
/* 手动控制删除 */
delButton: false,
/* 手动控制编辑按钮权限 */
editButton: false,
/* 是否渲染右侧操作按钮 */
operateButtons: false,
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: true,
saveSelected: true
},
config: {
/* 基本配置*/
url: 'lxyl/rkgl/rktz/query/detail',
queryUrl: 'lxyl/rkgl/rktz/query/detail',
tableTitle: [{
title: "物料编码",
field: "wlxxCode",
fieldType: "upper",
width: 140
},
{
title: "物料名称",
field: "wlxxName",
width: 140
},
{
title: "物料规格",
field: "wlxxGg",
width: 140
},
{
title: "物料批号",
field: "wlph",
width: 140
},
{
title: "计量单位",
field: "jldwName",
width: 100,
},
{
title: "应收数量",
field: "yssl",
width: 100,
},
{
title: "码盘数量",
field: "ztsl",
width: 120,
},
{
title: "包装数量",
field: "bzsl",
width: 120,
},
{
title: "入库数量",
field: "rksl",
width: 100,
},
{
title: "过账数量",
field: "gzsl",
width: 120,
},
{
title: "制令号",
field: "zlh",
width: 180,
},
{
title: "状态",
field: "zt",
width: 120,
"transform": {
"url": "lxyl/rkgl/rktz/init/zt",
"label": "name",
"value": "id"
}
},
{
title: "来源单号",
field: "lydjid",
width: 120,
},
{
title: "关闭人",
field: "gbr",
width: 120,
},
{
title: "关闭原因",
field: "gbyy",
width: 200,
},
{
title: "关闭时间",
field: "gbsj",
fieldType: 'ftDateTime'
},
{
title: "备注",
field: "bz",
width: 200
}
],
queryParams: [
],
}
}
},
methods: {
save() {
let list=this.$refs.basePage.$refs.TablePager.selectedList||[]
if(list.length==0){
this.$warning('请至少勾选一条数据')
}else{
this.$emit('save',list)
this.app.showDialog=false
}
// if()
},
getRow(val){
this.$emit('getRow',val)
},
demo(ctx){
if(ctx.singleItem&&ctx.singleItem.id){
}else{
this.$warning('请选中一条数据')
}
}
},
components: {
}
}
</script>
<style>
</style>
<template>
<DefaultDialog :app='app'>
<div slot="form" style="display: flex;">
<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>
<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 {
mixins: [editMixin],
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
async mounted() {
},
data() {
return {
source:{},
readonly:false,
editColItemList: [
{
label: '物料',
prop: 'wlid',
span: 12,
required: true,
type: 'AuxInput',
typeConfig: {
isRequest: false,
code: 'WMSWLXX',
label: 'wlxxName',
transform: {
value: 'id',
label: 'name'
},
give:(row)=>{
this.form.wlxxCode=row.code
this.form.wlxxGg=row.gg
}
}
},
{
label: '物料编码',
prop: 'wlxxCode',
span: 12,
type: 'input',
},
{
label: '物料规格',
prop: 'wlxxGg',
span: 12,
type: 'input',
},
{
label: '制令号',
prop: 'zlh',
span: 12,
type: 'input',
required: true,
},
{
label: '批号',
prop: 'wlph',
span: 12,
type: 'input',
// required: true,
},
{
label: '装包数量',
prop: 'zbsl',
span: 12,
type: 'inputNumber',
required: true,
},
{
label: '货主',
prop: 'hzid',
span: 12,
required: true,
type: 'AuxInput',
typeConfig: {
isRequest: true,
code: 'HZID',
label: 'hzName',
transform: {
value: 'id',
label: 'name'
}
}
}
]
}
},
methods: {
save(){
this.$refs['form'].validate((valid) => {
if (valid) {
let params={
"djly":"M",
"datas":[this.form]
}
this.$post('wms/kcgl/bzdj/install', params).then(res => {
if (res.success) {
this.$success('操作成功')
this.app.showDialog = false
this.app.refresh()
}
})
}
})
}
}
}
</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