-
+
-
+
元 /
字(篇/页)
@@ -28,8 +29,10 @@
-
+
@@ -39,8 +42,13 @@
-
-
+
+
+
+
+
+
{{ type2name[scope.row.type] }}
@@ -59,8 +67,13 @@
-
-
+
+
+
+
+
+
{{ type2name[scope.row.type] }}
@@ -132,7 +145,8 @@ export default {
},
data() {
return {
- chktype:0,
+ id: 0,
+ chktype: 0,
currentPage: 1, //当前页
pageSize: 5, //每页的容量
total: 0, //列表总数
@@ -188,6 +202,9 @@ export default {
this.getStagePurchase()
}
},
+ changeSelectType() {
+ this.init()
+ },
getPurchase() {
const that = this
that.tableData = []
@@ -240,12 +257,12 @@ export default {
handleConfirm() {
console.log('提交成功:', this.form);
const that = this
- if(!that.form.type){
+ if (!that.form.type) {
this.$message.warning('请选择检测类型');
return
}
- if(that.type == 'purchase'){
- if(!that.form.unit_price || !that.form.unit_num){
+ if (that.type == 'purchase') {
+ if (!that.form.unit_price || !that.form.unit_num) {
this.$message.warning('请输入采购单价');
return
}
@@ -256,7 +273,7 @@ export default {
unit_num: that.form.unit_num,
}).then(response => {
this.$nextTick(() => {
- if(!response.status){
+ if (!response.status) {
this.$message.warning(response.info);
}
this.dialogVisible = false;
@@ -265,13 +282,13 @@ export default {
this.$message.warning(error);
this.dialogVisible = false;
})
- }else{
- if((!that.form.unit_price || !that.form.unit_num) && !that.form.cost){
+ } else {
+ if ((!that.form.unit_price || !that.form.unit_num) && !that.form.cost) {
this.$message.warning('请输入采购单价或阶段成本');
return
}
- if(!that.form.sdate || !that.form.edate){
+ if (!that.form.sdate || !that.form.edate) {
this.$message.warning('请选择起止日期');
return
}
@@ -285,7 +302,7 @@ export default {
edate: that.form.edate,
}).then(response => {
this.$nextTick(() => {
- if(!response.status){
+ if (!response.status) {
this.$message.warning(response.info);
}
this.dialogVisible = false;
@@ -316,14 +333,16 @@ export default {
const D = pad(date.getDate());
return `${Y}-${M}-${D}`;
},
- editPurchase(row){
+ editPurchase(row) {
+ this.form.id = row.id
this.form.type = row.type
this.form.typename = this.type2name[row.type]
this.form.unit_price = row.unit_price
this.form.unit_num = row.unit_num
this.dialogVisible = true;
},
- editStagePurchase(row){
+ editStagePurchase(row) {
+ this.form.id = row.id
this.form.type = row.type
this.form.typename = this.type2name[row.type]
this.form.unit_price = row.unit_price
@@ -334,4 +353,7 @@ export default {
}
\ No newline at end of file