更新
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
@@ -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"
|
||||
@@ -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>
|
||||
@@ -108,21 +120,27 @@ 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.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) => {
|
||||
@@ -130,13 +148,13 @@ export default {
|
||||
else callback("请选择炼厂");
|
||||
};
|
||||
return {
|
||||
customList:[],
|
||||
customList: [],
|
||||
form: {
|
||||
preAmount:0
|
||||
preAmount: 0,
|
||||
},
|
||||
productNameList:[],
|
||||
productNameList: [],
|
||||
refineryList: [],
|
||||
productRowData:{},
|
||||
productRowData: {},
|
||||
configAutocomplete: {
|
||||
serveTarget: serve.findByEntity,
|
||||
autocompleteKey: "refineryName",
|
||||
@@ -147,25 +165,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" },
|
||||
@@ -186,76 +187,73 @@ 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
|
||||
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()
|
||||
productChange() {
|
||||
this.productData();
|
||||
},
|
||||
//搜索炼厂
|
||||
refineryData(value){
|
||||
refineryData(value) {
|
||||
if (value) {
|
||||
serve.findByEntity({refineryName:value}).then((res) => {
|
||||
serve.findByEntity({ refineryName: value }).then((res) => {
|
||||
this.refineryList = res.data;
|
||||
});
|
||||
this.productData()
|
||||
this.productData();
|
||||
}
|
||||
},
|
||||
//搜索产品
|
||||
async productData(){
|
||||
async productData() {
|
||||
let data = {
|
||||
refineryId:this.form.refineryId,
|
||||
productType:this.form.productType,
|
||||
enableMark:'ENABLE'
|
||||
}
|
||||
refineryId: this.form.refineryId,
|
||||
productType: this.form.productType,
|
||||
enableMark: "ENABLE",
|
||||
};
|
||||
await serve.getRefineryProductList(data).then((res) => {
|
||||
if(res.data.length>0){
|
||||
if (res.data.length > 0) {
|
||||
this.productNameList = res.data;
|
||||
}else{
|
||||
this.productNameList = []
|
||||
this.form.productId = ''
|
||||
} else {
|
||||
this.productNameList = [];
|
||||
this.form.productId = "";
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
// this.form.productId = this.productNameList[0].productId
|
||||
console.log(this.productRowData,this.productNameList,'aaaaaaaaaa')
|
||||
console.log(this.productRowData, this.productNameList, "aaaaaaaaaa");
|
||||
},
|
||||
//搜索客户
|
||||
customData(value){
|
||||
customData(value) {
|
||||
if (value) {
|
||||
serve.getRefineryCompanyList({name:value}).then((res) => {
|
||||
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()
|
||||
|
||||
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
|
||||
} else {
|
||||
this.rowCreate = false;
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.productMeasurement = this.productRowData[0].measurement
|
||||
this.form.productMeasurement = this.productRowData[0].measurement;
|
||||
this.judgeInterface(this.form).then((res) => {
|
||||
if (res.code === 20000) {
|
||||
this.$message.success(res.msg);
|
||||
@@ -268,16 +266,16 @@ export default {
|
||||
judgeInterface(form) {
|
||||
// let { id } = this.controlWindows.addInfo;
|
||||
// if (id) return serve.update(form);
|
||||
// else
|
||||
// else
|
||||
return serve.orderSave(form);
|
||||
},
|
||||
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;
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
@@ -257,24 +257,7 @@ 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,
|
||||
autocompleteKey: "refineryName",
|
||||
|
||||
Reference in New Issue
Block a user