|
@@ -29,6 +29,7 @@
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-form-item label="经销商名称" prop="customerId">
|
|
<el-form-item label="经销商名称" prop="customerId">
|
|
<el-select
|
|
<el-select
|
|
|
|
+ :disabled="isDisabled"
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
v-model="searchForm.customerId"
|
|
v-model="searchForm.customerId"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
@@ -443,7 +444,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { mapGetters } from "vuex";
|
|
|
|
|
|
+// import { mapGetters } from "vuex";
|
|
import { getWalletCustomerList } from "@/api/finance/change_apply";
|
|
import { getWalletCustomerList } from "@/api/finance/change_apply";
|
|
import {
|
|
import {
|
|
getStandbookList,
|
|
getStandbookList,
|
|
@@ -475,13 +476,24 @@ export default {
|
|
listLoading: false, // 列表加载loading
|
|
listLoading: false, // 列表加载loading
|
|
|
|
|
|
bill: "COMMONLY",
|
|
bill: "COMMONLY",
|
|
|
|
+ isCustomer: JSON.parse(localStorage.getItem("supply_user")).isCustomer,
|
|
|
|
+ isDisabled: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- ...mapGetters(["customerId"]),
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
created() {
|
|
created() {
|
|
|
|
+ // console.log(
|
|
|
|
+ // this.customerId,
|
|
|
|
+ // this.$store.state.user.customerName,
|
|
|
|
+ // this.$store.state.user.customerNumber,
|
|
|
|
+
|
|
|
|
+ // 777777
|
|
|
|
+ // );
|
|
|
|
+
|
|
if (this.$route.query.customerName && this.$route.query.customerNumber) {
|
|
if (this.$route.query.customerName && this.$route.query.customerNumber) {
|
|
|
|
+ this.isDisabled = true;
|
|
|
|
+ this.searchForm.customerId = this.$route.query.customerName;
|
|
|
|
+ this.changeFn(this.$route.query.customerId);
|
|
this.getDataList({
|
|
this.getDataList({
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
pageNum: this.currentPage,
|
|
pageNum: this.currentPage,
|
|
@@ -489,14 +501,27 @@ export default {
|
|
customerName: this.$route.query.customerName,
|
|
customerName: this.$route.query.customerName,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
});
|
|
});
|
|
|
|
+ } else if (this.isCustomer) {
|
|
|
|
+ this.isDisabled = true;
|
|
|
|
+ this.searchForm.customerId = this.$store.state.user.customerName;
|
|
|
|
+ this.changeFn(this.$store.state.user.customerId);
|
|
|
|
+ this.getDataList({
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ pageNum: this.currentPage,
|
|
|
|
+ type: this.bill,
|
|
|
|
+ customerName: this.$store.state.user.customerName,
|
|
|
|
+ customerNumber: this.$store.state.user.customerNumber,
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
this.getDataList({
|
|
this.getDataList({
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
pageNum: this.currentPage,
|
|
pageNum: this.currentPage,
|
|
type: this.bill,
|
|
type: this.bill,
|
|
});
|
|
});
|
|
|
|
+ this.getCustomerDataList();
|
|
}
|
|
}
|
|
- this.getCustomerDataList();
|
|
|
|
|
|
+
|
|
|
|
+ // this.getCustomerDataList();
|
|
// this.getWalletList();
|
|
// this.getWalletList();
|
|
// this.getDataDict();
|
|
// this.getDataDict();
|
|
},
|
|
},
|
|
@@ -533,7 +558,11 @@ export default {
|
|
//改变经销商
|
|
//改变经销商
|
|
async changeFn(v) {
|
|
async changeFn(v) {
|
|
this.searchForm.customerWalletId = "";
|
|
this.searchForm.customerWalletId = "";
|
|
- let res = await getWalletCustomerList({ customerId: v, type: this.bill });
|
|
|
|
|
|
+ let res = await getWalletCustomerList({
|
|
|
|
+ customerId: v,
|
|
|
|
+ type: this.bill,
|
|
|
|
+ hasRecord: true,
|
|
|
|
+ });
|
|
this.walletList = res.data;
|
|
this.walletList = res.data;
|
|
},
|
|
},
|
|
//获取经销商列表
|
|
//获取经销商列表
|
|
@@ -556,12 +585,22 @@ export default {
|
|
// });
|
|
// });
|
|
if (this.$route.query.customerName && this.$route.query.customerNumber) {
|
|
if (this.$route.query.customerName && this.$route.query.customerNumber) {
|
|
this.getDataList({
|
|
this.getDataList({
|
|
|
|
+ ...this.searchForm,
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
pageNum: this.currentPage,
|
|
pageNum: this.currentPage,
|
|
type: this.bill,
|
|
type: this.bill,
|
|
customerName: this.$route.query.customerName,
|
|
customerName: this.$route.query.customerName,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
});
|
|
});
|
|
|
|
+ } else if (this.isCustomer) {
|
|
|
|
+ this.getDataList({
|
|
|
|
+ ...this.searchForm,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ pageNum: this.currentPage,
|
|
|
|
+ type: this.bill,
|
|
|
|
+ customerName: this.$store.state.user.customerName,
|
|
|
|
+ customerNumber: this.$store.state.user.customerNumber,
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
this.getDataList({
|
|
this.getDataList({
|
|
...this.searchForm,
|
|
...this.searchForm,
|
|
@@ -583,12 +622,22 @@ export default {
|
|
// });
|
|
// });
|
|
if (this.$route.query.customerName && this.$route.query.customerNumber) {
|
|
if (this.$route.query.customerName && this.$route.query.customerNumber) {
|
|
this.getDataList({
|
|
this.getDataList({
|
|
|
|
+ ...this.searchForm,
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
pageNum: this.currentPage,
|
|
pageNum: this.currentPage,
|
|
type: this.bill,
|
|
type: this.bill,
|
|
customerName: this.$route.query.customerName,
|
|
customerName: this.$route.query.customerName,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
});
|
|
});
|
|
|
|
+ } else if (this.isCustomer) {
|
|
|
|
+ this.getDataList({
|
|
|
|
+ ...this.searchForm,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ pageNum: this.currentPage,
|
|
|
|
+ type: this.bill,
|
|
|
|
+ customerName: this.$store.state.user.customerName,
|
|
|
|
+ customerNumber: this.$store.state.user.customerNumber,
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
this.getDataList({
|
|
this.getDataList({
|
|
...this.searchForm,
|
|
...this.searchForm,
|
|
@@ -609,10 +658,17 @@ export default {
|
|
//重置
|
|
//重置
|
|
async resetFn() {
|
|
async resetFn() {
|
|
// this.searchForm.customerId = "";
|
|
// this.searchForm.customerId = "";
|
|
- this.walletList = [];
|
|
|
|
- this.customerName = "";
|
|
|
|
- this.customerNumber = "";
|
|
|
|
- await this.$refs.searchForm.resetFields();
|
|
|
|
|
|
+ // this.walletList = [];
|
|
|
|
+ // this.customerName = "";
|
|
|
|
+ // this.customerNumber = "";
|
|
|
|
+ if (this.isCustomer || this.$route.query.customerId) {
|
|
|
|
+ await this.$refs.searchForm.resetFields();
|
|
|
|
+ } else {
|
|
|
|
+ this.walletList = [];
|
|
|
|
+ this.customerName = "";
|
|
|
|
+ this.customerNumber = "";
|
|
|
|
+ await this.$refs.searchForm.resetFields();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//查询
|
|
//查询
|
|
searchFn() {
|
|
searchFn() {
|
|
@@ -638,6 +694,15 @@ export default {
|
|
customerName: this.$route.query.customerName,
|
|
customerName: this.$route.query.customerName,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
});
|
|
});
|
|
|
|
+ } else if (this.isCustomer) {
|
|
|
|
+ this.getDataList({
|
|
|
|
+ ...this.searchForm,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ pageNum: this.currentPage,
|
|
|
|
+ type: this.bill,
|
|
|
|
+ customerName: this.$store.state.user.customerName,
|
|
|
|
+ customerNumber: this.$store.state.user.customerNumber,
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
this.getDataList({
|
|
this.getDataList({
|
|
...this.searchForm,
|
|
...this.searchForm,
|
|
@@ -670,15 +735,26 @@ export default {
|
|
this.pageSize = 10;
|
|
this.pageSize = 10;
|
|
this.currentPage = 1;
|
|
this.currentPage = 1;
|
|
if (this.$route.query.customerName && this.$route.query.customerNumber) {
|
|
if (this.$route.query.customerName && this.$route.query.customerNumber) {
|
|
|
|
+ this.changeFn(this.$route.query.customerId);
|
|
this.getDataList({
|
|
this.getDataList({
|
|
...this.searchForm,
|
|
...this.searchForm,
|
|
|
|
|
|
- pageSize: 10,
|
|
|
|
- pageNum: 1,
|
|
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ pageNum: this.currentPage,
|
|
type: v,
|
|
type: v,
|
|
customerName: this.$route.query.customerName,
|
|
customerName: this.$route.query.customerName,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
customerNumber: this.$route.query.customerNumber,
|
|
});
|
|
});
|
|
|
|
+ } else if (this.isCustomer) {
|
|
|
|
+ this.changeFn(this.$store.state.user.customerId);
|
|
|
|
+ this.getDataList({
|
|
|
|
+ ...this.searchForm,
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ pageNum: this.currentPage,
|
|
|
|
+ type: this.bill,
|
|
|
|
+ customerName: this.$store.state.user.customerName,
|
|
|
|
+ customerNumber: this.$store.state.user.customerNumber,
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
this.getDataList({
|
|
this.getDataList({
|
|
// ...this.searchForm,
|
|
// ...this.searchForm,
|