fix:客户管理增加“产品清单”和“销售记录”功能
This commit is contained in:
parent
5527834271
commit
8ce9df6eb6
@ -50,3 +50,19 @@ export function execute(salseId) {
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据客户 id 查询销售产品信息
|
||||
export function getItem(clientId) {
|
||||
return request({
|
||||
url: '/mes/wm/productsalse/getItem/' + clientId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据客户 id 查询销售订单信息
|
||||
export function getSaleRecord(clientId) {
|
||||
return request({
|
||||
url: '/mes/wm/productsalse/getSaleRecord/' + clientId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
63
src/views/mes/md/client/components/item.vue
Normal file
63
src/views/mes/md/client/components/item.vue
Normal file
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-table v-loading="loading" :data="itemList">
|
||||
<el-table-column label="物料编码" align="center" width="120px" prop="itemCode" />
|
||||
<el-table-column label="物料名称" align="center" prop="itemName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="specification" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||
<el-table-column label="入库数量" align="center" prop="quantityRecived" />
|
||||
<el-table-column label="批次号" align="center" prop="batchCode" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getItem} from "@/api/mes/wm/productsalse";
|
||||
|
||||
export default {
|
||||
name: "Bom",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 产品BOM关系表格数据
|
||||
itemList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
||||
},
|
||||
props: {
|
||||
optType: undefined,
|
||||
clientId: undefined
|
||||
},
|
||||
created() {
|
||||
this.getList(this.clientId);
|
||||
},
|
||||
methods: {
|
||||
handleOpen(vendorId) {
|
||||
this.getList(vendorId)
|
||||
},
|
||||
/** 获取表格数据 */
|
||||
getList(clientId) {
|
||||
this.loading = true;
|
||||
getItem(clientId).then(response => {
|
||||
this.itemList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
67
src/views/mes/md/client/components/salesRecord.vue
Normal file
67
src/views/mes/md/client/components/salesRecord.vue
Normal file
@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-table v-loading="loading" :data="recordList">
|
||||
<el-table-column label="出库单编号" align="center" prop="salseCode" width="120px" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="出库单名称" align="center" prop="salseName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="销售订单编号" align="center" prop="soCode" />
|
||||
<el-table-column label="出库日期" align="center" prop="salseDate" width="120px" />
|
||||
<el-table-column label="产品编码" align="center" prop="itemCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="产品名称" align="center" prop="itemName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="规格型号" align="center" prop="specification" />
|
||||
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||
<el-table-column label="出库数量" align="center" prop="quantitySalse" />
|
||||
<el-table-column label="批次号" align="center" prop="batchCode" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getSaleRecord} from "@/api/mes/wm/productsalse";
|
||||
|
||||
export default {
|
||||
name: "Bom",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 产品BOM关系表格数据
|
||||
recordList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
||||
},
|
||||
props: {
|
||||
optType: undefined,
|
||||
clientId: undefined
|
||||
},
|
||||
created() {
|
||||
this.getList(this.clientId);
|
||||
},
|
||||
methods: {
|
||||
handleOpen(vendorId) {
|
||||
this.getList(vendorId)
|
||||
},
|
||||
/** 获取表格数据 */
|
||||
getList(clientId) {
|
||||
this.loading = true;
|
||||
getSaleRecord(clientId).then(response => {
|
||||
this.recordList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
@ -181,7 +181,7 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" @close="cancel" width="960px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
@ -345,6 +345,14 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-tabs type="border-card" v-model="activeName" v-if="optType != 'add'" @tab-click="handleClick">
|
||||
<el-tab-pane label="产品清单" name="item">
|
||||
<Item ref="itemList" :optType="optType" :clientId="form.clientId"></Item>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="销售记录" name="salesRecord">
|
||||
<SalesRecord ref="salesRecordList" :optType="optType" :clientId="form.clientId"></SalesRecord>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" v-if="optType !='view'">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
@ -389,11 +397,15 @@
|
||||
import { listClient, getClient, delClient, addClient, updateClient } from "@/api/mes/md/client";
|
||||
import {genCode} from "@/api/system/autocode/rule"
|
||||
import { getToken } from "@/utils/auth";
|
||||
import SalesRecord from "@/views/mes/md/client/components/salesRecord.vue";
|
||||
import Item from "@/views/mes/md/client/components/item.vue";
|
||||
export default {
|
||||
name: "Client",
|
||||
components: { Item, SalesRecord },
|
||||
dicts: ['mes_client_type','sys_yes_no'],
|
||||
data() {
|
||||
return {
|
||||
activeName: "item",
|
||||
//自动生成编码
|
||||
autoGenFlag:false,
|
||||
optType: undefined,
|
||||
@ -535,6 +547,18 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleSkip() {
|
||||
this.cancel()
|
||||
this.$router.push("/mes/wm/arrivalnotice")
|
||||
},
|
||||
handleClick(tab) {
|
||||
if (tab.name === 'item') {
|
||||
this.$refs.itemList.handleOpen(this.form.clientId)
|
||||
}
|
||||
if (tab.name === 'salesRecord') {
|
||||
this.$refs.salesRecordList.handleOpen(this.form.clientId)
|
||||
}
|
||||
},
|
||||
/** 查询客户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@ -546,6 +570,7 @@ export default {
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.activeName = "item"
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
|
7
src/views/mes/md/vendor/components/item.vue
vendored
7
src/views/mes/md/vendor/components/item.vue
vendored
@ -12,10 +12,9 @@
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
icon="el-icon-position"
|
||||
@click="handleSkip(scope.row)"
|
||||
v-hasPermi="['mes:md:mditem:edit']"
|
||||
>修改</el-button>
|
||||
>跳转</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -71,7 +70,7 @@ export default {
|
||||
},
|
||||
/** 点击跳转按钮 */
|
||||
handleSkip(row) {
|
||||
console.log(row, '点击跳转按钮');
|
||||
this.$emit('handleSkip', row)
|
||||
},
|
||||
}
|
||||
};
|
||||
|
8
src/views/mes/md/vendor/index.vue
vendored
8
src/views/mes/md/vendor/index.vue
vendored
@ -356,9 +356,9 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||
<el-tabs type="border-card" v-model="activeName" v-if="optType != 'add'" @tab-click="handleClick">
|
||||
<el-tab-pane label="物料清单" name="item">
|
||||
<Item ref="itemList" :optType="optType" :vendorId="form.vendorId"></Item>
|
||||
<Item ref="itemList" @handleSkip="handleSkip" :optType="optType" :vendorId="form.vendorId"></Item>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="采购记录" name="purchase">
|
||||
<Purchase ref="PurchaseList" :optType="optType" :vendorId="form.vendorId"></Purchase>
|
||||
@ -555,6 +555,10 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleSkip() {
|
||||
this.cancel()
|
||||
this.$router.push("/mes/wm/arrivalnotice")
|
||||
},
|
||||
handleClick(tab) {
|
||||
if (tab.name == 'item') {
|
||||
this.$refs.itemList.handleOpen(this.form.vendorId)
|
||||
|
Loading…
Reference in New Issue
Block a user