|
@@ -185,20 +185,18 @@ export default {
|
|
|
components: {},
|
|
|
data: function() {
|
|
|
return {
|
|
|
- // detailForm1: { name: '伟巴斯特(长春)车顶系统有限公司-北京天津线', number: '1234', contract: '合同一', route: '线路一', project: '项目一' },
|
|
|
//合同列表
|
|
|
contractList: [],
|
|
|
//项目列表
|
|
|
projectList: [],
|
|
|
//线路列表
|
|
|
routeList: [],
|
|
|
- detailList: [],
|
|
|
activeName: 'first',
|
|
|
//收入项列表
|
|
|
options: [],
|
|
|
//税率列表
|
|
|
rateList: [],
|
|
|
- listData: [],
|
|
|
+ // listData: [],
|
|
|
//方式列表
|
|
|
wayoptions: [],
|
|
|
cost1: 0,
|
|
@@ -257,10 +255,8 @@ export default {
|
|
|
},
|
|
|
//查项目
|
|
|
async searchProject() {
|
|
|
- // console.log('查项目');
|
|
|
let goods = this.detailForm.goods;
|
|
|
const res = await this.projectQuery({ treaty: this.treatyValue });
|
|
|
- // console.log(res);
|
|
|
if (res.data.length == 0) {
|
|
|
this.projectList = [];
|
|
|
this.routeList = [];
|
|
@@ -284,7 +280,6 @@ export default {
|
|
|
},
|
|
|
//查计费方式列表
|
|
|
async searchWay() {
|
|
|
- // let hh;
|
|
|
let test1 = [];
|
|
|
const res = await this.modeQuery({ route: this.wayValue });
|
|
|
if (res) {
|
|
@@ -297,11 +292,7 @@ export default {
|
|
|
} else {
|
|
|
i.hh = `${i.price}-整车`;
|
|
|
}
|
|
|
- // test1.push(hh);
|
|
|
}
|
|
|
- // let newTest = _.slice(test1, 0, this.wayList.length + 1);
|
|
|
- // this.$set(this, `wayoptions`, newTest);
|
|
|
- // console.log(this.wayList);
|
|
|
}
|
|
|
},
|
|
|
async searchTree() {
|
|
@@ -309,7 +300,6 @@ export default {
|
|
|
const res = await this.tree('sr');
|
|
|
if (res) {
|
|
|
this.$set(this, `options`, res);
|
|
|
- // console.log(this.options);
|
|
|
}
|
|
|
//查其他收费项的税率
|
|
|
const res1 = await this.tree('sl');
|
|
@@ -317,9 +307,6 @@ export default {
|
|
|
this.$set(this, `rateList`, res1);
|
|
|
}
|
|
|
},
|
|
|
- handleChange(value) {
|
|
|
- console.log(value);
|
|
|
- },
|
|
|
//添加收費項目
|
|
|
addGoods() {
|
|
|
this.detailForm.in_bill.push({ taxes: 1 });
|
|
@@ -334,31 +321,24 @@ export default {
|
|
|
//选择货物的计费方式
|
|
|
async change(data, index) {
|
|
|
let priceDate = this.wayList.find(i => i.id === data);
|
|
|
- // console.log(priceDate);
|
|
|
let goods = this.detailForm.goods[index];
|
|
|
let price = priceDate.hh.split('-');
|
|
|
goods.price = price[0];
|
|
|
- // console.log(goods);
|
|
|
let arr = _.split(priceDate.hh, '-', 3);
|
|
|
- // console.log(arr);
|
|
|
if (_.indexOf(arr, '量份') !== -1) {
|
|
|
goods.cvalue = goods.number;
|
|
|
} else if (_.indexOf(arr, '整车') !== -1) {
|
|
|
goods.cvalue = 1;
|
|
|
} else if (_.indexOf(arr, '按体积') !== -1) {
|
|
|
- console.log('按体积');
|
|
|
goods.cvalue = goods.volume;
|
|
|
} else {
|
|
|
- console.log('按重量');
|
|
|
goods.cvalue = goods.weight;
|
|
|
}
|
|
|
goods.sq_ys = _.round(goods.cvalue * goods.price, 2);
|
|
|
goods.sh_ys = _.round(goods.taxes * goods.cvalue * goods.price, 2);
|
|
|
goods.sq_ss = _.round(goods.cvalue * goods.price, 2);
|
|
|
goods.sh_ss = _.round(goods.taxes * goods.cvalue * goods.price, 2);
|
|
|
- // console.log(goods);
|
|
|
this.$set(this.detailForm.goods, index, goods);
|
|
|
-
|
|
|
this.computRate();
|
|
|
},
|
|
|
//計算价格
|
|
@@ -374,10 +354,12 @@ export default {
|
|
|
let goods = this.detailForm.goods; //goods是个数组
|
|
|
let in_bill = this.detailForm.in_bill; //in_bill是个数组
|
|
|
for (let row1 of goods) {
|
|
|
- num1 = _.round(num1 + row1.sq_ys, 2);
|
|
|
- num2 = _.round(num2 + row1.sh_ys, 2);
|
|
|
- num3 = _.round(num3 + row1.sq_ss, 2);
|
|
|
- num4 = _.round(num4 + row1.sh_ss, 2);
|
|
|
+ if (row1.sq_ys) {
|
|
|
+ num1 = _.round(num1 + row1.sq_ys, 2);
|
|
|
+ num2 = _.round(num2 + row1.sh_ys, 2);
|
|
|
+ num3 = _.round(num3 + row1.sq_ss, 2);
|
|
|
+ num4 = _.round(num4 + row1.sh_ss, 2);
|
|
|
+ }
|
|
|
}
|
|
|
for (let val of in_bill) {
|
|
|
num5 = _.round(num5 + Number(val.sq_ys), 2);
|
|
@@ -403,7 +385,6 @@ export default {
|
|
|
},
|
|
|
//税前实收
|
|
|
otherChange(val, index) {
|
|
|
- console.log(val, index);
|
|
|
let bill = this.detailForm.in_bill[index]; //bill是数组
|
|
|
let sh_ss = _.round(bill.sq_ss * bill.taxes, 2);
|
|
|
this.$set(bill, `sh_ss`, sh_ss);
|
|
@@ -414,11 +395,6 @@ export default {
|
|
|
let bill = this.detailForm.in_bill[index]; //bill是数组
|
|
|
this.inputChange(val, index);
|
|
|
},
|
|
|
- //保存
|
|
|
- save() {
|
|
|
- console.log('保存');
|
|
|
- console.log(this.listData);
|
|
|
- },
|
|
|
//返回
|
|
|
toReturn() {
|
|
|
this.$emit('toReturn');
|
|
@@ -456,6 +432,7 @@ export default {
|
|
|
item.mode = '';
|
|
|
}
|
|
|
},
|
|
|
+ //是否有合同
|
|
|
async isTreaty() {
|
|
|
if (this.detailForm.treaty) this.treayChange(this.detailForm.treaty);
|
|
|
if (this.detailForm.item) this.projectChange(this.detailForm.item);
|