Commit 65eaae12 authored by 李苏's avatar 李苏 💬

修改为定制物料,入库相关接口

parent d165533c
......@@ -374,6 +374,22 @@ export const powerRoutes = [
name: 'sjzy',
path: "sjzy",
},
{
erpComponent: false,
component: 'ccgl/rkgl/rkdj/index',
hidden: false,
meta: {
"title": "入库登记",
"icon": "",
"noCache": false,
"link": null,
"mkid": 920030500,
},
name: 'rkdj',
path: "rkdj",
},
/* 入库登记*/
{
component: 'ccgl/rkgl/mpzy/index',
hidden: false,
......
......@@ -10,7 +10,7 @@
</el-row>
<div class="editTab">
<editTableForEdit :indexApp='app' :type='type' @save='save' ref="editTableForEdit"
<editTableForEdit code='WMSWLXX' :indexApp='app' :type='type' @save='save' ref="editTableForEdit"
:editTableTitle='editTableTitle' v-if="editTableForEdit" :computedRow='computedRow'
:editTableData="formDetail">
<!-- <template v-if="type!='view'" #toolbar="ctx">
......
......@@ -10,7 +10,7 @@
</el-row>
<div class="editTab">
<editTableForEdit :indexApp='app' :type='type' @save='save' ref="editTableForEdit"
<editTableForEdit code='WMSWLXX' :indexApp='app' :type='type' @save='save' ref="editTableForEdit"
:editTableTitle='editTableTitle' v-if="editTableForEdit" :computedRow='computedRow'
:editTableData="formDetail" />
</div>
......
......@@ -11,7 +11,7 @@
</el-row>
<div class="editTab">
<editTableForEdit :indexApp='app' :type='type' @save='save' ref="editTableForEdit"
<editTableForEdit :indexApp='app' code='WMSWLXX' :type='type' @save='save' ref="editTableForEdit"
:editTableTitle='editTableTitle' v-if="editTableForEdit" :computedRow='computedRow'
:editTableData="formDetail">
<template v-if="type!='view'" #toolbar="ctx">
......
<template>
<DefaultDialog :app='app'>
<div slot="form" style="display: flex;height: 70vh;">
DialogTitle:'新增',
showDialog:false,
</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 {}
}
}
},
async mounted() {
},
data() {
return {
}
},
methods: {
}
}
</script>
<style scoped>
</style>
<template>
<RelDialog bigTitle detailTable='KCSW' @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 code='WMSRKD' rename='选择入库单' :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">
创建时间:{{
$moment(form.cjsj).format('YYYY-MM-DD HH:mm:ss')||$moment().format('YYYY-MM-DD HH:mm:ss')
}}
</el-col>
</el-row>
</el-form>
<!-- editTab数据 -->
</RelDialog>
</template>
<script>
import {
toFixed,
digit,
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[0]['lydjid'] = list[0]['djid']
delete list[0]['djid']
/* 判定长度 */
if (list.length > 1) {
this.$warning('只能选择一条数据')
return
} 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('kc/rktzdj/query/rktzmx', {
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 {
/* 常规edit数据 */
editColItemList: [{
label: '入库单号',
prop: 'lydjid',
span: 8,
type: 'input',
"required": true,
},
{
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": "bmid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "jcsj/common/bm/query",
"match": {
"value": "id",
"label": "bmmc"
}
}
},
{
"label": "事务类型",
"prop": "swlxid",
"span": 8,
"type": "RelSelect",
"value": "",
"required": true,
"typeConfig": {
"src": "kc/rktz/init/swlx",
"match": {
"value": "id",
"label": "name"
}
}
},
{
label: '保管员',
prop: 'rkr',
span: 8,
type: 'input',
},
{
label: '备注',
prop: 'bz',
span: 16,
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
}
}
},
{
title: "物料名称",
field: "wlmc",
width: 160
},
{
title: "规格",
field: "gg",
width: 140
},
{
title: "应入库数量",
field: "yssl",
width: 100,
allowEdit: false,
show: this.type != 'view'
},
{
title: "已入库数量",
field: "yrksl",
width: 100,
allowEdit: false,
show: this.type != 'view'
},
{
title: "入库数量",
field: "rksl",
allowEdit: true,
type: 'inputNumber',
width: 200,
blur: toFixed(null),
change: row => doRkdChange(row, 'rksl')
},
{
title: "计量单位",
field: "jldwname",
width: 100,
allowEdit: false
},
{
title: "含税价格",
field: "hsjg",
fieldType: 'price',
type: "inputNumber",
blur: toFixed(null),
change: row => doRkdChange(row, 'hsjg')
},
{
title: "含税金额",
field: "hsje",
fieldType: 'money',
type: "inputNumber",
blur: toFixed(null),
change: row => doRkdChange(row, 'hsje')
},
{
title: "增值税率%",
field: "zzsl",
fieldType: 'zzsl',
type: "inputNumber",
blur: toFixed(null),
change: row => doRkdChange(row, 'zzsl')
},
{
title: "入库价格",
field: "wsjg",
fieldType: "price",
type: "inputNumber",
blur: toFixed(null),
change: row => doRkdChange(row, 'wsjg'),
show: this.type != 'view'
},
{
title: "入库金额",
field: "wsje",
fieldType: "money",
type: "inputNumber",
blur: toFixed(null),
change: row => doRkdChange(row, 'wsje'),
show: this.type != 'view'
},
{
title: "入库价格",
field: "jyjg",
type: "inputNumber",
show: this.type == 'view',
},
{
title: "入库金额",
field: "rkje",
type: "inputNumber",
show: this.type == 'view'
},
{
title: "物料批号",
field: "wlph",
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: "备注",
field: "bz",
width: 200,
type: 'inputText',
allowEdit: true,
}
]
}
}
}
</script>
<style lang="scss" scoped>
@import url("~common/src/assets/styles/editDetail.scss");
</style>
<template>
<BasePage addRename='选择入库单入库' class="min_full" :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
</template>
</BasePage>
</template>
<script>
import Edit from './edit.vue'
export default {
data() {
return {
config: {
queryDetail: true,
/* 基本配置*/
url: 'wms/rkgl/rkdj',
tableTitle: [
{title: "库存单号", field: "djid", width: 140},
{title: "入库日期", field: "ywrq", fieldType: 'ftDate'},
{title: "仓库", field: "ckmc", width: 140},
{title: "事务类型", field: "swlxmc", width: 100},
{title: "入库部门", field: "bmName", width: 130},
{title: "入库人", field: "rkr", width: 120},
{title: "保管员", field: "bgy", width: 120},
{title: "入库单号", field: "lydjid", width: 140},
{title: "备注", field: "bz", width: 220},
{title: "维护人", field: "whr"},
{title: "维护时间", field: "whsj", fieldType: 'ftDateTime'}
],
queryParams: [
[{
label: '入库日期',
startProp: "ywrqb",
endProp: "ywrqe",
span: 12,
type: 'RelDaterangeV2',
startValue: new Date().getTime()-1000*60*60*24*30,
endValue:new Date().getTime(),
},
{
"label": "仓库",
"prop": "ckid",
"span": 6,
"type": "RelSelect",
"value": "",
"typeConfig": {
"src": "jcsj/common/ck/queryCkid",
"match": {
"value": "id",
"label": "name"
}
}
},
{
label: '入库单号',
prop: 'djid',
span: 6,
type: 'input',
value: ''
},
]
],
/* 默认启停用 */
}
}
},
methods: {
/* 示例*/
// demo(basePage){
// }
},
components: {
Edit
}
}
</script>
<style>
</style>
......@@ -7,7 +7,7 @@
</div>
<div class="bottom flex">
<div class="full" >
<el-tabs class="full" v-model="activeName" >
<el-tabs @tab-click="handleClick" class="full" v-model="activeName" >
<el-tab-pane class="full" label="上架单明细" name="first">
<Mx ref="mx" class="full" />
</el-tab-pane>
......@@ -44,6 +44,18 @@
}
},
methods: {
handleClick(tab, event) {
if(tab.index==0){
this.$refs.mx.$refs.basePage.$refs['TablePager'].pageQuery({
setFirstCurrent: true
})
}else if(tab.index==1){
this.$refs.sjhz.$refs.basePage.$refs['TablePager'].pageQuery()
}else{
this.$refs.sjjg.$refs.basePage.$refs['TablePager'].pageQuery()
}
},
sxmx(){
this.$refs.mx.$refs.basePage.refresh()
},
......@@ -56,6 +68,7 @@
this.$refs.mx.$refs.basePage.$refs['TablePager'].pageQuery({
setFirstCurrent: true
})
this.$refs.sjhz.$refs.basePage.$row=row
this.$refs.sjhz.$refs.basePage.queryParams.mid = mid
this.$refs.sjhz.$refs.basePage.$refs['TablePager'].pageQuery()
this.$refs.sjjg.$refs.basePage.queryParams.mid = mid
......
<template>
<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">
<mxDialog :app='ctx.basePage' v-if="ctx.basePage.showDialog" />
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template slot="tabCustom2">
<el-table-column label="操作" width="100" header-align="center" fixed="right">
<template slot-scope="scope">
<div style="cursor: pointer;color: cornflowerblue;text-align: center;width: 80px;" @click.prevent.self="sj(scope.$index,scope,scope.row)" ><i class="el-icon-edit"></i>上架</div>
</template>
</el-table-column>
</template>
......@@ -19,7 +12,7 @@
<script>
// import wlphsx from 'common/src/mixin/wlphsx.js'
import mxDialog from './mxDialog.vue'
export default {
// mixins:[wlphsx],
data() {
......@@ -121,11 +114,7 @@
},
methods: {
sj(){
this.$refs.basePage.DialogTitle='上架'
this.$refs.basePage.DialogWidth='50vw'
this.$refs.basePage.showDialog=true
},
getRow(val) {
this.$emit('getRow', val)
},
......@@ -139,7 +128,7 @@
},
components: {
mxDialog
}
}
......
......@@ -20,9 +20,12 @@
</template>
<script>
import {
editMixin,
editMixin_expand
} from 'common'
export default {
mixins: [editMixin, editMixin_expand],
props: {
app: {
type: Object,
......@@ -37,6 +40,7 @@
},
data() {
return {
readonly:false,
form: {
},
......@@ -45,7 +49,7 @@
{
label: '库位',
prop: 'kwid',
span: 12,
span: 24,
"required": true,
type: 'AuxInput',
typeConfig: {
......@@ -69,6 +73,24 @@
}
,
methods: {
save(){
this.$refs['form'].validate((valid) => {
if(valid){
/* 构建参数*/
let params={
kwid:this.form.kwid,
id:this.app.singleItem.id
}
this.$post('wms/rkgl/sjtzzy/sj',params).then(res=>{
if(res.success){
this.$success('操作成功')
this.app.showDialog=false
this.app.refresh()
}
})
}
})
}
}
}
......
......@@ -2,17 +2,33 @@
<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">
<mxDialog :app='ctx.basePage' v-if="ctx.basePage.showDialog" />
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<template slot="tabCustom2">
<el-table-column label="操作" width="150" header-align="center">
<template slot-scope="scope">
<div style="width: 130px;display: flex;text-align: center">
<div style="width: 50%;" >
<span @click.prevent.self="sj(scope.$index,scope,scope.row)" style="cursor: pointer;color: rgb(24, 144, 255);" >上架</span>
</div>
<div style="width: 50%;" >
<span @click.prevent.self="xj(scope.$index,scope,scope.row)" style="cursor: pointer;color: red;" >取消上架</span>
</div>
</div>
<!-- <div style="cursor: pointer;color: cornflowerblue;text-align: center;width: 80px;" ><i class="el-icon-edit"></i>上架</div> -->
</template>
</el-table-column>
</template>
</BasePage>
</template>
<script>
import mxDialog from './mxDialog.vue'
export default {
mounted() {
......@@ -67,6 +83,27 @@
},
methods: {
xj(a,b,c){
this.$confirm('是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res=>{
this.$post('wms/rkgl/sjtzzy/qxsj',{
id:c.id
}).then(res=>{
if(res.success){
this.$success('操作成功')
this.$refs.basePage.refresh()
}
})
})
},
sj(){
this.$refs.basePage.DialogTitle='上架'
this.$refs.basePage.DialogWidth='50vw'
this.$refs.basePage.showDialog=true
},
getRow(val) {
this.$emit('getRow', val)
},
......@@ -80,7 +117,7 @@
},
components: {
mxDialog
}
}
......
......@@ -64,7 +64,7 @@
this.form.lydjid=row.id
this.form.ckid=row.ckid
this.form.bmid=row.bmid
this.form.ywrq=row.ywrq
// this.form.ywrq=row.ywrq
let length = this.formDetail.length
this.formDetail.splice(0, length)
list.forEach(item => {
......
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