pull/1/head
lixuan 2 years ago
parent 07be5d5e0d
commit af7ef4eae9
  1. 29
      src/api/product.js
  2. 378
      src/views/order/index.vue
  3. 70
      src/views/product/components/create.vue

@ -32,6 +32,31 @@ const modifyPrice = (params) => {
params
);
};
// 搜索客户
const getRefineryCompanyList = (params) => {
return request.postJson("/oil-user/oilCompanyInfo/getLikeByCompanyType", params);
};
// 下单
const orderSave = (params) => {
return request.postJson(
"/oil_refinery/xoilRefineryOrder/save",
params
);
};
//查看企业产品
const getRefineryProductList = (params) => {
return request.postJson(
"/oil-refinery/oilRefineryProduct/getRefineryProductList",
params
);
};
//查看炼厂信息
const findByEntity = (params) => {
return request.postJson(
"/oil-refinery/xoilRefineryInfo/findByEntity",
params
);
};
export default {
getByPage,
@ -40,4 +65,8 @@ export default {
getByPageRecord,
updateBatchEnable,
modifyPrice,
getRefineryCompanyList,
orderSave,
getRefineryProductList,
findByEntity
};

@ -1,7 +1,379 @@
<template></template>
<template>
<div class="order">
<div class="frame">
<el-select style="margin-right: 20px;" v-model="parameter.params.id" placeholder="用户名称" clearable>
<el-option
v-for="item in refineryList"
:key="item.id"
:label="item.refineryName"
:value="item.id"
>
</el-option>
</el-select>
<el-select v-model="parameter.params.id" placeholder="炼厂名称" clearable>
<el-option
v-for="item in refineryList"
:key="item.id"
:label="item.refineryName"
:value="item.id"
>
</el-option>
</el-select>
<el-select v-model="parameter.params.id" placeholder="产品名称" clearable>
<el-option
v-for="item in refineryList"
:key="item.id"
:label="item.refineryName"
:value="item.id"
>
</el-option>
</el-select>
<div class="buttons">
<el-button icon="el-icon-search" @click="handleCurrentChange(1)"
>查询</el-button
>
<el-button icon="el-icon-refresh" @click="reset">重置</el-button>
</div>
</div>
<div class="table">
<div class="operation">
<!-- <el-button icon="el-icon-upload2" @click="addition">炼厂入驻</el-button> -->
</div>
<el-table
v-if="tableHeight"
ref="multipleTable"
:height="tableHeight"
:data="tableData"
style="width: 100%"
>
<el-table-column
prop="refineryName"
label="用户名称"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="refineryName"
label="炼厂名称"
show-overflow-tooltip
>
</el-table-column>
<el-table-column prop="orderSerialNumber" label="产品名称" width="90">
<template slot-scope="{ row }">
{{
refineryTypeEnum.find((item) => item.value === row.refineryType)
.label
}}
</template>
</el-table-column>
<el-table-column prop="refineryLevel" label="价格" width="90">
</el-table-column>
<el-table-column prop="address" label="支付状态" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="orderSerialNumber" label="订单状态" width="80">
<template slot-scope="{ row }">
<el-switch
v-model="row.enableMark"
active-value="ENABLE"
inactive-value="DISABLE"
active-color="#13ce66"
inactive-color="#ff4949"
@change="
(val) => {
switchTrigger(val, row);
}
"
>
</el-switch>
</template>
</el-table-column>
<el-table-column
prop="orderSerialNumber"
label="价格"
width="120"
>
</el-table-column>
<el-table-column
prop="orderSerialNumber"
label="价格"
width="120"
>
</el-table-column>
<el-table-column label="时间" width="235">
<template slot-scope="{ row }">
<p class="gray">
创建时间 <span>{{ row.createTime }}</span>
</p>
<p class="gray">
更新时间 <span>{{ row.updateTime || " - -" }}</span>
</p>
</template>
</el-table-column>
<el-table-column prop="orderSerialNumber" label="操作" width="250">
<template slot-scope="{ row }">
<el-link type="primary" :underline="false" @click="detail(row)"
>详情</el-link
>
<el-link type="primary" :underline="false" @click="billOfLading(row)"
>提货单</el-link
>
<el-popconfirm
title="是否确认订单?"
icon-color="red"
@confirm="deleteRow(row)"
>
<el-link slot="reference" type="primary" :underline="false"
>订单确认</el-link
>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="parameter.currentPage"
:page-size="parameter.pageSize"
:popper-append-to-body="false"
:page-sizes="[10, 20, 30, 50]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
<el-drawer
title="详情"
direction="ltr"
size="60%"
:withHeader="false"
:visible="controlWindows.detail"
>
<general-details
title="详情"
:isHeader="true"
v-if="controlWindows.detail"
:sourceData="oilCompanyMatch"
:mappingData="mappingData"
@close="controlWindows.detail = false"
>
</general-details>
</el-drawer>
</div>
</template>
<script>
export default {};
import serve from "api/refineryInfo.js";
import generalDetails from "components/generalDetails/index.vue";
export default {
data() {
return {
controlWindows: {
add: false,
addInfo: {
title: "炼厂入驻",
},
detail: false,
},
refineryTypeEnum: [
{
label: "普通炼厂",
value: "COMMON",
},
],
refineryList: [],
tableHeight: 0,
tableData: [],
total: 0,
parameter: {
currentPage: 1,
pageSize: 10,
params: {},
},
oilCompanyMatch: {},
mappingData: [
{
carTitle: "",
carItems: [
{ label: "炼厂名称", value: "refineryName" },
{ label: "炼厂类型", value: "refineryType" },
{ label: "启用状态", value: "enableMark" },
{ label: "炼厂等级", value: "refineryLevel" },
{ label: "炼厂地址", value: "address" },
{ label: "创建用户ID", value: "createUser" },
{ label: "创建时间", value: "createTime" },
{ label: "修改用户ID", value: "updateUser" },
{ label: "修改时间", value: "updateTime" },
],
},
],
};
},
components: {
generalDetails,
},
mounted() {
this.$nextTick(() => {
this.heightHandle();
});
window.addEventListener(
"resize",
this.$utils.debounce(this.heightHandle, 500)
);
},
created() {
this.findByEntity();
this.getByPage();
},
methods: {
// currentPage change
handleCurrentChange(page) {
this.parameter.currentPage = page;
this.getByPage();
},
// pageSize change
handleSizeChange(size) {
this.parameter.currentPage = 1;
this.parameter.pageSize = size;
this.getByPage();
},
//table list
getByPage() {
serve.getByPage(this.parameter).then((res) => {
this.tableData = res.data.list;
this.total = res.data.totalPage;
});
},
//list
findByEntity() {
serve.findByEntity().then((res) => {
this.refineryList = res.data;
});
},
//
addition() {
this.controlWindows.addInfo.title = "炼厂入驻";
this.controlWindows.add = true;
},
//
update(row) {
this.controlWindows.addInfo.title = "炼厂修改";
Object.assign(this.controlWindows.addInfo, row);
this.controlWindows.add = true;
},
//
billOfLading(){
},
//
detail(row) {
this.oilCompanyMatch = row;
this.controlWindows.detail = true;
},
//
deleteRow(row) {
serve
.deleteRow({
id: row.id,
})
.then((res) => {
this.$message.success(res.msg);
this.getByPage();
});
},
//
switchTrigger(val, row) {
row.enableMark = row.enableMark;
serve
.update({
id: row.id,
enableMark: val,
})
.then((res) => {
if (res.code === 20000) {
this.getByPage();
} else this.$message.error(res.msg);
});
},
//
reset() {
this.parameter = {
currentPage: 1,
pageSize: 10,
params: {},
};
},
// table height
heightHandle() {
let bodyHeight = document.body.clientHeight;
let frameHeight = this.obtainElement(".frame").clientHeight;
let operationHeight = this.obtainElement(".operation").clientHeight;
let paginationHeight = this.obtainElement(".el-pagination").clientHeight;
this.tableHeight =
bodyHeight - frameHeight - operationHeight - paginationHeight - 145;
},
obtainElement(className) {
return document.documentElement.querySelector(className);
},
},
};
</script>
<style></style>
<style lang="scss" scoped>
.order {
.frame {
margin: 20px;
padding: 20px;
// width: 100%;
border-radius: 6px;
border: 1px solid #e3e3e5;
background: #fff;
.el-input,
.el-select {
width: 183px;
height: 40px;
}
.el-input + .el-input,
.el-input + .el-select,
.el-select + .el-select,
.el-select + .el-input {
margin-right: 20px;
margin-bottom: 15px;
}
.mr20 {
margin-right: 20px;
}
.buttons {
text-align: right;
}
}
.table {
overflow: hidden;
margin: 0 20px;
padding-bottom: 20px;
background: #fff;
border-radius: 6px;
border: 1px solid #e3e3e5;
> .operation {
box-sizing: content-box;
// padding: 15px;
}
.gray {
color: #999;
span {
color: #333;
}
}
.el-table {
margin-bottom: 20px;
border-radius: 10px 10px 0px 0px;
}
.el-link {
margin-right: 10px;
}
}
}
</style>

@ -10,14 +10,22 @@
<div class="create">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="客户名称" prop="productName">
<el-input
<el-select v-model="form.customId" reserve-keyword remote :remote-method="customData" filterable placeholder="请选择客户">
<el-option
v-for="(item, index) in customList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<!-- <el-input
maxlength="50"
v-model="form.productName"
placeholder="请输入客户名称"
></el-input>
></el-input> -->
</el-form-item>
<el-form-item label="炼厂名称" prop="refineryId">
<el-select v-model="form.refineryId" placeholder="请选择炼厂">
<el-select v-model="form.refineryId" filterable reserve-keyword remote :remote-method="refineryData" placeholder="请选择炼厂">
<el-option
v-for="(item, index) in refineryList"
:key="index"
@ -27,7 +35,7 @@
</el-select>
</el-form-item>
<el-form-item label="产品类型" prop="productType">
<el-select v-model="form.productType" placeholder="请选择产品类型">
<el-select v-model="form.productType" filterable reserve-keyword remote :remote-method="productData" placeholder="请选择产品类型">
<el-option
v-for="(item, index) in productTypeList"
:key="index"
@ -36,29 +44,36 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="产品名称" prop="productName">
<el-form-item label="产品名称">
<el-input
maxlength="50"
v-model="form.productName"
placeholder="请输入产品名称"
></el-input>
</el-form-item>
<el-form-item label="销售价" prop="productName">
<el-form-item label="销售价">
<el-input
maxlength="50"
v-model="form.productName"
v-model="form.salePrice"
placeholder="请输入销售价"
></el-input>
/
</el-form-item>
<el-form-item label="预约提货量" prop="productName">
<el-form-item label="预约提货量">
<el-input
maxlength="50"
v-model="form.productName"
v-model="form.preQuantity"
placeholder="请输入预约提货量"
></el-input>
</el-form-item>
<el-form-item label="订单金额">
<el-input
maxlength="50"
v-model="form.actAmount"
disabled
></el-input>
</el-form-item>
</el-form>
</div>
<div class="buttons">
@ -78,6 +93,7 @@ export default {
},
data() {
return {
customList:[],
form: {},
refineryList: [],
productTypeList: [
@ -115,9 +131,33 @@ export default {
};
},
created() {
this.findByEntity();
// this.findByEntity();
},
methods: {
//
refineryData(value){
if (value) {
serve.findByEntity({refineryName:value}).then((res) => {
this.refineryList = res.data;
});
}
},
//
productData(value){
if (value) {
serve.getRefineryProductList({productType:value}).then((res) => {
this.customList = res.data;
});
}
},
//
customData(value){
if (value) {
serve.getRefineryCompanyList({name:value}).then((res) => {
this.customList = res.data;
});
}
},
openDrawer() {},
submit() {
this.$refs["form"].validate((valid) => {
@ -137,11 +177,11 @@ export default {
else return serve.save(form);
},
//list
findByEntity() {
refineryServe.findByEntity().then((res) => {
this.refineryList = res.data;
});
},
// findByEntity() {
// refineryServe.findByEntity().then((res) => {
// this.refineryList = res.data;
// });
// },
closeWindow() {
this.$emit("closeWindow");
this.form = {};

Loading…
Cancel
Save