Commit 6775184b authored by 李苏's avatar 李苏 💬

5,9提交

parent ff83b7fb
......@@ -2,9 +2,12 @@
<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来操作默认页面 -->
<el-button @click="gb(ctx.basePage)" size='mini' type="primary">关闭</el-button>
<el-button @click="qxgb(ctx.basePage)" size='mini' type="primary">取消关闭</el-button>
</template>
......@@ -138,6 +141,58 @@
},
methods: {
gb(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
this.$prompt('请输入原因', '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({
value
}) => {
if (value) {
this.$post('lxyl/ckgl/cktz/close/cktzmx', {
id: ctx.singleItem.id,
gbyy:value
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
} else {
this.$warning('请输入关闭原因')
}
})
} else {
this.$warning('请选中一条数据')
}
},
qxgb(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('lxyl/ckgl/ckdgb/batchUnClose/cktzmx', {
datas:[
{
id: ctx.singleItem.id
}
]
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
getRow(val){
this.$emit('getRow',val)
},
......
......@@ -71,14 +71,21 @@
},
save() {
let map=this.$refs.rkqd.detailList
let map=this.$refs.rkqd.fpDetailList
let keyList= Object.keys(map)
if(keyList.length==0){
this.$warning('请先选择明细')
return
}
/* 判定勾选的id*/
const selectedList=this.$refs.rkqd.$refs.basePage.multipleSelection
const sekeyList=selectedList.map(item=>item.id)
if(sekeyList.length==0){
this.$warning('请勾选保留项')
return
}
let datas=[]
keyList.forEach(key=>{
sekeyList.forEach(key=>{
map[key].forEach(item=>{
item.fpsl=item.jhsl
datas.push(item)
......
......@@ -94,8 +94,8 @@
}
},
{
label: '库存数量',
prop: 'kcsl',
label: '拣货数量',
prop: 'jhsl',
width: 130,
},
],
......
......@@ -15,11 +15,24 @@
<div lass="min_full" style="height: 50%;display: flex;">
<div style="height: 100%;width: 70%;">
<EditTable 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:royalblue;width: 100%;"
@click.native.prevent="tz(scope.$index,scope,scope.row)" type="text" size="small">
<i class="el-icon-edit"></i>调整
</el-button>
</template>
</el-table-column>
</template>
</EditTable>
</div>
<div style="height: 100%;width: 30%;" >
<div style="height: 100%;width: 30%;">
<EditTable ref="editTable1" :app='editTableConfig2'>
<template slot="tabCustom">
<!-- <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="cz(scope.row)"
......@@ -28,7 +41,7 @@
</el-button>
</template>
</el-table-column>
</template>
</template> -->
</EditTable>
</div>
</div>
......@@ -59,6 +72,9 @@
return {
detailList: {
},
fpDetailList: {
},
power: {
add: false,
......@@ -72,7 +88,7 @@
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: false,
showSelection: true,
saveSelected: false
},
config: {
......@@ -133,7 +149,7 @@
editTableTitle: [{
label: '仓库',
prop: 'ckName',
width: 180,
width: 120,
},
{
label: '批号',
......@@ -211,11 +227,21 @@
],
editTableData: []
},
editTableConfig2:{
editTableTitle:[ {
editTableConfig2: {
editTableTitle: [{
label: '仓库',
prop: 'ckName',
width: 120,
},
{
label: '批号',
prop: 'wlph',
width: 120,
},
{
label: "检出数量",
prop: "jhsl",
width: 180,
width: 90,
allowEdit: true,
type: 'inputNumber',
blur: toFixed(null),
......@@ -234,11 +260,21 @@
row.jhsl = row.oldJhsl
return
}
/* 数量为合理数量时*/
/* 数量为合理数量时 0或者不是0通用*/
let jhsl = parseInt(row.jhsl)
let oldJhsl = parseInt(row.oldJhsl)
let slc = jhsl - oldJhsl
console.log(slc,'slc')
row.kcsl = row.kcsl - slc
/* 同步左面数据*/
let rightid=row.id
this.detailList[this.$id].forEach(ritem=>{
if(rightid==ritem.id){
ritem.kcsl=row.kcsl
ritem.jhsl=row.jhsl
ritem.oldJhsl = row.jhsl
}
})
this.$refs.basePage.$refs.TablePager.tableData.forEach(item => {
if (item.id == this.$id) {
item.jhsl = item.jhsl + slc
......@@ -246,50 +282,135 @@
})
/* 记录当前的拣货数量*/
row.oldJhsl = row.jhsl
/* 判定当这个值为0时候删除*/
if(row.jhsl==0){
let delIndex=null
this.fpDetailList[this.$id].forEach((item,index)=>{
if(item.id==rightid){
delIndex=index
}
})
if(delIndex!=null){
this.fpDetailList[this.$id].splice(delIndex,1)
}
}
}
},],
editTableData:[]
},
],
editTableData: []
}
}
},
methods: {
cz(row){
console.log(row)
row.jhsl = parseInt(0)
/*row.oldJhsl
row.kcsl
*/
if (row.jhsl < 0) {
this.$warning('数量无效')
row.jhsl = row.oldJhsl
return
/* 调整逻辑
弹框输入数量
1.kcsl-0之间 否则判定违法
2.通过id判定右表是否存在,不存在则(修改本条数据的kcsl-jhsl)添加到右面
同生改变主表
3.如果存在的话,覆盖数量。同时对比新老数量,左右表都进行kcsl变更,主表也要根据数量差来进行变更
4
*/
tz(a, b, row) {
this.$prompt('请输入拣出数量', '', {
inputPattern: /^\d+$/,
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({
value
}) => {
let fv = parseInt(value)
/* 判定fv是否合规*/
if (0 < fv && fv <= row.oldKcsl) {
let leftid = row.id
/* 开始同步右面数据*/
let iscz = false
this.fpDetailList[this.$id].forEach((ritem, rindex) => {
if (ritem.id == leftid) {
/* 重复id 开始覆盖 同步双方数据 改变存在标志*/
iscz = true
/* 重复的话判定数量差*/
let slc = fv - row.jhsl
/* 改变数据库存数量*/
row.kcsl = row.kcsl - slc
ritem.kcsl = row.kcsl
row.oldJhsl=row.jhsl
ritem.oldJhsl=ritem.jhsl
row.jhsl = row.jhsl + slc
ritem.jhsl = row.jhsl
/* 改变主表数据*/
this.$refs.basePage.$refs.TablePager.tableData.forEach(item => {
if (item.id == this.$id) {
item.jhsl = item.jhsl + slc
}
})
}
})
/* 存在的时候插入操作,同步数据*/
if (!iscz) {
console.log('不存在,添加进去')
/* 首先改变左表数据*/
row.jhsl = fv
row.oldJhsl = fv
row.kcsl = row.oldKcsl - row.jhsl
/* 然后插入副本*/
this.fpDetailList[this.$id].push(_.cloneDeep(row))
/* 改变主表数据 单纯的增加不需要计算*/
this.$refs.basePage.$refs.TablePager.tableData.forEach(item => {
if (item.id == this.$id) {
item.jhsl = item.jhsl + fv
}
})
}
} else {
this.$warning('拣出数量超过了原库存数量')
}
if (row.jhsl > row.oldKcsl) {
this.$warning('数量不能大于原库存数量')
row.jhsl = row.oldJhsl
return
})
},
cz(row) {
console.log(row)
row.jhsl = parseInt(0)
/*row.oldJhsl
row.kcsl
*/
if (row.jhsl < 0) {
this.$warning('数量无效')
row.jhsl = row.oldJhsl
return
}
if (row.jhsl > row.oldKcsl) {
this.$warning('数量不能大于原库存数量')
row.jhsl = row.oldJhsl
return
}
/* 数量为合理数量时*/
let jhsl = parseInt(row.jhsl)
let oldJhsl = parseInt(row.oldJhsl)
let slc = jhsl - oldJhsl
row.kcsl = row.kcsl - slc
this.$refs.basePage.$refs.TablePager.tableData.forEach(item => {
if (item.id == this.$id) {
item.jhsl = item.jhsl + slc
}
/* 数量为合理数量时*/
let jhsl = parseInt(row.jhsl)
let oldJhsl = parseInt(row.oldJhsl)
let slc = jhsl - oldJhsl
row.kcsl = row.kcsl - slc
this.$refs.basePage.$refs.TablePager.tableData.forEach(item => {
if (item.id == this.$id) {
item.jhsl = item.jhsl + slc
}
})
/* 记录当前的拣货数量*/
row.oldJhsl = row.jhsl
})
/* 记录当前的拣货数量*/
row.oldJhsl = row.jhsl
},
pageQueryFinally(list) {
console.log('清空明细list')
this.detailList = {}
this.fpDetailList = {}
this.editTableConfig.editTableData = []
this.editTableConfig2.editTableData = []
list.forEach((item) => {
list.forEach((item,nowIndex) => {
/* 剩余拣货数量==yfsl*/
let alljhsl = item.yfsl
this.$post('lxyl/rkgl/jhtz/queryAndCalcPkjhtz', {
......@@ -298,42 +419,60 @@
"wlph": item.wlph,
"zlh": item.zlh
}).then(res => {
this.detailList[item.id] = res.data.records || []
let kcList = this.detailList[item.id]
/* 开始扣除库存 kcsl*/
kcList.forEach(kcitem => {
kcitem.cktzmxid=item.id
kcitem.oldKcsl = kcitem.kcsl
kcitem.jhsl = 0
kcitem.oldJhsl = 0
if (alljhsl == 0) {
console.log('应发数量分配完毕')
} else if (kcitem.kcsl >= alljhsl) {
/* 当kc数量大于剩余分配数量*/
console.log('kc数量大于剩余分配数量,分配结束')
kcitem.kcsl = kcitem.kcsl - alljhsl
kcitem.jhsl = alljhsl
kcitem.oldJhsl = kcitem.jhsl
alljhsl = 0
} else if (kcitem.kcsl < alljhsl) {
console.log('kc数量小于剩余分配数量,全部分配继续下个数据')
alljhsl = alljhsl - kcitem.kcsl
kcitem.jhsl = kcitem.kcsl
kcitem.oldJhsl = kcitem.jhsl
kcitem.kcsl = 0
}
})
item.jhsl = item.yfsl - alljhsl
})
this.detailList[item.id] = res.data.records || []
this.fpDetailList[item.id] = []
let kcList = this.detailList[item.id]
/* 开始扣除库存 kcsl*/
kcList.forEach(kcitem => {
kcitem.cktzmxid = item.id
kcitem.oldKcsl = kcitem.kcsl
kcitem.jhsl = 0
kcitem.oldJhsl = 0
if (alljhsl == 0) {
console.log('应发数量分配完毕')
} else if (kcitem.kcsl >= alljhsl) {
/* 当kc数量大于剩余分配数量*/
console.log('kc数量大于剩余分配数量,分配结束')
kcitem.kcsl = kcitem.kcsl - alljhsl
kcitem.jhsl = alljhsl
kcitem.oldJhsl = kcitem.jhsl
alljhsl = 0
} else if (kcitem.kcsl < alljhsl) {
console.log('kc数量小于剩余分配数量,全部分配继续下个数据')
alljhsl = alljhsl - kcitem.kcsl
kcitem.jhsl = kcitem.kcsl
kcitem.oldJhsl = kcitem.jhsl
kcitem.kcsl = 0
}
})
item.jhsl = item.yfsl - alljhsl
/* 新逻辑,将自动分配好的数据 查看jhsl是否为0 不为零单独放到 this.fpDetailList[item.id] */
this.detailList[item.id].forEach(deitem => {
if (deitem.jhsl > 0) {
this.fpDetailList[item.id].push(_.cloneDeep(deitem))
}
})
if(nowIndex==0){
/* 第一个数据加载完备自动执行点击事件*/
this.$nextTick(()=>{
/* 操作组件进行默认选中*/
this.$refs.basePage.$refs.TablePager.setFirstCurrent()
list.forEach(row => {
this.$refs.basePage.$refs.TablePager.$refs.singleTable.toggleRowSelection(row);
});
})
}
}
)
})
},
getRow(val) {
this.$emit('getRow', val)
this.$id = val.id
this.editTableConfig.editTableData = this.detailList[this.$id]
this.editTableConfig2.editTableData = this.detailList[this.$id]
this.editTableConfig2.editTableData = this.fpDetailList[this.$id]
},
demo(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
......
<template>
<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>
</template>
<script>
import wlsx from 'common/src/mixin/wlsx.js'
import wlphsx from 'common/src/mixin/wlphsx.js'
export default {
mixins:[wlphsx,wlsx],
mounted() {
},
data() {
return {
power: {
add: false,
copy: false,
/* 手动控制删除 */
delButton: false,
/* 手动控制编辑按钮权限 */
editButton: false,
/* 是否渲染右侧操作按钮 */
operateButtons: false,
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: false,
saveSelected: false
},
config: {
/* 基本配置*/
/* 基本配置*/
url: 'wms/kcgl/kcpd/query/detail',
queryUrl:'wms/kcgl/kcpd/query/detail',
tableTitle: [{
title: "序号",
field: "xh",
width: 50,
align: "center"
},
{
title: "物料编码",
field: "wlxxCode",
width: 240,
},
{
title: "物料名称",
field: "wlxxName",
width: 160
},
{
title: "物料批号",
field: "wlph",
width: 160
},
{
title: "规格",
field: "wlxxGg",
width: 140
},
{
title: "计量单位",
field: "jldwName",
width: 100,
},
{
title: "制令号",
field: "zlh",
width: 180,
},
{
title: "库位",
field: "kwCode",
width: 240,
},
{
title: "容器",
field: "rqCode",
width: 160,
},
{
title: "唯一码",
field: "packCode",
width: 160,
},
{
title: "盘存数量",
field: "pcsl",
width: 100,
},
{
title: "库存数量",
field: "kcsl",
width: 100,
},
{
title: "盘盈数量",
field: "pysl",
width: 100,
},
{
title: "盘亏数量",
field: "pksl",
width: 100,
},
{
title: "盈亏原因",
field: "ykyy",
width: 300,
},
{
title: "备注",
field: "bz",
width: 200,
}
],
queryParams: [],
}
}
},
methods: {
getRow(val) {
this.$emit('getRow', val)
},
demo(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
console.log(ctx.singleItem)
} else {
this.$warning('请选中一条数据')
}
}
},
components: {
}
}
</script>
<style>
</style>
<template>
<BasePage class="min_full" :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<!-- <el-button @click="qr(ctx.basePage)" size='mini' type="primary">确认</el-button>
<el-button @click="qxqr(ctx.basePage)" size='mini' type="primary">取消确认</el-button> -->
<el-button @click="dj(ctx.basePage)" size='mini' type="primary">冻结</el-button>
<el-button @click="qxdj(ctx.basePage)" size='mini' type="primary">取消冻结</el-button>
<el-button @click="wc(ctx.basePage)" size='mini' type="primary">完成</el-button>
<el-button @click="qxwc(ctx.basePage)" size='mini' type="primary">取消完成</el-button>
<el-button @click="sendSap(ctx.basePage)" size='mini' type="primary">发送至sap</el-button>
</template>
<div class="outer">
<div class=" higher flex-column">
<!-- 分层-->
<div class="top">
<Top @getRow='topGetRow' ref="top"></Top>
</div>
<div class="bottom flex">
<div class="full" >
<el-tabs class="full" v-model="activeName" >
<el-tab-pane class="full" label="盘点明细" name="first">
<Mx ref="mx" class="full" />
</el-tab-pane>
<el-tab-pane class="full" label="盘点清单" name="second">
<ckqd ref="ckqd" class="full" />
</el-tab-pane>
</BasePage>
</el-tabs>
</div>
</div>
</div>
</div>
</template>
<script>
import Edit from './edit.vue'
import Top from './top/index.vue'
import Mx from './mx.vue'
import ckqd from './ckqd.vue'
export default {
data() {
return {
config: {
queryDetail: true,
/* 基本配置*/
url: 'wms/kcgl/kcpd',
queryUrl:'lxyl/kcgl/pdgz/query',
tableTitle: [{
title: "状态",
field: "zt",
width: 70,
"transform": {
"url": "wms/kcgl/kcpd/init/zt",
"label": "name",
"value": "id"
}
},
{
title: "盘点单号",
field: "djid",
fieldType: "ftString",
width: 130
},
{
title: "盘点仓库",
field: "ckmc",
fieldType: "ftString",
width: 160
},
{
title: "盘点日期",
field: "pdrq",
fieldType: "ftDate"
},
{
title: "盘点人",
field: "pdr",
fieldType: "ftString",
width: 140
},
{
title: "备注",
field: "bz",
fieldType: "ftString",
width: 200
},
{
title: "维护人",
field: "whr",
fieldType: "ftString",
width: 120
},
{
title: "维护时间",
field: "whsj",
fieldType: "ftDateTime",
width: 200
}
],
queryParams: [
[{
label: '年度',
prop: 'year',
span: 6,
type: 'year',
value: ''
},
{
label: '盘点单号',
prop: 'djid',
span: 6,
type: 'input',
value: ''
},
{
"label": "仓库",
"prop": "ckid",
"span": 6,
"type": "RelSelect",
"value": "",
"typeConfig": {
"src": "jcsj/common/ck/queryCkid",
"match": {
"value": "id",
"label": "name"
}
}
},
{
"label": "状态",
"prop": "zt",
"span": 6,
"type": "RelSelect",
"value": "",
"typeConfig": {
"src": "wms/kcgl/kcpd/init/zt",
}
},
]
],
/* 默认启停用 */
showqt: false,
components: {
Top,
Mx,
ckqd
}
},
data(){
return{
activeName:'first'
}
},
methods: {
sendSap(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('lxyl/kcgl/pdgz/sync/pdgz', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
topGetRow(row) {
/* dom赋值*/
let mid = row.id
this.$refs.mx.$refs.basePage.queryParams.mid = mid
this.$refs.mx.$refs.basePage.$refs['TablePager'].pageQuery({
// setFirstCurrent: true
})
this.$refs.ckqd.$refs.basePage.queryParams.mid = mid
this.$refs.ckqd.$refs.basePage.$refs['TablePager'].pageQuery()
},
wc(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/complete', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
qxwc(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/uncomplete', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
dj(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/freeze', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
qxdj(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/unfreeze', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
/* 示例*/
qr(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/confirm', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
qxqr(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/unconfirm', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
}
},
components: {
Edit
}
}
</script>
<style>
<style lang="scss" scoped>
.outer {
overflow: auto;
height: calc(100vh - 84px);
width: 100%;
.top {
width: 100%;
height: 45%;
}
.bottom {
width: 100%;
height: 55%;
.left {
width: 50%;
height: 100%;
}
.right {
width: 50%;
height: 100%;
}
}
}
.higher {
height: 140vh;
}
.flex-column {
display: flex;
flex-direction: column;
}
::v-deep .el-tabs__content{
height: calc(100% - 40px);
}
::v-deep .el-tabs__nav-scroll{
padding-left: 10px;
}
</style>
<template>
<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">
</template>
</BasePage>
</template>
<script>
import wlsx from 'common/src/mixin/wlsx.js'
import wlphsx from 'common/src/mixin/wlphsx.js'
export default {
mixins: [wlsx, wlphsx],
data() {
return {
power: {
add: false,
copy: false,
/* 手动控制删除 */
delButton: false,
/* 手动控制编辑按钮权限 */
editButton: false,
/* 是否渲染右侧操作按钮 */
operateButtons: false,
/* 是否开启工作流按钮 */
workFlow: false,
/* 表格开启选择,以及记住选择 */
showSelection: false,
saveSelected: false
},
config: {
/* 基本配置*/
url: 'wms/kcgl/kcpd/query/kcpdmx',
queryUrl: 'wms/kcgl/kcpd/query/kcpdmx',
tableTitle: [{
title: "序号",
field: "xh",
width: 50,
align: "center"
},
{
title: "物料编码",
field: "wlxxCode",
width: 240,
},
{
title: "物料名称",
field: "wlxxName",
width: 160
},
{
title: "物料批号",
field: "wlph",
width: 160
},
{
title: "规格",
field: "wlxxGg",
width: 140
},
{
title: "计量单位",
field: "jldwName",
width: 100,
},
{
title: "制令号",
field: "zlh",
width: 180,
},
{
title: "库位",
field: "kwCode",
width: 240,
},
{
title: "盘存数量",
field: "pcsl",
width: 100,
},
{
title: "库存数量",
field: "kcsl",
width: 100,
},
{
title: "盘盈数量",
field: "pysl",
width: 100,
},
{
title: "盘亏数量",
field: "pksl",
width: 100,
},
{
title: "盈亏原因",
field: "ykyy",
width: 300,
},
{
title: "备注",
field: "bz",
width: 200,
}
],
queryParams: [],
}
}
},
methods: {
getRow(val) {
this.$emit('getRow', val)
},
demo(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
console.log(ctx.singleItem)
} else {
this.$warning('请选中一条数据')
}
}
},
components: {
}
}
</script>
<style>
</style>
<template>
<BasePage class="min_full" @getRow='getRow' style="height: 100%;" :config="config">
<template #dialog="ctx">
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<!-- <el-button @click="qr(ctx.basePage)" size='mini' type="primary">确认</el-button>
<el-button @click="qxqr(ctx.basePage)" size='mini' type="primary">取消确认</el-button> -->
<el-button @click="dj(ctx.basePage)" size='mini' type="primary">冻结</el-button>
<el-button @click="qxdj(ctx.basePage)" size='mini' type="primary">取消冻结</el-button>
<el-button @click="wc(ctx.basePage)" size='mini' type="primary">完成</el-button>
<el-button @click="qxwc(ctx.basePage)" size='mini' type="primary">取消完成</el-button>
<el-button @click="sendSap(ctx.basePage)" size='mini' type="primary">发送至sap</el-button>
</template>
</BasePage>
</template>
<script>
import Edit from './edit.vue'
export default {
data() {
return {
config: {
queryDetail: true,
/* 基本配置*/
url: 'wms/kcgl/kcpd',
queryUrl:'lxyl/kcgl/pdgz/query',
tableTitle: [{
title: "状态",
field: "zt",
width: 70,
"transform": {
"url": "wms/kcgl/kcpd/init/zt",
"label": "name",
"value": "id"
}
},
{
title: "盘点单号",
field: "djid",
fieldType: "ftString",
width: 130
},
{
title: "盘点仓库",
field: "ckmc",
fieldType: "ftString",
width: 160
},
{
title: "盘点日期",
field: "pdrq",
fieldType: "ftDate"
},
{
title: "盘点人",
field: "pdr",
fieldType: "ftString",
width: 140
},
{
title: "备注",
field: "bz",
fieldType: "ftString",
width: 200
},
{
title: "维护人",
field: "whr",
fieldType: "ftString",
width: 120
},
{
title: "维护时间",
field: "whsj",
fieldType: "ftDateTime",
width: 200
}
],
queryParams: [
[{
label: '年度',
prop: 'year',
span: 6,
type: 'year',
value: ''
},
{
label: '盘点单号',
prop: 'djid',
span: 6,
type: 'input',
value: ''
},
{
"label": "仓库",
"prop": "ckid",
"span": 6,
"type": "RelSelect",
"value": "",
"typeConfig": {
"src": "jcsj/common/ck/queryCkid",
"match": {
"value": "id",
"label": "name"
}
}
},
{
"label": "状态",
"prop": "zt",
"span": 6,
"type": "RelSelect",
"value": "",
"typeConfig": {
"src": "wms/kcgl/kcpd/init/zt",
}
},
]
],
/* 默认启停用 */
showqt: false,
}
}
},
methods: {
getRow(val) {
this.$emit('getRow', val)
},
sendSap(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('lxyl/kcgl/pdgz/sync/pdgz', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
wc(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/complete', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
qxwc(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/uncomplete', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
dj(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/freeze', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
qxdj(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/unfreeze', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
/* 示例*/
qr(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/confirm', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
qxqr(ctx){
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('wms/kcgl/kcpd/unconfirm', {
id: ctx.singleItem.id
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
}
},
components: {
Edit
}
}
</script>
<style>
</style>
......@@ -2,10 +2,12 @@
<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来操作默认页面 -->
<el-button @click="gb(ctx.basePage)" size='mini' type="primary">关闭</el-button>
<el-button @click="qxgb(ctx.basePage)" size='mini' type="primary">取消关闭</el-button>
</template>
</BasePage>
......@@ -136,6 +138,58 @@
},
methods: {
gb(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
this.$prompt('请输入原因', '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({
value
}) => {
if (value) {
this.$post('lxyl/rkgl/rktz/close/rktzmx', {
id: ctx.singleItem.id,
gbyy:value
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
} else {
this.$warning('请输入关闭原因')
}
})
} else {
this.$warning('请选中一条数据')
}
},
qxgb(ctx) {
if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('是否继续操作, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('lxyl/rkgl/rkdgb/batchUnClose/rktzmx', {
datas:[
{
id: ctx.singleItem.id
}
]
}).then(res => {
if (res.success) {
this.$success('操作成功')
ctx.refresh()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
getRow(val){
this.$emit('getRow',val)
},
......
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