diff --git a/src/views/product/components/add.vue b/src/views/product/components/add.vue
index 2e92ad8..b143d78 100644
--- a/src/views/product/components/add.vue
+++ b/src/views/product/components/add.vue
@@ -21,8 +21,8 @@
@@ -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 = [];
diff --git a/src/views/product/components/create.vue b/src/views/product/components/create.vue
index bcb5ac2..8f66aa1 100644
--- a/src/views/product/components/create.vue
+++ b/src/views/product/components/create.vue
@@ -10,7 +10,14 @@
-
+
-
+
-
+
-
+
元
@@ -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;
},
diff --git a/src/views/product/index.vue b/src/views/product/index.vue
index 8ffc2d1..aeccbee 100644
--- a/src/views/product/index.vue
+++ b/src/views/product/index.vue
@@ -15,8 +15,8 @@
@@ -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",