仓库及库存

This commit is contained in:
zxx 2023-11-15 14:56:13 +08:00
parent 2c06689b3d
commit fa32863376
9 changed files with 1055 additions and 78 deletions

View File

@ -52,9 +52,9 @@ export default {
// ID
currentBeid: 0,
addPageUrl: "/MesUnit/MesUnitAdd",
editPageUrl: "/MesUnit/MesUnitUpdate/",
listPageUrl: "/MesUnit/MesUnitList",
addPageUrl: "/MesStock/MesStockAdd",
editPageUrl: "/MesStock/MesStockUpdate/",
listPageUrl: "/MesStock/MesStockList",
uploadDefaultImg: null,
@ -63,16 +63,23 @@ export default {
actions: {
// =============================== Start ===============================
MesUnitList: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/list`, //
MesUnitDetail: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/detail`, //
MesUnitCreate: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/create`, //
MesUnitUpdate: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/update`, //
MesUnitDelete: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/detele`, //
MesUnitBatchDelete: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/batchDelete`, //
MesUnitBatchUpdate: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/batchUpdate`, //
MesUnitBatchCreate: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/batchCreate`, //
MesUnitExportExcel: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/export/excel`, // EXCEL
MesUnitImportExcel: `${BASE_URL.BASE_URL}/MesUnit/v1/mes/unit/import/excel`, // EXCEL
MesStockList: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/list`, //
MesStockDetail: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/detail`, //
MesStockCreate: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/create`, //
MesStockUpdate: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/update`, //
MesStockDelete: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/detele`, //
MesStockBatchDelete: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/batchDelete`, //
ProductStockOut: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/out`, //
ProductStockIn: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/in`, //
MesStockPositionList: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/list`, //
MesStockPositionDetail: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/detail`, //
MesStockPositionCreate: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/create`, //
MesStockPositionUpdate: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/update`, //
MesStockPositionDelete: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/detele`, //
MesStockPositionBatchDelete: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/batchDelete`, //
MesStockPositionBatchUpdate: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/batchUpdate`, //
MesStockPositionBatchCreate: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/batchCreate`, //
MesStockPositionBatchHandle: `${BASE_URL.BASE_URL}/MesStock/v1/mes/stock/position/batchHandle`, //
// =============================== End ===============================
},
@ -87,13 +94,13 @@ export default {
id: 0,
code: "",
title: "",
name: "",
product_id: 0,
product_detail: [],
stock: 0,
create_uid: 0,
update_uid: 0,
create_time: new Date(2100, 1, 1).getTime() / 10000,
update_time: new Date(2100, 1, 1).getTime() / 10000,
// =============================== End ===============================
},
//
@ -108,11 +115,11 @@ export default {
code: [
{ required: true, message: '请输入编码' }
],
title: [
{ required: true, message: '请输入库存名称' }
product_id: [
{ required: true, message: '请选择产品' }
],
name: [
{ required: true, message: '请输入库存英文名称' }
stock: [
{ required: true, message: '请输入库存数量' }
],
// =============================== End ===============================
@ -121,9 +128,9 @@ export default {
items: [
// =============================== Start ===============================
{ field: 'code', title: '编码', span: 24, itemRender: { name: '$input' } },
{ field: 'title', title: '库存名称', span: 24, itemRender: { name: '$input' } },
{ field: 'name', title: '库存英文名称', span: 24, itemRender: { name: '$input' } },
{ field: 'product_id', title: '料品', span: 12, itemRender: { name: '$input' } },
{ field: 'code', title: '库存编码', span: 12, itemRender: { name: '$input' } },
{ field: 'stock', title: '库存数量', span: 12, itemRender: { name: '$input' } },
// =============================== End ===============================
]
@ -136,9 +143,9 @@ export default {
};
pageData.actions.get = pageData.actions.MesUnitDetail;
pageData.actions.create = pageData.actions.MesUnitCreate;
pageData.actions.update = pageData.actions.MesUnitUpdate;
pageData.actions.get = pageData.actions.MesStockDetail;
pageData.actions.create = pageData.actions.MesStockCreate;
pageData.actions.update = pageData.actions.MesStockUpdate;
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);

View File

@ -0,0 +1,204 @@
<template>
<basic-page-list :desc="desc" :options="pageOptions">
<template v-slot:column1="{ row }">
<a-button class="in" type="default" @click="stockIn(row.id)">查看详情</a-button>
</template>
</basic-page-list>
</template>
<script>
import BASE_URL from '@/services/mes/api.js';
export default {
i18n: require("./i18n"),
props: {
},
data() {
return {
pageOptions: {}
};
},
//
computed: {
//
desc() {
return this.$t("pageDesc");
}
},
//
created() {
this.optionsInit();
},
//
methods: {
optionsInit() {
//
var pageData = { //
keyName: 'id', //
listFieldName: 'ProductStockLog',
addPageUrl: "/MesWarehouse/MesWarehousePositionAdd",
editPageUrl: "/MesWarehouse/MesWarehousePositionUpdate/",
//
actions: { // Api
// =============================== Start ===============================
LogList: `${BASE_URL.BASE_URL}/MesStock/v1/log/list`, //
LogDetail: `${BASE_URL.BASE_URL}/MesStock/v1/log/detail`, //
ProductStockLogList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/list`, //
ProductStockLogOutList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/out/list`, //
ProductStockLogInList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/in/list`, //
ProductStockLogDetail: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/detail`, //
ProductStockLogCreate: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/create`, //
ProductStockLogUpdate: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/update`, //
ProductStockLogDelete: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/detele`, //
ProductStockLogBatchDelete: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/batchDelete`, //
// =============================== End ===============================
},
start_time: 0, //
end_time: 0, //
//
searchFormData: {
title: '',
desc: '',
},
//
searchRules: [
{ key: "title", mode: "like" },
{ key: "desc", mode: "like" }
],
//
searchFormItems: [ //
{ field: 'title', title: '标题', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入仓位名称' } } },
{ span: 8, slots: { default: 'date' } }, //
{
align: 'right', span: 4, itemRender: { //
name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } }, //
{ props: { type: 'reset', content: '重置' } }]
}
}
],
//
gridOptions: { //
height: '100%', // 100%
stripe: true, //
id: 'datagrid_1', //
columns: [
{ type: 'checkbox', width: '40' }, //
{ type: 'seq', width: '40' }, //
// "id,optional" validate:"" message:"" label:""` //
// "stock_pos_id,optional" validate:"" message:"" label:""` // ID
// "product_id,optional" validate:"" message:"" label:""` // ID
// "stock,optional" validate:"" message:"" label:""` //
// "out_time,optional" validate:"" message:"" label:""` //
// "out_user_id,optional" validate:"" message:"" label:""` // ID
// "out_user_name,optional" validate:"" message:"" label:""` //
// "bill_date,optional" validate:"" message:"" label:""` //
// "in_type,optional" validate:"" message:"" label:""` //
// "business_type,optional" validate:"" message:"" label:""` //
// "business_no,optional" validate:"" message:"" label:""` //
// "out_type,optional" validate:"" message:"" label:""` //
// "department_id,optional" validate:"" message:"" label:""` // ID
// "salesman_uid,optional" validate:"" message:"" label:""` // ID
// "handler_uid,optional" validate:"" message:"" label:""` // ID
// "handler_name,optional" validate:"" message:"" label:""` //
// "warehouse_keeper_uid,optional" validate:"" message:"" label:""` // ID
// "warehouse_keeper_name,optional" validate:"" message:"" label:""` //
// "check_user_uid,optional" validate:"" message:"" label:""` // id
// "check_user_name,optional" validate:"" message:"" label:""` //
// "check_time,optional" validate:"" message:"" label:""` //
// "delivery_no,optional" validate:"" message:"" label:""` //
// "contact,optional" validate:"" message:"" label:""` //
// "phone,optional" validate:"" message:"" label:""` //
// "remark,optional" validate:"" message:"" label:""` //
// "salesman_name,optional" validate:"" message:"" label:""` //
//
//
//
// =============================== Start ===============================
{ title: '操作', slots: { default: 'op' }, width: 120 },
{ field: 'id' , slots: { default: 'column1' }, sortable: true, title: '查看详情', width: 100 }, //
{ field: 'product_detail.name', sortable: true, title: '料品名称', width: 250 }, //
{ field: 'in_type', sortable: true, title: '入库类型', width: 100 }, //
{ field: 'in_stock', sortable: true, title: '入库数量', width: 100 }, //
{ field: 'stock', sortable: true, title: '剩余库存', width: 100 }, //
{ field: 'warehouse_idetail.name', sortable: true, title: '仓库', width: 150 }, //
{ field: 'warehouse_pos_idetail.name', sortable: true, title: '库位', width: 150 }, //
{ field: 'in_user_name', sortable: true, title: '入库人', width: 100 }, //
{ field: 'bill_date',formatter: 'formatDate', sortable: true, title: '单据日期', width: 100 }, //
{ field: 'business_type', sortable: true, title: '业务类型', width: 100 }, //
{ field: 'business_no', sortable: true, title: '业务单号', width: 100 }, //
{ field: 'out_type', sortable: true, title: '入库类型', width: 100 }, //
{ field: 'handler_name', sortable: true, title: '经手人', width: 100 }, //
{ field: 'check_user_name', sortable: true, title: '验货人', width: 100 }, //
{ field: 'in_time', formatter: 'formatDate', width: 100, sortable: true, title: '入库时间', showHeaderOverflow: true }, //
{ field: 'create_time', formatter: 'formatDate', width: 100, sortable: true, title: '创建时间', showHeaderOverflow: true }, //
{ field: 'update_time', formatter: 'formatDate', width: 100, sortable: true, title: '更新时间', showHeaderOverflow: true }, //
// { field: 'stock_id', sortable: true, title: 'id', width: 250 }, // id
// =============================== Start ===============================
]
}
};
pageData.actions.getList = pageData.actions.ProductStockLogInList;
pageData.actions.delete = pageData.actions.MesStockPositionBatchDelete;
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); //
this.pageOptions = pageData;
},
loadData(e) {
console.log(e.WarehouseLocation);
e.WarehouseLocation.forEach(item => {
console.log(item.is_default);
if (item.is_default === 1) {
item.__hide_delete = true
}
});
},
//
stockOut(id) {
console.log("stockOut:"+id)
},
//
stockIn(id) {
console.log("stockIn:"+id)
},
},
watch: {
},
};
</script>
<style lang="less" scoped>
.out {
margin-left: 10px;
}
</style>

View File

@ -1,9 +1,8 @@
<template>
<basic-page-list :desc="desc" :options="pageOptions" @loadData="loadData">
<basic-page-list :desc="desc" :options="pageOptions">
<template v-slot:column1="{ row }">
<a-button type="default">出库</a-button>
{{ row.id }}
<a-button>入库</a-button>
<a-button class="in" type="primary" @click="stockIn(row.id)">入库</a-button>
<a-button class="out" @click="stockOut(row.id)">出库</a-button>
</template>
</basic-page-list>
@ -114,19 +113,19 @@ export default {
// =============================== Start ===============================
{ title: '操作', slots: { default: 'op' }, width: 120 },
{ field: 'id' ,solts:{default:'column1'}, sortable: true, title: '出入库操作', width: 150 }, //
{ field: 'code', sortable: true, title: '库存编码', width: 100 }, //
{ field: 'product_detail.mes_materials_sort.name', sortable: true, title: '分类', width: 100 }, //
{ field: 'product_detail.name', sortable: true, title: '品名称', width: 250 }, //
{ field: 'product_detail.code', sortable: true, title: '产品编码', width: 140 }, //
{ field: 'product_detail.spec', sortable: true, title: '规格型号', width: 250 }, //
{ field: 'product_detail.mes_materials_sort.name', sortable: true, title: '料品分类', width: 100 }, //
{ field: 'product_detail.name', sortable: true, title: '品名称', width: 250 }, //
{ field: 'product_detail.code', sortable: true, title: '料品编码', width: 120 }, //
{ field: 'product_detail.spec', sortable: true, title: '规格型号', width: 150 }, //
{ field: 'product_detail.size', sortable: true, title: '尺寸', width: 100 }, //
{ field: 'product_detail.color', sortable: true, title: '颜色', width: 100 }, //
{ field: 'stock', sortable: true, title: '库存数量', width: 100 }, //
{ field: 'create_time', formatter: 'formatDate', width: 100, sortable: true, title: '创建时间', showHeaderOverflow: true }, //
{ field: 'update_time', formatter: 'formatDate', width: 100, sortable: true, title: '更新时间', showHeaderOverflow: true }, //
{ field: 'id' ,slots:{default:'column1'}, sortable: true, title: '出入库操作', width: 160,fixed:"right" }, //
// =============================== Start ===============================
@ -142,7 +141,15 @@ export default {
this.pageOptions = pageData;
},
//
stockOut(id) {
console.log("stockOut:"+id)
},
//
stockIn(id) {
console.log("stockIn:"+id)
},
},
watch: {
@ -151,3 +158,8 @@ export default {
};
</script>
<style lang="less" scoped>
.out {
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,245 @@
<!-- 出入库记录 -->
<template>
<basic-page-edit :desc="desc" :dataId="getDataId()" :options="pageOptions"></basic-page-edit>
</template>
<script>
import BASE_URL from '@/services/mes/api.js';
export default {
i18n: require('./i18n'),
components: {},
props: {
pageMode: {
type: String,
default: "edit"
},
dataId: {
}
},
data() {
return {
pageOptions: {}
};
},
computed: {
desc() {
return this.$t('editPageDesc')
}
},
created() {
this.optionsInit();
this.dataInit();
},
//
methods: {
optionsInit() {
//
var pageData = {
//
currentConfigName: "",
// ID
currentBeid: 0,
addPageUrl: "/MesStock/MesStockAdd",
editPageUrl: "/MesStock/MesStockUpdate/",
listPageUrl: "/MesStock/MesStockList",
uploadDefaultImg: null,
detailDataFieldName: "mes_unit",
actions: {
// =============================== Start ===============================
LogList: `${BASE_URL.BASE_URL}/MesStock/v1/log/list`, //
LogDetail: `${BASE_URL.BASE_URL}/MesStock/v1/log/detail`, //
ProductStockLogList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/list`, //
ProductStockLogOutList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/out/list`, //
ProductStockLogInList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/in/list`, //
ProductStockLogDetail: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/detail`, //
ProductStockLogCreate: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/create`, //
ProductStockLogUpdate: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/update`, //
ProductStockLogDelete: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/detele`, //
ProductStockLogBatchDelete: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/batchDelete`, //
ProductStockOut: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/out`, //
ProductStockIn: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/in`, //
// =============================== End ===============================
},
keyName: 'id',
//
isEdit: false,
//
formOptions: {
data: {
// =============================== Start ===============================
id: 0,
code: "",
title: "",
name: "",
create_uid: 0,
update_uid: 0,
create_time: new Date(2100, 1, 1).getTime() / 10000,
update_time: new Date(2100, 1, 1).getTime() / 10000,
// =============================== End ===============================
},
//
titleWidth: 180,
//
titleAlign: 'right',
//
rules: {
// =============================== Start ===============================
code: [
{ required: true, message: '请输入编码' }
],
title: [
{ required: true, message: '请输入库存名称' }
],
name: [
{ required: true, message: '请输入库存英文名称' }
],
// =============================== End ===============================
},
//
items: [
// =============================== Start ===============================
{ field: 'stock_pos_id', title: '库位ID', span: 12, itemRender: { name: '$input' } },
{ field: 'product_id', title: '产品ID', span: 12, itemRender: { name: '$input' } },
{ field: 'stock', title: '剩余库存数量', span: 12, itemRender: { name: '$input' } },
{ field: 'in_type', title: '入库类型', span: 12, itemRender: { name: '$input' } },
{ field: 'in_time', title: '入库时间', span: 12, itemRender: { name: '$input' } ,props: { type: "date" }},
{ field: 'in_user_id', title: '入库人员id', span: 12, itemRender: { name: '$input' } },
{ field: 'in_user_name', title: '入库人员姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'in_stock', title: '入库数量', span: 12, itemRender: { name: '$input' } },
{ field: 'out_stock', title: '出库数量', span: 12, itemRender: { name: '$input' } },
{ field: 'out_time', title: '出库时间', span: 12, itemRender: { name: '$input' } ,props: { type: "date" }},
{ field: 'out_user_id', title: '出库人员id', span: 12, itemRender: { name: '$input' } },
{ field: 'out_user_name', title: '出库人员姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'out_type', title: '出库类型', span: 12, itemRender: { name: '$input' } },
{ field: 'bill_date', title: '单据日期', span: 12, itemRender: { name: '$input' ,props: { type: "date" }} },
{ field: 'business_type', title: '业务类型', span: 12, itemRender: { name: '$input' } },
{ field: 'business_no', title: '业务单号', span: 12, itemRender: { name: '$input' } },
{ field: 'out_type', title: '出库类型', span: 12, itemRender: { name: '$input' } },
{ field: 'department_id', title: '部门ID', span: 12, itemRender: { name: '$input' } },
{ field: 'salesman_uid', title: '业务员ID', span: 12, itemRender: { name: '$input' } },
{ field: 'salesman_name', title: '业务员姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'handler_uid', title: '经手人ID', span: 12, itemRender: { name: '$input' } },
{ field: 'handler_name', title: '经手人姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_keeper_uid', title: '仓管员ID', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_keeper_name', title: '仓管员姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'check_user_uid', title: '验货人id', span: 12, itemRender: { name: '$input' } },
{ field: 'check_user_name', title: '验货人姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'check_time', title: '验货时间', span: 12, itemRender: { name: '$input' } ,props: { type: "date" }},
{ field: 'delivery_no', title: '发货单号', span: 12, itemRender: { name: '$input' } },
{ field: 'contact', title: '联系人', span: 12, itemRender: { name: '$input' } },
{ field: 'phone', title: '联系电话', span: 12, itemRender: { name: '$input' } },
{ field: 'remark', title: '备注', span: 12, itemRender: { name: '$input' } },
{ field: 'stock', title: '剩余库存数量', span: 12, itemRender: { name: '$input' } },
// =============================== End ===============================
]
},
//
addModeItems: [
],
};
pageData.actions.get = pageData.actions.MesStockDetail;
pageData.actions.create = pageData.actions.MesStockCreate;
pageData.actions.update = pageData.actions.MesStockUpdate;
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
this.pageOptions = pageData;
},
dataInit() {
// id
let dataId = this.getDataId();
// id
if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.pageOptions.actions.get,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
}
}).then(a => {
let detailDataFieldName = this.pageOptions.detailDataFieldName;
if (a.data[detailDataFieldName].create_time) {
a.data[detailDataFieldName].create_time = new Date(a.data[detailDataFieldName].create_time * 1000);
}
if (a.data[detailDataFieldName].update_time) {
a.data[detailDataFieldName].update_time = new Date(a.data[detailDataFieldName].update_time * 1000);
}
this.pageOptions.formOptions.data = a.data[detailDataFieldName];
this.$forceUpdate()
}).catch((a) => {
this.$mk.error(a.data.msg);
});
this.pageOptions.isEdit = true;
this.$forceUpdate()
} else {
// id
this.addModeItems.forEach(item => {
this.pageOptions.formOptions.items.push(item);
})
}
},
// id
getDataId() {
let dataId = this.dataId;
if (this.$route.params.id) {
dataId = this.$route.params.id;
}
if (!dataId) {
dataId = 0;
}
return dataId;
}
},
//
watch: {
}
};
</script>

View File

@ -0,0 +1,263 @@
<!-- 出入库记录 -->
<template>
<basic-page-edit :desc="desc" :dataId="getDataId()" :options="pageOptions"></basic-page-edit>
</template>
<script>
import BASE_URL from '@/services/mes/api.js';
export default {
i18n: require('./i18n'),
components: {},
props: {
pageMode: {
type: String,
default: "edit"
},
dataId: {
}
},
data() {
return {
pageOptions: {}
};
},
computed: {
desc() {
return this.$t('editPageDesc')
}
},
created() {
this.optionsInit();
this.dataInit();
},
//
methods: {
optionsInit() {
//
var pageData = {
//
currentConfigName: "",
// ID
currentBeid: 0,
addPageUrl: "/MesStock/MesStockAdd",
editPageUrl: "/MesStock/MesStockUpdate/",
listPageUrl: "/MesStock/MesStockList",
uploadDefaultImg: null,
detailDataFieldName: "mes_unit",
actions: {
// =============================== Start ===============================
LogList: `${BASE_URL.BASE_URL}/MesStock/v1/log/list`, //
LogDetail: `${BASE_URL.BASE_URL}/MesStock/v1/log/detail`, //
ProductStockLogList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/list`, //
ProductStockLogOutList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/out/list`, //
ProductStockLogInList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/in/list`, //
ProductStockLogDetail: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/detail`, //
ProductStockLogCreate: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/create`, //
ProductStockLogUpdate: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/update`, //
ProductStockLogDelete: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/detele`, //
ProductStockLogBatchDelete: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/batchDelete`, //
ProductStockOut: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/out`, //
ProductStockIn: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/in`, //
// =============================== End ===============================
},
keyName: 'id',
//
isEdit: false,
//
formOptions: {
data: {
// =============================== Start ===============================
id: 0,
code: "",
title: "",
name: "",
create_uid: 0,
update_uid: 0,
create_time: new Date(2100, 1, 1).getTime() / 10000,
update_time: new Date(2100, 1, 1).getTime() / 10000,
// =============================== End ===============================
},
//
titleWidth: 180,
//
titleAlign: 'right',
//
rules: {
// =============================== Start ===============================
code: [
{ required: true, message: '请输入编码' }
],
title: [
{ required: true, message: '请输入库存名称' }
],
name: [
{ required: true, message: '请输入库存英文名称' }
],
// =============================== End ===============================
},
//
items: [
// =============================== Start ===============================
// ID
// ID
//
//
// id
//
//
//
//
//
//
// ID
// ID
// ID
//
// ID
//
// id
//
//
//
//
//
//
//
{ field: 'stock_pos_id', title: '库位ID', span: 12, itemRender: { name: '$input' } },
{ field: 'product_id', title: '产品ID', span: 12, itemRender: { name: '$input' } },
{ field: 'stock', title: '入库数量', span: 12, itemRender: { name: '$input' } },
{ field: 'in_time', title: '入库时间', span: 12, itemRender: { name: '$input' } ,props: { type: "date" }},
{ field: 'in_user_id', title: '入库人员id', span: 12, itemRender: { name: '$input' } },
{ field: 'in_user_name', title: '入库人员姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'bill_date', title: '单据日期', span: 12, itemRender: { name: '$input' ,props: { type: "date" }} },
{ field: 'in_type', title: '入库类型', span: 12, itemRender: { name: '$input' } },
{ field: 'business_type', title: '业务类型', span: 12, itemRender: { name: '$input' } },
{ field: 'business_no', title: '业务单号', span: 12, itemRender: { name: '$input' } },
{ field: 'out_type', title: '出库类型', span: 12, itemRender: { name: '$input' } },
{ field: 'department_id', title: '部门ID', span: 12, itemRender: { name: '$input' } },
{ field: 'salesman_uid', title: '业务员ID', span: 12, itemRender: { name: '$input' } },
{ field: 'salesman_name', title: '业务员姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'handler_uid', title: '经手人ID', span: 12, itemRender: { name: '$input' } },
{ field: 'handler_name', title: '经手人姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_keeper_uid', title: '仓管员ID', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_keeper_name', title: '仓管员姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'check_user_uid', title: '验货人id', span: 12, itemRender: { name: '$input' } },
{ field: 'check_user_name', title: '验货人姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'check_time', title: '验货时间', span: 12, itemRender: { name: '$input' } ,props: { type: "date" }},
{ field: 'delivery_no', title: '发货单号', span: 12, itemRender: { name: '$input' } },
{ field: 'contact', title: '联系人', span: 12, itemRender: { name: '$input' } },
{ field: 'phone', title: '联系电话', span: 12, itemRender: { name: '$input' } },
{ field: 'remark', title: '备注', span: 12, itemRender: { name: '$input' } },
// =============================== End ===============================
]
},
//
addModeItems: [
],
};
pageData.actions.get = pageData.actions.MesStockDetail;
pageData.actions.create = pageData.actions.MesStockCreate;
pageData.actions.update = pageData.actions.MesStockUpdate;
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
this.pageOptions = pageData;
},
dataInit() {
// id
let dataId = this.getDataId();
// id
if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.pageOptions.actions.get,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
}
}).then(a => {
let detailDataFieldName = this.pageOptions.detailDataFieldName;
if (a.data[detailDataFieldName].create_time) {
a.data[detailDataFieldName].create_time = new Date(a.data[detailDataFieldName].create_time * 1000);
}
if (a.data[detailDataFieldName].update_time) {
a.data[detailDataFieldName].update_time = new Date(a.data[detailDataFieldName].update_time * 1000);
}
this.pageOptions.formOptions.data = a.data[detailDataFieldName];
this.$forceUpdate()
}).catch((a) => {
this.$mk.error(a.data.msg);
});
this.pageOptions.isEdit = true;
this.$forceUpdate()
} else {
// id
this.addModeItems.forEach(item => {
this.pageOptions.formOptions.items.push(item);
})
}
},
// id
getDataId() {
let dataId = this.dataId;
if (this.$route.params.id) {
dataId = this.$route.params.id;
}
if (!dataId) {
dataId = 0;
}
return dataId;
}
},
//
watch: {
}
};
</script>

View File

@ -0,0 +1,204 @@
<template>
<basic-page-list :desc="desc" :options="pageOptions">
<template v-slot:column1="{ row }">
<a-button class="in" type="default" @click="stockIn(row.id)">查看详情</a-button>
</template>
</basic-page-list>
</template>
<script>
import BASE_URL from '@/services/mes/api.js';
export default {
i18n: require("./i18n"),
props: {
},
data() {
return {
pageOptions: {}
};
},
//
computed: {
//
desc() {
return this.$t("pageDesc");
}
},
//
created() {
this.optionsInit();
},
//
methods: {
optionsInit() {
//
var pageData = { //
keyName: 'id', //
listFieldName: 'ProductStockLog',
addPageUrl: "/MesWarehouse/MesWarehousePositionAdd",
editPageUrl: "/MesWarehouse/MesWarehousePositionUpdate/",
//
actions: { // Api
// =============================== Start ===============================
LogList: `${BASE_URL.BASE_URL}/MesStock/v1/log/list`, //
LogDetail: `${BASE_URL.BASE_URL}/MesStock/v1/log/detail`, //
ProductStockLogList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/list`, //
ProductStockLogOutList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/out/list`, //
ProductStockLogInList: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/in/list`, //
ProductStockLogDetail: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/detail`, //
ProductStockLogCreate: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/create`, //
ProductStockLogUpdate: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/update`, //
ProductStockLogDelete: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/detele`, //
ProductStockLogBatchDelete: `${BASE_URL.BASE_URL}/MesStock/v1/product/stock/log/batchDelete`, //
// =============================== End ===============================
},
start_time: 0, //
end_time: 0, //
//
searchFormData: {
title: '',
desc: '',
},
//
searchRules: [
{ key: "title", mode: "like" },
{ key: "desc", mode: "like" }
],
//
searchFormItems: [ //
{ field: 'title', title: '标题', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入仓位名称' } } },
{ span: 8, slots: { default: 'date' } }, //
{
align: 'right', span: 4, itemRender: { //
name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } }, //
{ props: { type: 'reset', content: '重置' } }]
}
}
],
//
gridOptions: { //
height: '100%', // 100%
stripe: true, //
id: 'datagrid_1', //
columns: [
{ type: 'checkbox', width: '40' }, //
{ type: 'seq', width: '40' }, //
// "id,optional" validate:"" message:"" label:""` //
// "stock_pos_id,optional" validate:"" message:"" label:""` // ID
// "product_id,optional" validate:"" message:"" label:""` // ID
// "stock,optional" validate:"" message:"" label:""` //
// "out_time,optional" validate:"" message:"" label:""` //
// "out_user_id,optional" validate:"" message:"" label:""` // ID
// "out_user_name,optional" validate:"" message:"" label:""` //
// "bill_date,optional" validate:"" message:"" label:""` //
// "in_type,optional" validate:"" message:"" label:""` //
// "business_type,optional" validate:"" message:"" label:""` //
// "business_no,optional" validate:"" message:"" label:""` //
// "out_type,optional" validate:"" message:"" label:""` //
// "department_id,optional" validate:"" message:"" label:""` // ID
// "salesman_uid,optional" validate:"" message:"" label:""` // ID
// "handler_uid,optional" validate:"" message:"" label:""` // ID
// "handler_name,optional" validate:"" message:"" label:""` //
// "warehouse_keeper_uid,optional" validate:"" message:"" label:""` // ID
// "warehouse_keeper_name,optional" validate:"" message:"" label:""` //
// "check_user_uid,optional" validate:"" message:"" label:""` // id
// "check_user_name,optional" validate:"" message:"" label:""` //
// "check_time,optional" validate:"" message:"" label:""` //
// "delivery_no,optional" validate:"" message:"" label:""` //
// "contact,optional" validate:"" message:"" label:""` //
// "phone,optional" validate:"" message:"" label:""` //
// "remark,optional" validate:"" message:"" label:""` //
// "salesman_name,optional" validate:"" message:"" label:""` //
//
//
//
// =============================== Start ===============================
{ title: '操作', slots: { default: 'op' }, width: 120 },
{ field: 'id' , slots: { default: 'column1' }, sortable: true, title: '查看详情', width: 100 }, //
{ field: 'product_detail.name', sortable: true, title: '料品名称', width: 250 }, //
{ field: 'out_type', sortable: true, title: '出库类型', width: 100 }, //
{ field: 'out_stock', sortable: true, title: '出库数量', width: 100 }, //
{ field: 'stock', sortable: true, title: '剩余库存', width: 100 }, //
{ field: 'warehouse_idetail.name', sortable: true, title: '仓库', width: 150 }, //
{ field: 'warehouse_pos_idetail.name', sortable: true, title: '库位', width: 150 }, //
{ field: 'out_user_name', sortable: true, title: '出库人', width: 100 }, //
{ field: 'bill_date', formatter: 'formatDate',sortable: true, title: '单据日期', width: 100 }, //
{ field: 'business_type', sortable: true, title: '业务类型', width: 100 }, //
{ field: 'business_no', sortable: true, title: '业务单号', width: 100 }, //
{ field: 'out_type', sortable: true, title: '出库类型', width: 100 }, //
{ field: 'handler_name', sortable: true, title: '经手人', width: 100 }, //
{ field: 'check_user_name', sortable: true, title: '验货人', width: 100 }, //
{ field: 'out_time', formatter: 'formatDate', width: 100, sortable: true, title: '出库时间', showHeaderOverflow: true }, //
{ field: 'create_time', formatter: 'formatDate', width: 100, sortable: true, title: '创建时间', showHeaderOverflow: true }, //
{ field: 'update_time', formatter: 'formatDate', width: 100, sortable: true, title: '更新时间', showHeaderOverflow: true }, //
// { field: 'stock_id', sortable: true, title: 'id', width: 250 }, // id
// =============================== Start ===============================
]
}
};
pageData.actions.getList = pageData.actions.ProductStockLogOutList;
pageData.actions.delete = pageData.actions.MesStockPositionBatchDelete;
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); //
this.pageOptions = pageData;
},
loadData(e) {
console.log(e.WarehouseLocation);
e.WarehouseLocation.forEach(item => {
console.log(item.is_default);
if (item.is_default === 1) {
item.__hide_delete = true
}
});
},
//
stockOut(id) {
console.log("stockOut:"+id)
},
//
stockIn(id) {
console.log("stockIn:"+id)
},
},
watch: {
},
};
</script>
<style lang="less" scoped>
.out {
margin-left: 10px;
}
</style>

View File

@ -1,21 +1,13 @@
<template>
<basic-page-list :desc="desc" :options="pageOptions" @loadData="loadData">
<basic-page-list :desc="desc" :options="pageOptions">
<!-- 如果为1-->
<template v-slot:column1="{ row }">
<a-tag v-if="row.is_default === 1" color="orange">
默认
</a-tag>
<a-button class="in" type="primary" @click="stockIn(row.id)">入库</a-button>
<a-button class="out" @click="stockIn(row.id)">出库</a-button>
</template>
<template v-slot:column2="{ row }">
<a-tag v-if="row.warehouse_location_status === 0" color="red">
禁用
</a-tag>
<a-tag v-if="row.warehouse_location_status === 1" color="green">
启用
</a-tag>
</template>
</basic-page-list>
</template>
@ -124,16 +116,14 @@ export default {
// =============================== Start ===============================
{ title: '操作', slots: { default: 'op' }, width: 120 },
{ field: 'product_id', sortable: true, title: '产品ID', width: 250 }, // ID
{ field: 'product_detail.name', sortable: true, title: '产品详情', width: 250 }, //
{ field: 'warehouse_id', sortable: true, title: '仓库ID', width: 250 }, // ID
{ field: 'warehouse_idetail.name', sortable: true, title: '仓库名称', width: 250 }, //
{ field: 'warehouse_pos_id', sortable: true, title: '库位ID', width: 250 }, // ID
{ field: 'warehouse_pos_idetail.name', sortable: true, title: '库位名称', width: 250 }, //
{ field: 'stock', sortable: true, title: '库存数量', width: 250 }, //
{ field: 'warehouse_idetail.name', sortable: true, title: '仓库', width: 150 }, //
{ field: 'warehouse_pos_idetail.name', sortable: true, title: '库位', width: 150 }, //
{ field: 'product_detail.name', sortable: true, title: '料品名称', width: 250 }, //
{ field: 'stock', sortable: true, title: '库存数量', width: 100 }, //
{ field: 'create_time', formatter: 'formatDate', width: 100, sortable: true, title: '创建时间', showHeaderOverflow: true }, //
{ field: 'update_time', formatter: 'formatDate', width: 100, sortable: true, title: '更新时间', showHeaderOverflow: true }, //
{ field: 'stock_id', sortable: true, title: '库存id', width: 250 }, // id
{ field: 'id' , slots: { default: 'column1' }, sortable: true, title: '出入库操作', width: 160,fixed:"right" }, //
// { field: 'stock_id', sortable: true, title: 'id', width: 250 }, // id
// =============================== Start ===============================
@ -156,8 +146,17 @@ export default {
item.__hide_delete = true
}
});
}
},
//
stockOut(id) {
console.log("stockOut:"+id)
},
//
stockIn(id) {
console.log("stockIn:"+id)
},
},
watch: {
@ -166,3 +165,8 @@ export default {
};
</script>
<style lang="less" scoped>
.out {
margin-left: 10px;
}
</style>

View File

@ -143,26 +143,25 @@ export default {
items: [
// =============================== Start ===============================
{ field: 'code', title: '编码', span: 12, itemRender: { name: '$input' } },
{ field: 'code', title: '编码', span: 6, itemRender: { name: '$input' } },
//{ field: 'warehouse_title', title: '', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_name', title: '仓库名称', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_title', title: '仓库名称', span: 8, itemRender: { name: '$input' } },
{ field: 'warehouse_code', title: '仓库编码', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_type', title: '仓库类型', span: 12, itemRender: { name: '$select',props:{options:settings.options_warehouse_type} } },
{ field: 'warehouse_name', title: '英文名称', span: 6, itemRender: { name: '$input' } },
{ field: 'warehouse_code', title: '仓库编号', span: 6, itemRender: { name: '$input' } },
{ field: 'warehouse_type', title: '仓库类型', span: 6, itemRender: { name: '$select',props:{options:settings.options_warehouse_type} } },
{ field: 'warehouse_storage_type', title: '存储类型', span: 6, itemRender: { name: '$select',props:{options:settings.options_warehouse_storage_type} } },
{ field: 'warehouse_address', title: '仓库地址', span: 12, itemRender: { name: '$input' } },
//{ field: 'warehouse_uid', title: 'UID', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_uname', title: '仓库负责人姓名', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_mobile', title: '仓库负责人手机号', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_phone', title: '仓库电话', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_remark', title: '仓库备注', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_negative_stock', title: '仓库是否允许负库存', span: 12, itemRender: { name: '$select',props:{options:settings.options_warehouse_negative_stock} } },
{ field: 'warehouse_location', title: '是否启用库位管理', span: 12, itemRender: { name: '$select',props:{options:settings.options_is_open} } },
{ field: 'warehouse_batch', title: '是否启用批次管理', span: 12, itemRender: { name: '$select',props:{options:settings.options_is_open} } },
{ field: 'warehouse_serial', title: '是否启用序列号', span: 12, itemRender: { name: '$select',props:{options:settings.options_is_open} } },
{ field: 'warehouse_storage_type', title: '存储类型', span: 12, itemRender: { name: '$select',props:{options:settings.options_warehouse_storage_type} } },
{ field: 'warehouse_effective_date',dataRule:{type:"timestamp"}, title: '仓库生效日期', span: 12, itemRender: { name: '$input',props:{type:"date"} } },
{ field: 'warehouse_invalid_date', dataRule:{type:"timestamp"},title: '仓库失效日期', span: 12, itemRender: { name: '$input',props:{type:"date"} } },
{ field: 'warehouse_status', title: '仓库状态', span: 12, itemRender: { name: '$select',props:{options:settings.options_is_enabled} } },
{ field: 'warehouse_uid', title: '仓库负责人', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_mobile', title: '仓库负责人手机号', span: 12, itemRender: { name: '$input' } },
{ field: 'warehouse_remark', title: '仓库备注', span: 24, itemRender: { name: '$input' } },
{ field: 'warehouse_status', title: '仓库状态', span: 4, itemRender: { name: '$switch',props:{options:settings.options_is_enabled} } },
{ field: 'warehouse_negative_stock', title: '仓库是否允许负库存', span: 4, itemRender: { name: '$switch',props:{options:settings.options_warehouse_negative_stock} } },
{ field: 'warehouse_location', title: '是否启用库位管理', span: 4, itemRender: { name: '$switch',props:{options:settings.options_is_open} } },
{ field: 'warehouse_batch', title: '是否启用批次管理', span: 4, itemRender: { name: '$switch',props:{options:settings.options_is_open} } },
{ field: 'warehouse_serial', title: '是否启用序列号', span: 4, itemRender: { name: '$switch',props:{options:settings.options_is_open} } },
// =============================== End ===============================
]

View File

@ -77,6 +77,45 @@ routerMap[FunName + 'PositionList']= {
}
};
routerMap[FunName + 'OutList']= {
name: FunTitle,
icon: 'idcard',
path: `/${FunName}/${FunName}OutLogList`,
component: () => import(`@/pages/Middle/Mes/MesStock/MesStock/OutList`),
meta:{
page:{ cacheAble:false}
},
authority: {
permission: [],
}
};
routerMap[FunName + 'InList']= {
name: FunTitle,
icon: 'idcard',
path: `/${FunName}/${FunName}InLogList`,
component: () => import(`@/pages/Middle/Mes/MesStock/MesStock/InList`),
meta:{
page:{ cacheAble:false}
},
authority: {
permission: [],
}
};
routerMap[FunName + 'LogDetail']= {
name: FunTitle,
icon: 'idcard',
path: `/${FunName}/${FunName}LogDetail`,
component: () => import(`@/pages/Middle/Mes/MesStock/MesStock/LogDetail`),
meta:{
invisible: true,
page:{ cacheAble:false}
},
authority: {
permission: [],
}
};
InvisibleRouters.forEach(item => {
let name = FunName + item;