9 Commits

Author SHA1 Message Date
caolc
38fd12cb33 121 2023-04-04 15:13:04 +08:00
caolc
f56dc7bde9 提货单信息 2023-04-04 11:16:18 +08:00
caolc
865abd6b3e 12312 2023-04-04 10:41:50 +08:00
xiaozhiyong
704f3f56d9 更新 2023-04-03 16:29:48 +08:00
xiaozhiyong
5f73c912e1 更新 2023-04-03 16:24:29 +08:00
xiaozhiyong
8d4e877949 更新 2023-03-17 15:56:18 +08:00
xiaozhiyong
69ec812147 Merge branch 'master' of http://121.196.213.68:3000/xiaozhiyong/refinery-admin 2023-03-17 15:21:29 +08:00
xiaozhiyong
402316d8af 更新 2023-03-17 15:21:11 +08:00
367204d3c6 Merge pull request 'xiugai' (#8) from lixuan into master
Reviewed-on: #8
2023-03-17 06:13:00 +00:00
6 changed files with 140 additions and 164 deletions

View File

@@ -34,14 +34,14 @@ const modifyPrice = (params) => {
};
// 搜索客户
const getRefineryCompanyList = (params) => {
return request.postJson("/oil-user/oilCompanyInfo/getLikeByCompanyType", params);
return request.postJson(
"/oil-user/oilCompanyInfo/getLikeByCompanyType",
params
);
};
// 下单
const orderSave = (params) => {
return request.postJson(
"/oil-refinery/xoilRefineryOrder/save",
params
);
return request.postJson("/oil-refinery/xoilRefineryOrder/save", params);
};
//查看企业产品
const getRefineryProductList = (params) => {
@@ -50,13 +50,13 @@ const getRefineryProductList = (params) => {
params
);
};
//查看炼厂信息
const findByEntity = (params) => {
return request.postJson(
"/oil-refinery/xoilRefineryInfo/findByEntity",
params
);
};
// //查看炼厂信息
// const findByEntity = (params) => {
// return request.postJson(
// "/oil-refinery/xoilRefineryInfo/findByEntity",
// params
// );
// };
export default {
getByPage,
@@ -68,5 +68,5 @@ export default {
getRefineryCompanyList,
orderSave,
getRefineryProductList,
findByEntity
// findByEntity
};

View File

@@ -110,7 +110,7 @@
<el-dialog :close-on-click-modal="false" :append-to-body="true" title="提货单信息" width="400px" :visible.sync="dialogBillAdd">
<el-form v-if="dialogBillAdd" :model="billAddData" ref="form" :rules="rules">
<el-form-item label="预约提货量" prop="preDeliveryQuantity">
<el-input v-model="billAddData.preDeliveryQuantity"></el-input>/
<el-input v-model="billAddData.preDeliveryQuantity"></el-input>
</el-form-item>
<el-form-item label="提货人" prop="driverName">
<el-input v-model="billAddData.driverName"></el-input>

View File

@@ -21,8 +21,8 @@
<el-option
v-for="(item, index) in productTypeList"
:key="index"
:label="item.label"
:value="item.value"
:label="item"
:value="item"
></el-option>
</el-select>
</el-form-item>
@@ -115,7 +115,7 @@ export default {
};
return {
form: {
measurement:'吨'
measurement: "吨",
},
refineryList: [],
configAutocomplete: {
@@ -131,24 +131,7 @@ export default {
echoId: "",
echoName: "",
},
productTypeList: [
{
label: "0#柴",
value: "0#柴",
},
{
label: "-10#柴",
value: "-10#柴",
},
{
label: "92#汽",
value: "92#汽",
},
{
label: "95#汽",
value: "95#汽",
},
],
productTypeList: ["0#柴", "-10#柴", "92#汽", "95#汽"],
rules: {
productName: [
{ required: true, message: "请输入产品名称", trigger: "blur" },
@@ -211,7 +194,7 @@ export default {
closeWindow() {
this.$emit("closeWindow");
this.form = {};
this.form.measurement = '吨'
this.form.measurement = "吨";
this.controlWindows.addInfo = {};
this.$nextTick(() => {
this.$refs.autocomplete.list = [];

View File

@@ -10,7 +10,14 @@
<div class="create" v-if="controlWindows.create">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="客户名称" prop="customerId">
<el-select v-model="form.customerId" reserve-keyword remote :remote-method="customData" filterable placeholder="请选择客户">
<el-select
v-model="form.customerId"
reserve-keyword
remote
:remote-method="customData"
filterable
placeholder="请选择客户"
>
<el-option
v-for="(item, index) in customList"
:key="index"
@@ -38,17 +45,26 @@
</el-form-item>
<el-form-item label="产品类型" prop="productType">
<!-- <autocomplete :params="form" :config="configAutocompleteCp" /> -->
<el-select v-model="form.productType" @change="productChange" placeholder="请选择产品类型">
<el-select
v-model="form.productType"
@change="productChange"
placeholder="请选择产品类型"
>
<el-option
v-for="(item, index) in productTypeList"
:key="index"
:label="item.label"
:value="item.value"
:label="item"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="产品名称" prop="productId">
<el-select :disabled="rowCreate" v-model="form.productId" @change="productDataList" placeholder="请选择产品类型">
<el-select
:disabled="rowCreate"
v-model="form.productId"
@change="productDataList"
placeholder="请选择产品类型"
>
<el-option
v-for="(item, index) in productNameList"
:key="index"
@@ -71,7 +87,7 @@
></el-input>
/
</el-form-item>
<el-form-item label="预约提货量">
<el-form-item prop="preQuantity" label="预约提货量">
<el-input
maxlength="50"
v-model="form.preQuantity"
@@ -80,11 +96,7 @@
</el-form-item>
<el-form-item label="订单金额">
<el-input
maxlength="50"
v-model="form.preAmount"
disabled
></el-input>
<el-input maxlength="50" v-model="form.preAmount" disabled></el-input>
</el-form-item>
</el-form>
@@ -98,6 +110,7 @@
<script>
import serve from "api/product.js";
import refineryInfoServe from "api/refineryInfo.js";
import autocomplete from "components/autocomplete/index.vue";
export default {
@@ -108,38 +121,61 @@ export default {
controlWindows: Object,
// refineryTypeEnum: Array,
},
watch:{
watch: {
"form.salePrice": {
handler(n, o) {
if(n){
this.form.preAmount = (this.form.salePrice*(this.form.preQuantity?this.form.preQuantity:0)).toFixed(2)
if (n) {
this.form.preAmount = (
this.form.salePrice *
(this.form.preQuantity ? this.form.preQuantity : 0)
).toFixed(2);
}
},
},
"form.productId": {
handler(n, o) {
if (n) {
}
},
},
"form.preQuantity": {
handler(n, o) {
if(n){
this.form.preAmount = (this.form.preQuantity*(this.form.salePrice?this.form.salePrice:0)).toFixed(2)
if (n) {
this.form.preAmount = (
this.form.preQuantity *
(this.form.salePrice ? this.form.salePrice : 0)
).toFixed(2);
}
},
}
},
},
data() {
let validatorRefineryId = (rule, value, callback) => {
if (this.form.refineryId) callback();
else callback("请选择炼厂");
};
var validatePass = (rule, value, callback) => {
if (value==''||Number(value)<=0) {
callback(new Error('预约提货量不能为空或零'));
} else {
callback();
}
};
return {
customList:[],
customList: [],
form: {
preAmount:0
preAmount: 0,
},
productNameList:[],
productNameList: [],
refineryList: [],
productRowData:{},
productRowData: {},
configAutocomplete: {
serveTarget: serve.findByEntity,
autocompleteKey: "refineryName",
serveTarget: refineryInfoServe.findByEntity,
autocompleteKey: {
key: "refineryName",
enableMark: "ENABLE",
},
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
@@ -147,25 +183,8 @@ export default {
echoId: "",
echoName: "",
},
rowCreate:false,
productTypeList: [
{
label: "0#柴",
value: "0#",
},
{
label: "-10#柴",
value: "-10#",
},
{
label: "92#汽",
value: "92#",
},
{
label: "95#汽",
value: "95#",
},
],
rowCreate: false,
productTypeList: ["0#柴", "-10#柴", "92#汽", "95#汽"],
rules: {
customerId: [
{ required: true, message: "请输入客户名称", trigger: "blur" },
@@ -179,6 +198,9 @@ export default {
enableMark: [
{ required: true, message: "请选择启用状态", trigger: "change" },
],
preQuantity:[
{ required: true, validator:validatePass, trigger: "blur" }
],
productType: [
{ required: true, message: "请选择产品类型", trigger: "change" },
],
@@ -186,76 +208,64 @@ export default {
};
},
methods: {
productDataList(e){
console.log(e,'ppppppppppppppp')
this.productRowData = this.productNameList.filter(
(item) => item.id == e
);
this.form.salePrice = this.productRowData[0].salePrice2company
this.form.floorPrice = this.productRowData[0].floorPrice
},
productChange(){
this.productData()
},
//搜索炼厂
refineryData(value){
if (value) {
serve.findByEntity({refineryName:value}).then((res) => {
this.refineryList = res.data;
});
this.productData()
}
},
//搜索产品
async productData(){
let data = {
refineryId:this.form.refineryId,
productType:this.form.productType,
enableMark:'ENABLE'
}
await serve.getRefineryProductList(data).then((res) => {
if(res.data.length>0){
this.productNameList = res.data;
}else{
this.productNameList = []
this.form.productId = ''
}
})
// this.form.productId = this.productNameList[0].productId
console.log(this.productRowData,this.productNameList,'aaaaaaaaaa')
},
//搜索客户
customData(value){
if (value) {
serve.getRefineryCompanyList({name:value}).then((res) => {
this.customList = res.data;
});
}
},
openDrawer() {
this.form = {}
this.form = {};
let { id } = this.controlWindows.addInfo;
if (id) {
//回显
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
this.configAutocomplete.echoId = id;
this.configAutocomplete.echoName = this.form.refineryName;
this.form.salePrice = this.form.salePrice2company
this.form.productId = this.form.id
delete this.form.id
this.rowCreate = true
this.productChange()
console.log("this.form", this.form);
}else{
this.rowCreate = false
this.form.salePrice = this.form.salePrice2company;
this.form.productId = this.form.id;
// delete this.form.id;
this.rowCreate = true;
this.productChange();
} else {
this.rowCreate = false;
}
},
productDataList(e) {
console.log(e,'******************')
this.productRowData = this.productNameList.filter((item) => item.id == e);
this.form.salePrice = this.productRowData[0].salePrice2company;
this.form.floorPrice = this.productRowData[0].floorPrice;
},
productChange() {
this.productData();
},
//搜索产品
async productData() {
let data = {
refineryId: this.form.refineryId,
productType: this.form.productType,
enableMark: "ENABLE",
};
await serve.getRefineryProductList(data).then((res) => {
if (res.data.length > 0) {
this.productNameList = res.data;
} else {
this.productNameList = [];
this.form.productId = "";
}
});
// this.form.productId = this.productNameList[0].productId
},
//搜索客户
customData(value) {
if (value) {
serve.getRefineryCompanyList({ name: value }).then((res) => {
this.customList = res.data;
});
}
},
submit() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.productMeasurement = this.productRowData[0].measurement
this.productDataList(this.form.productId);
this.form.productMeasurement = this.productRowData[0].measurement;
delete this.form.id;
this.judgeInterface(this.form).then((res) => {
if (res.code === 20000) {
this.$message.success(res.msg);
@@ -274,10 +284,10 @@ export default {
closeWindow() {
this.$emit("closeWindow");
this.form = {};
this.customList = []
this.customList = [];
this.controlWindows.addInfo = {};
this.configAutocomplete = {}
this.productNameList = []
// this.configAutocomplete = {};
this.productNameList = [];
this.$refs.form.clearValidate();
this.controlWindows.create = false;
},

View File

@@ -15,8 +15,8 @@
<el-option
v-for="(item, index) in productTypeList"
:key="index"
:label="item.label"
:value="item.value"
:label="item"
:value="item"
>
</el-option>
</el-select>
@@ -174,7 +174,7 @@
<!--新增产品 -->
<add :controlWindows="controlWindows" @closeWindow="search" />
<!-- 下单 -->
<create :controlWindows="controlWindows" @closeWindow="search" />
<create :controlWindows="controlWindows" @closeWindow="search" />
<!-- 调价记录 -->
<record :controlWindows="controlWindows" />
<!-- 批量 -->
@@ -257,28 +257,11 @@ export default {
batch: false,
adjust: false,
},
productTypeList: [
{
label: "0#柴",
value: "0#",
},
{
label: "-10#柴",
value: "-10#",
},
{
label: "92#汽",
value: "92#",
},
{
label: "95#汽",
value: "95#",
},
],
productTypeList: ["0#柴", "-10#柴", "92#汽", "95#汽"],
configAutocomplete: {
serveTarget: serve.findByEntity,
serveTarget: refineryInfoServe.findByEntity,
autocompleteKey: "refineryName",
valueKey: "refineryName",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",

View File

@@ -110,7 +110,7 @@
<el-dialog :close-on-click-modal="false" :append-to-body="true" title="提货单信息" width="400px" :visible.sync="dialogBillAdd">
<el-form v-if="dialogBillAdd" :model="billAddData" ref="form" :rules="rules">
<el-form-item label="预约提货量" prop="preDeliveryQuantity">
<el-input v-model="billAddData.preDeliveryQuantity"></el-input>/
<el-input v-model="billAddData.preDeliveryQuantity"></el-input>
</el-form-item>
<el-form-item label="提货人" prop="driverName">
<el-input v-model="billAddData.driverName"></el-input>