111
This commit is contained in:
parent
4f14b07bef
commit
45055c2776
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
<vxe-toolbar ref="xToolbar" custom>
|
<vxe-toolbar ref="xToolbar" custom>
|
||||||
<template #buttons>
|
<template #buttons>
|
||||||
<a-button type="primary" icon="delete" @click="pageDelete()">批量删除</a-button>
|
<a-button type="primary" icon="delete" @click="pageDelete()" v-if="options.disabledDelete !== true">批量删除</a-button>
|
||||||
<a-button type="primary" style="margin-left: 5px;" icon="print" v-if="options.enabledPrint"
|
<a-button type="primary" style="margin-left: 5px;" icon="print" v-if="options.enabledPrint"
|
||||||
@click="pagePrint()">打印</a-button>
|
@click="pagePrint()">打印</a-button>
|
||||||
<a-button type="primary" style="margin-left: 5px;" icon="print" v-if="options.enabledPrint2"
|
<a-button type="primary" style="margin-left: 5px;" icon="print" v-if="options.enabledPrint2"
|
||||||
|
|
@ -627,9 +627,15 @@ export default {
|
||||||
loading: "删除中...", // 加载提示
|
loading: "删除中...", // 加载提示
|
||||||
data: delParms,
|
data: delParms,
|
||||||
useBigInt: true
|
useBigInt: true
|
||||||
}).then(() => { // 成功
|
}).then((r) => { // 成功
|
||||||
|
if(r.code == 200){
|
||||||
this.$mk.success("删除成功"); // 提示成功
|
this.$mk.success("删除成功"); // 提示成功
|
||||||
this.$refs.xGrid.commitProxy('query') // 提交搜索
|
this.$refs.xGrid.commitProxy('query') // 提交搜索
|
||||||
|
}else{
|
||||||
|
this.$mk.error(r.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}).catch((a) => { // 失败
|
}).catch((a) => { // 失败
|
||||||
this.$mk.error(a.data.msg); // 提示错误信息
|
this.$mk.error(a.data.msg); // 提示错误信息
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,10 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.textboxValue = "";
|
this.textboxValue = "";
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
params(){
|
||||||
|
|
||||||
|
console.log(this.params)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -235,10 +239,28 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clickEvent() { // 点击事件
|
clickEvent() { // 点击事件
|
||||||
|
|
||||||
|
const { params } = this
|
||||||
if (this.readonly) { // 如果只读
|
if (this.readonly) { // 如果只读
|
||||||
return; // 返回
|
return; // 返回
|
||||||
}
|
}
|
||||||
|
if(params.isClickToLoad){
|
||||||
|
const cellValue = this.textboxValue;
|
||||||
|
let f = params.listdataFieldName || "Records";
|
||||||
|
this.loading = true
|
||||||
|
this.getData(cellValue).then(data => {
|
||||||
|
this.loading = false
|
||||||
|
if ('Total' in data) {
|
||||||
|
this.tablePage.total = data.Total;
|
||||||
|
} else {
|
||||||
|
this.tablePage.total = data.total;
|
||||||
|
}
|
||||||
|
this.tableData = data[f];
|
||||||
|
})
|
||||||
|
}
|
||||||
this.$refs.xDown.showPanel() // 显示面板
|
this.$refs.xDown.showPanel() // 显示面板
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleScanInput(event) {
|
handleScanInput(event) {
|
||||||
|
|
@ -257,7 +279,6 @@ export default {
|
||||||
|
|
||||||
}, 10);
|
}, 10);
|
||||||
if (params.scan) {
|
if (params.scan) {
|
||||||
console.log(inputValue)
|
|
||||||
params.scan({ value: inputValue, input: input })
|
params.scan({ value: inputValue, input: input })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -284,7 +305,6 @@ export default {
|
||||||
if (keyCode == 40) {
|
if (keyCode == 40) {
|
||||||
this.$refs.xDown.showPanel()
|
this.$refs.xDown.showPanel()
|
||||||
const grid = this.$refs.xgrid;
|
const grid = this.$refs.xgrid;
|
||||||
console.log(grid)
|
|
||||||
if (!grid) return;
|
if (!grid) return;
|
||||||
grid.focus();
|
grid.focus();
|
||||||
|
|
||||||
|
|
@ -343,7 +363,6 @@ export default {
|
||||||
},
|
},
|
||||||
onFocus(){
|
onFocus(){
|
||||||
const { params } = this
|
const { params } = this
|
||||||
console.log(params)
|
|
||||||
if (params.focusToLoad) {
|
if (params.focusToLoad) {
|
||||||
const cellValue = this.textboxValue;
|
const cellValue = this.textboxValue;
|
||||||
let f = params.listdataFieldName || "Records";
|
let f = params.listdataFieldName || "Records";
|
||||||
|
|
@ -412,7 +431,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
popupEvent() {
|
popupEvent() {
|
||||||
console.log("popupEvent");
|
|
||||||
this.modalVisible = true;
|
this.modalVisible = true;
|
||||||
},
|
},
|
||||||
confirmEvent() {
|
confirmEvent() {
|
||||||
|
|
|
||||||
|
|
@ -147,17 +147,31 @@ export default {
|
||||||
|
|
||||||
let treedata = {
|
let treedata = {
|
||||||
title: "全部",
|
title: "全部",
|
||||||
titleSys: "系统预置",
|
|
||||||
key: "root"
|
key: "root"
|
||||||
};
|
};
|
||||||
treedata[childrenFieldName] = r.data.MesEnum; // 设置树数据
|
|
||||||
|
|
||||||
|
let treedata1 = {
|
||||||
|
title: "系统内置",
|
||||||
|
key: "root1"
|
||||||
|
};
|
||||||
|
let treedata2 = {
|
||||||
|
title: "自定义",
|
||||||
|
key: "root2"
|
||||||
|
};
|
||||||
|
|
||||||
|
let arr1 = r.data.MesEnum.filter(a=>a.type == 0);
|
||||||
|
let arr2 = r.data.MesEnum.filter(a=>a.type != 0);
|
||||||
|
treedata1[childrenFieldName] = arr1; // 设置树数据
|
||||||
|
treedata2[childrenFieldName] = arr2; // 设置树数据
|
||||||
|
treedata[childrenFieldName] = [
|
||||||
|
treedata1,
|
||||||
|
treedata2
|
||||||
|
]
|
||||||
|
|
||||||
|
console.log(treedata)
|
||||||
function formatTreedata(d) { // 格式化树数据
|
function formatTreedata(d) { // 格式化树数据
|
||||||
if (d.id) {
|
if (d.id) {
|
||||||
d.key = d.id.toString();
|
d.key = d.id.toString();
|
||||||
} else {
|
|
||||||
d.key = "root";
|
|
||||||
}
|
}
|
||||||
if (d.name) {
|
if (d.name) {
|
||||||
d.title = d.name;
|
d.title = d.name;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ export default {
|
||||||
data: {
|
data: {
|
||||||
"name": "",
|
"name": "",
|
||||||
"code": "",
|
"code": "",
|
||||||
|
type:0,
|
||||||
enum_id: "0"
|
enum_id: "0"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -60,9 +61,8 @@ export default {
|
||||||
{ field: 'type', title: '是否系统内置', span: 24, itemRender: { name: '$switch', props: { openLabel: '是', openValue: 1, closeValue: 0, closeLabel: '否' } } },
|
{ field: 'type', title: '是否系统内置', span: 24, itemRender: { name: '$switch', props: { openLabel: '是', openValue: 1, closeValue: 0, closeLabel: '否' } } },
|
||||||
|
|
||||||
// 系统内置名称 sys_name
|
// 系统内置名称 sys_name
|
||||||
{ field: 'sys_name', title: '系统内置名称', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入系统内置名称' } } },
|
//{ field: 'sys_name', title: '系统内置名称', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入系统内置名称' } } },
|
||||||
{ field: 'code', title: '编号', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入编号' } } },
|
{ field: 'code', title: '编号', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入编号' } } }
|
||||||
{ field: 'enum_id', title: '上级分类', span: 24, itemRender: { name: '$select', props: { placeholder: '请输入上级分类', options: [] } } }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -228,12 +228,14 @@ export default {
|
||||||
},
|
},
|
||||||
// 表单项
|
// 表单项
|
||||||
items: [
|
items: [
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '左侧',
|
||||||
|
span: 20,
|
||||||
|
children: [
|
||||||
{ field: 'code', title: '编号', span: 12, itemRender: { name: '$input' } },
|
{ field: 'code', title: '编号', span: 12, itemRender: { name: '$input' } },
|
||||||
{ field: 'name', title: '名称', span: 12, itemRender: { name: '$input' } },
|
{ field: 'name', title: '名称', span: 12, itemRender: { name: '$input' } },
|
||||||
|
|
||||||
{ title: '分类', span: 12, slots: { default: 'sort_id' } },
|
{ title: '分类', span: 12, slots: { default: 'sort_id' } },
|
||||||
|
|
||||||
{ field: 'spec', title: '规格型号', span: 12, itemRender: { name: '$input' } },
|
|
||||||
{ field: 'size', title: '尺寸', span: 12, itemRender: { name: '$input' } },
|
{ field: 'size', title: '尺寸', span: 12, itemRender: { name: '$input' } },
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -247,11 +249,11 @@ export default {
|
||||||
textField: "name",
|
textField: "name",
|
||||||
listdataFieldName: 'MesEnumValue',
|
listdataFieldName: 'MesEnumValue',
|
||||||
actionParams: {
|
actionParams: {
|
||||||
search_rules_enum: [
|
search_rules: [
|
||||||
{
|
{
|
||||||
column: "sys_name",
|
column: "code",
|
||||||
mode: "=",
|
mode: "=",
|
||||||
value: "color"
|
value: "SYS001"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -261,6 +263,24 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{ field: 'spec', title: '规格型号', span: 12, itemRender: { name: '$input' } },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '右侧',
|
||||||
|
span: 4,
|
||||||
|
children: [
|
||||||
|
{ field: 'image', span: 12, itemRender: { name: 'MkFormUploader' } },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '其他',
|
||||||
|
span: 20,
|
||||||
|
children: [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '花面', span: 12,
|
title: '花面', span: 12,
|
||||||
field: 'face',
|
field: 'face',
|
||||||
|
|
@ -337,7 +357,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{ field: 'theoretical_load', title: '理论装车量', span: 12, itemRender: { name: '$input' } },
|
{ field: 'theoretical_load', title: '理论装车量', span: 8, itemRender: { name: '$input' } },
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '土质', span: 12,
|
title: '土质', span: 12,
|
||||||
|
|
@ -378,6 +398,11 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
@ -644,6 +669,7 @@ export default {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.attributes = this.attributes || [];
|
||||||
this.attributes.forEach(item => {
|
this.attributes.forEach(item => {
|
||||||
|
|
||||||
let v = this.getAttributeValue(item.id);
|
let v = this.getAttributeValue(item.id);
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,16 @@ export default {
|
||||||
{ field: 'code', title: '编码' }
|
{ field: 'code', title: '编码' }
|
||||||
],
|
],
|
||||||
listdataFieldName: 'MesWarehouse',
|
listdataFieldName: 'MesWarehouse',
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/list`,
|
||||||
|
onDataChanged: ({ data }) => {
|
||||||
|
|
||||||
|
console.log(data)
|
||||||
|
this.pageOptions.formOptions.data.warehouse_pos_detail = {};
|
||||||
|
this.pageOptions.formOptions.data.warehouse_pos_id = null;
|
||||||
|
this.pageOptions.formOptions.items[1].itemRender.props.params.actionParams.search_rules[0].value = data.id.toString();
|
||||||
|
this.pageOptions.formOptions.items[1].itemRender.props.params = JSON.parse(JSON.stringify(this.pageOptions.formOptions.items[1].itemRender.props.params));
|
||||||
|
this.$forceUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -169,6 +178,17 @@ export default {
|
||||||
{ field: 'warehouse_location_name', title: '名称' },
|
{ field: 'warehouse_location_name', title: '名称' },
|
||||||
{ field: 'code', title: '编码' }
|
{ field: 'code', title: '编码' }
|
||||||
],
|
],
|
||||||
|
isClickToLoad:true,
|
||||||
|
actionParams: {
|
||||||
|
search_rules: [
|
||||||
|
{
|
||||||
|
column: "warehouse_id",
|
||||||
|
mode: "=",
|
||||||
|
value: "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
listdataFieldName: 'WarehouseLocation',
|
listdataFieldName: 'WarehouseLocation',
|
||||||
dataUrl: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/list`
|
dataUrl: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/list`
|
||||||
}
|
}
|
||||||
|
|
@ -199,7 +219,7 @@ export default {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ field: 'stock', dataRule:{type:"number"}, title: '库存数量', span: 12, itemRender: { name: '$input',props:{type:'number'} } },
|
{ field: 'stock', dataRule: { type: "number" }, title: '库存数量', span: 12, itemRender: { name: '$input', props: { type: 'number' } } },
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -240,11 +260,11 @@ export default {
|
||||||
let detailDataFieldName = this.pageOptions.detailDataFieldName;
|
let detailDataFieldName = this.pageOptions.detailDataFieldName;
|
||||||
|
|
||||||
let rules = [
|
let rules = [
|
||||||
{field:"create_time",dataRule:"timestamp"},
|
{ field: "create_time", dataRule: "timestamp" },
|
||||||
{field:"update_time",dataRule:"timestamp"},
|
{ field: "update_time", dataRule: "timestamp" },
|
||||||
];
|
];
|
||||||
rules = []; //上面几个字段如果不需要在表单显示,可以不转换(不转换的话,表单拿到的是什么数据,提交的时候就是什么数据)
|
rules = []; //上面几个字段如果不需要在表单显示,可以不转换(不转换的话,表单拿到的是什么数据,提交的时候就是什么数据)
|
||||||
this.$mk.formatInitFormData({data: a.data[detailDataFieldName] , rules:[...this.pageOptions.formOptions.items,...rules] }); //建议固定格式化写法
|
this.$mk.formatInitFormData({ data: a.data[detailDataFieldName], rules: [...this.pageOptions.formOptions.items, ...rules] }); //建议固定格式化写法
|
||||||
|
|
||||||
this.pageOptions.formOptions.data = a.data[detailDataFieldName];
|
this.pageOptions.formOptions.data = a.data[detailDataFieldName];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@
|
||||||
|
|
||||||
<basic-page-list :desc="desc" :options="pageOptions">
|
<basic-page-list :desc="desc" :options="pageOptions">
|
||||||
<template v-slot:column1="{ row }">
|
<template v-slot:column1="{ row }">
|
||||||
<a-button class="in" type="primary" @click="stockIn(row.id)">入库</a-button>
|
<a-button class="in" type="primary" @click="positionAdd(row.id)">增加仓位</a-button>
|
||||||
<a-button class="out" @click="stockOut(row.id)">出库</a-button>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</basic-page-list>
|
</basic-page-list>
|
||||||
|
|
@ -121,6 +120,7 @@ export default {
|
||||||
{ field: 'product_detail.size', sortable: true, title: '尺寸', width: 100 }, // 尺寸
|
{ field: 'product_detail.size', sortable: true, title: '尺寸', width: 100 }, // 尺寸
|
||||||
{ field: 'product_detail.color', sortable: true, title: '颜色', width: 100 }, // 颜色
|
{ field: 'product_detail.color', sortable: true, title: '颜色', width: 100 }, // 颜色
|
||||||
{ field: 'stock', sortable: true, title: '库存数量', width: 100 }, // 库存数量
|
{ field: 'stock', sortable: true, title: '库存数量', width: 100 }, // 库存数量
|
||||||
|
{ slots: { default: 'column1' }, sortable: true, title: '操作', width: 160,fixed:"right" }, // 出入库操作
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -137,16 +137,22 @@ export default {
|
||||||
this.pageOptions = pageData;
|
this.pageOptions = pageData;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 入库
|
|
||||||
stockOut(id) {
|
|
||||||
console.log("stockOut:"+id)
|
|
||||||
this.$router.push('/MesStock/MesStockOut/'+id) // 跳转路由
|
|
||||||
},
|
|
||||||
|
|
||||||
// 入库
|
positionAdd(id) {
|
||||||
stockIn(id) {
|
this.$mk.dialog.open({
|
||||||
console.log("stockIn:"+id)
|
page: () => import("./Position/PositionAdd"),
|
||||||
this.$router.push('/MesStock/MesStockIn/'+id) // 跳转路由
|
title: "增加仓位",
|
||||||
|
pageOptions: {
|
||||||
|
},
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
dataId: id,
|
||||||
|
callback: ({ success }) => {
|
||||||
|
if (success) {
|
||||||
|
this.$refs.xGrid.commitProxy('query')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ export default {
|
||||||
// 获取路由的id参数
|
// 获取路由的id参数
|
||||||
getDataId() {
|
getDataId() {
|
||||||
let dataId = this.dataId;
|
let dataId = this.dataId;
|
||||||
if (this.$route.params.id) {
|
if (this.$route && this.$route.params && this.$route.params.id) {
|
||||||
dataId = this.$route.params.id;
|
dataId = this.$route.params.id;
|
||||||
}
|
}
|
||||||
if (!dataId) {
|
if (!dataId) {
|
||||||
|
|
@ -200,11 +200,7 @@ export default {
|
||||||
// 返回
|
// 返回
|
||||||
back() {
|
back() {
|
||||||
|
|
||||||
this.$closePage({
|
this.$emit("callback", {});
|
||||||
closeRoute: "/MesStock/MesStockIn"
|
|
||||||
});
|
|
||||||
// 打开列表页面
|
|
||||||
this.$openPage('/MesStock/MesStockPositionList')
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -238,10 +234,7 @@ export default {
|
||||||
if (a.code == "200") {
|
if (a.code == "200") {
|
||||||
|
|
||||||
this.$mk.success("保存成功");
|
this.$mk.success("保存成功");
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
this.back();
|
this.back();
|
||||||
}, 500);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$mk.error(a.msg || a.message);
|
this.$mk.error(a.msg || a.message);
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ export default {
|
||||||
// 获取路由的id参数
|
// 获取路由的id参数
|
||||||
getDataId() {
|
getDataId() {
|
||||||
let dataId = this.dataId;
|
let dataId = this.dataId;
|
||||||
if (this.$route.params.id) {
|
if (this.$route && this.$route.params && this.$route.params.id) {
|
||||||
dataId = this.$route.params.id;
|
dataId = this.$route.params.id;
|
||||||
}
|
}
|
||||||
if (!dataId) {
|
if (!dataId) {
|
||||||
|
|
@ -200,11 +200,8 @@ export default {
|
||||||
// 返回
|
// 返回
|
||||||
back() {
|
back() {
|
||||||
|
|
||||||
this.$closePage({
|
|
||||||
closeRoute: "/MesStock/MesStockOut"
|
this.$emit("callback", {});
|
||||||
});
|
|
||||||
// 打开列表页面
|
|
||||||
this.$openPage('/MesStock/MesStockPositionList')
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,315 @@
|
||||||
|
<template>
|
||||||
|
<div class="page-body">
|
||||||
|
|
||||||
|
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
|
||||||
|
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||||
|
</vxe-form>
|
||||||
|
|
||||||
|
<div class="footerbar">
|
||||||
|
<a-button type="primary" @click="ok">确定</a-button>
|
||||||
|
<a-button @click="cancel">取消</a-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BASE_URL from '@/services/mes/api.js';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
components: {},
|
||||||
|
props: {
|
||||||
|
pageMode: {
|
||||||
|
type: String,
|
||||||
|
default: "edit"
|
||||||
|
},
|
||||||
|
dataId: {
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
|
||||||
|
//let _this = this;
|
||||||
|
// 页面数据变量
|
||||||
|
var pageData = {
|
||||||
|
// 当前项目名称
|
||||||
|
currentConfigName: "",
|
||||||
|
// 当前项目ID
|
||||||
|
currentBeid: 0,
|
||||||
|
|
||||||
|
uploadDefaultImg: null,
|
||||||
|
detailDataFieldName: "",
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
save: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/create`
|
||||||
|
},
|
||||||
|
|
||||||
|
keyName: 'id',
|
||||||
|
// 是否编辑模式
|
||||||
|
isEdit: false,
|
||||||
|
// 表单数据
|
||||||
|
formOptions: {
|
||||||
|
data: {
|
||||||
|
},
|
||||||
|
// 标题宽度
|
||||||
|
titleWidth: 100,
|
||||||
|
// 标题对齐方式
|
||||||
|
titleAlign: 'right',
|
||||||
|
|
||||||
|
// 表单校验规则
|
||||||
|
rules: {
|
||||||
|
warehouse_detail: [
|
||||||
|
{ required: true, message: '请选择仓库' }
|
||||||
|
],
|
||||||
|
warehouse_pos_detail: [
|
||||||
|
{ required: true, message: '请选择仓位' }
|
||||||
|
],
|
||||||
|
|
||||||
|
},
|
||||||
|
// 表单项
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
title: '仓库', span: 12,
|
||||||
|
field: 'warehouse_detail',
|
||||||
|
dataRule: {
|
||||||
|
fromField: "id",
|
||||||
|
saveField: "warehouse_id"
|
||||||
|
},
|
||||||
|
itemRender: {
|
||||||
|
name: 'MkFormDataSelector', props: {
|
||||||
|
params: {
|
||||||
|
dataType: "object",
|
||||||
|
valueField: "id",
|
||||||
|
textField: "warehouse_title",
|
||||||
|
columns: [
|
||||||
|
{ field: 'warehouse_title', title: '名称' },
|
||||||
|
{ field: 'code', title: '编码' }
|
||||||
|
],
|
||||||
|
listdataFieldName: 'MesWarehouse',
|
||||||
|
dataUrl: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/list`,
|
||||||
|
onDataChanged: ({ data }) => {
|
||||||
|
|
||||||
|
console.log(data)
|
||||||
|
this.formOptions.data.warehouse_pos_detail = {};
|
||||||
|
this.formOptions.data.warehouse_pos_id = null;
|
||||||
|
this.formOptions.items[1].itemRender.props.params.actionParams.search_rules[0].value = data.id.toString();
|
||||||
|
this.formOptions.items[1].itemRender.props.params = JSON.parse(JSON.stringify(this.formOptions.items[1].itemRender.props.params));
|
||||||
|
this.$forceUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '仓位', span: 12,
|
||||||
|
field: 'warehouse_pos_detail',
|
||||||
|
dataRule: {
|
||||||
|
fromField: "id",
|
||||||
|
saveField: "warehouse_pos_id"
|
||||||
|
},
|
||||||
|
itemRender: {
|
||||||
|
name: 'MkFormDataSelector', props: {
|
||||||
|
params: {
|
||||||
|
dataType: "object",
|
||||||
|
valueField: "id",
|
||||||
|
textField: "warehouse_location_name",
|
||||||
|
columns: [
|
||||||
|
{ field: 'warehouse_location_name', title: '名称' },
|
||||||
|
{ field: 'code', title: '编码' }
|
||||||
|
],
|
||||||
|
listdataFieldName: 'WarehouseLocation',
|
||||||
|
|
||||||
|
isClickToLoad:true,
|
||||||
|
actionParams: {
|
||||||
|
search_rules: [
|
||||||
|
{
|
||||||
|
column: "warehouse_id",
|
||||||
|
mode: "=",
|
||||||
|
value: "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
dataUrl: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/list`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// 新增模式表单项
|
||||||
|
addModeItems: [
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 合并表单数据及配置
|
||||||
|
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||||
|
|
||||||
|
return pageData;
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
desc() {
|
||||||
|
return this.$t('editPageDesc')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
created() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 函数
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取路由的id参数
|
||||||
|
getDataId() {
|
||||||
|
let dataId = this.dataId;
|
||||||
|
if (this.$route && this.$route.params && this.$route.params.id) {
|
||||||
|
dataId = this.$route.params.id;
|
||||||
|
}
|
||||||
|
if (!dataId) {
|
||||||
|
dataId = 0;
|
||||||
|
}
|
||||||
|
return dataId;
|
||||||
|
},
|
||||||
|
getDataId_BigInt() {
|
||||||
|
let dataId = this.getDataId();
|
||||||
|
return this.$mk.toBigInt(dataId);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
back() {
|
||||||
|
|
||||||
|
this.$emit("callback", {});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 保存
|
||||||
|
ok() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let save = () => {
|
||||||
|
|
||||||
|
|
||||||
|
let postdata = Object.assign({}, this.formOptions.data);
|
||||||
|
|
||||||
|
// 格式化提交的数据
|
||||||
|
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
|
||||||
|
|
||||||
|
|
||||||
|
postdata.stock_id = this.getDataId_BigInt();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 提交数据
|
||||||
|
this.$mk.post({
|
||||||
|
url: this.actions.save,
|
||||||
|
loading: "保存中...",
|
||||||
|
data: postdata,
|
||||||
|
useBigInt: true,
|
||||||
|
}).then((a) => { // 成功回调
|
||||||
|
if (a.code == "200") {
|
||||||
|
|
||||||
|
this.$mk.success("保存成功");
|
||||||
|
this.back();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.$mk.error(a.msg || a.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 验证表单
|
||||||
|
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => { // 验证表单
|
||||||
|
|
||||||
|
save(); // 提交保存
|
||||||
|
|
||||||
|
}).catch(count => { // 验证失败
|
||||||
|
this.$mk.error(`存在${count}项错误,请检查`);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 取消 返回
|
||||||
|
cancel() {
|
||||||
|
this.back();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
// 监听属性
|
||||||
|
watch: {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.page-body {
|
||||||
|
padding: 30px;
|
||||||
|
background: @base-bg-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formtabs .ant-tabs-tabpane {
|
||||||
|
/* background: white; */
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gridPanel {
|
||||||
|
height: calc(100vh - 600px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.footerbar {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imagePanel {
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 10px;
|
||||||
|
width: 100px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.oplinks2 svg {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oplinks2 i {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -50,7 +50,7 @@ export default {
|
||||||
|
|
||||||
addPageUrl: "/MesStock/MesStockPositionAdd",
|
addPageUrl: "/MesStock/MesStockPositionAdd",
|
||||||
editPageUrl: "/MesStock/MesStockPositionUpdate/",
|
editPageUrl: "/MesStock/MesStockPositionUpdate/",
|
||||||
|
disabledAdd:true,
|
||||||
// 接口动作
|
// 接口动作
|
||||||
actions: { // Api 接口地址
|
actions: { // Api 接口地址
|
||||||
// =============================== 接口地址 自动生成 Start ===============================
|
// =============================== 接口地址 自动生成 Start ===============================
|
||||||
|
|
@ -150,14 +150,48 @@ export default {
|
||||||
|
|
||||||
// 入库
|
// 入库
|
||||||
stockOut(id) {
|
stockOut(id) {
|
||||||
console.log("stockOut:"+id)
|
//console.log("stockOut:"+id)
|
||||||
this.$router.push('/MesStock/MesStockOut/'+id) // 跳转路由
|
//this.$router.push('/MesStock/MesStockOut/'+id) // 跳转路由
|
||||||
|
|
||||||
|
|
||||||
|
this.$mk.dialog.open({
|
||||||
|
page: () => import("../OutIn/OutEdit"),
|
||||||
|
title: "出库",
|
||||||
|
pageOptions: {
|
||||||
|
},
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
dataId: id,
|
||||||
|
callback: ({ success }) => {
|
||||||
|
if (success) {
|
||||||
|
this.$refs.xGrid.commitProxy('query')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 入库
|
// 入库
|
||||||
stockIn(id) {
|
stockIn(id) {
|
||||||
console.log("stockIn:"+id)
|
//console.log("stockIn:"+id)
|
||||||
this.$router.push('/MesStock/MesStockIn/'+id) // 跳转路由
|
//this.$router.push('/MesStock/MesStockIn/'+id) // 跳转路由
|
||||||
|
|
||||||
|
|
||||||
|
this.$mk.dialog.open({
|
||||||
|
page: () => import("../OutIn/InEdit"),
|
||||||
|
title: "入库",
|
||||||
|
pageOptions: {
|
||||||
|
},
|
||||||
|
width: 800,
|
||||||
|
height: 600,
|
||||||
|
dataId: id,
|
||||||
|
callback: ({ success }) => {
|
||||||
|
if (success) {
|
||||||
|
this.$refs.xGrid.commitProxy('query')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue