dealer_stock.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选条件 -->
  4. <div>
  5. <Collapse :screen-form="searchForm">
  6. <template #right_btn>
  7. <el-button size="mini" @click="clearFn">清空</el-button>
  8. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  9. </template>
  10. <template #search>
  11. <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
  12. <el-row :gutter="20">
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="经销商名称" prop="customerName">
  15. <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. </el-row>
  19. </el-form>
  20. </template>
  21. </Collapse>
  22. </div>
  23. <div class="btn-group clearfix">
  24. <div class="fl">
  25. <el-button
  26. v-if="$checkBtnRole('add', $route.meta.roles)"
  27. type="primary"
  28. size="mini"
  29. @click="addFn"
  30. class="add-right"
  31. icon="el-icon-plus"
  32. >新增</el-button
  33. >
  34. <el-popconfirm
  35. v-if="$checkBtnRole('del', $route.meta.roles)"
  36. @onConfirm="deleFn"
  37. title="这是一段内容确定删除吗?"
  38. >
  39. <el-button
  40. :disabled="ids.length < 1"
  41. type="danger"
  42. size="mini"
  43. class="textColor"
  44. icon="el-icon-minus"
  45. slot="reference"
  46. >批量删除</el-button
  47. >
  48. </el-popconfirm>
  49. </div>
  50. <div class="fr">
  51. <el-button type="primary" size="mini" @click="downLoadFns">导出</el-button>
  52. <el-button type="primary" size="mini" @click="downLoadFn">下载模板</el-button>
  53. <el-upload
  54. class="import-btn"
  55. action=""
  56. :http-request="handleImport"
  57. :file-list="importFileList"
  58. :show-file-list="false"
  59. >
  60. <el-button type="primary" size="mini">导入</el-button>
  61. </el-upload>
  62. </div>
  63. </div>
  64. <div class="mymain-container">
  65. <!-- 列表 -->
  66. <div class="table">
  67. <el-table
  68. v-loading="listLoading"
  69. :data="dataList"
  70. @select="hanleSelect"
  71. @select-all="hanleSelect"
  72. element-loading-text="Loading"
  73. border
  74. fit
  75. highlight-current-row
  76. stripe
  77. >
  78. <el-table-column type="selection" align="center" min-width="51"></el-table-column>
  79. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="110" show-overflow-tooltip>
  80. <template slot-scope="scope">
  81. <CopyButton :copyText="scope.row.customerNumber" />
  82. <span>{{ scope.row.customerNumber }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
  86. <template slot-scope="scope">
  87. <CopyButton :copyText="scope.row.customerName" />
  88. <span>{{ scope.row.customerName }}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column align="left" label="金蝶部门编号" prop="k3OrgNumber" min-width="200" show-overflow-tooltip>
  92. <template slot-scope="scope">
  93. <CopyButton :copyText="scope.row.k3OrgNumber" />
  94. <span>{{ scope.row.k3OrgNumber }}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="left" label="金蝶部门名称" prop="k3OrgName" min-width="200" show-overflow-tooltip>
  98. </el-table-column>
  99. <el-table-column
  100. align="left"
  101. label="钱包名称"
  102. prop="customerWalletName"
  103. min-width="200"
  104. show-overflow-tooltip
  105. ></el-table-column>
  106. <el-table-column
  107. align="left"
  108. label="业务员"
  109. prop="serviceName"
  110. min-width="160"
  111. show-overflow-tooltip
  112. ></el-table-column>
  113. <el-table-column
  114. align="left"
  115. label="创建人"
  116. prop="createBy"
  117. min-width="180"
  118. show-overflow-tooltip
  119. ></el-table-column>
  120. <el-table-column
  121. align="left"
  122. label="创建时间"
  123. prop="createTime"
  124. min-width="160"
  125. show-overflow-tooltip
  126. ></el-table-column>
  127. <el-table-column
  128. align="left"
  129. label="更新人"
  130. prop="updateBy"
  131. min-width="180"
  132. show-overflow-tooltip
  133. ></el-table-column>
  134. <el-table-column
  135. align="left"
  136. label="更新时间"
  137. prop="updateTime"
  138. min-width="160"
  139. show-overflow-tooltip
  140. ></el-table-column>
  141. <el-table-column
  142. align="center"
  143. label="操作"
  144. prop="caozuo"
  145. min-width="160"
  146. show-overflow-tooltip
  147. fixed="right"
  148. >
  149. <template slot-scope="scope">
  150. <el-button
  151. type="text"
  152. class="textColor"
  153. v-if="$checkBtnRole('edit', $route.meta.roles)"
  154. @click="editFn(scope.row.id)"
  155. >编辑</el-button
  156. >
  157. <el-popconfirm
  158. @onConfirm="deleFn(scope.row.id)"
  159. v-if="$checkBtnRole('del', $route.meta.roles)"
  160. title="这是一段内容确定删除吗?"
  161. >
  162. <el-button type="text" class="textColor" slot="reference">删除</el-button>
  163. </el-popconfirm>
  164. </template>
  165. </el-table-column>
  166. </el-table>
  167. </div>
  168. <!-- 分页 -->
  169. <div class="fr">
  170. <el-pagination
  171. @size-change="handleSizeChange"
  172. @current-change="handleCurrentChange"
  173. :current-page="currentPage"
  174. :page-sizes="[10, 20, 30, 50]"
  175. :page-size="pageSize"
  176. layout="total, sizes, prev, pager, next, jumper"
  177. :total="listTotal"
  178. >
  179. </el-pagination>
  180. </div>
  181. </div>
  182. <!-- 弹窗 -->
  183. <el-dialog :title="title" :visible.sync="dialogForm" width="30%" :show-close="false" :close-on-click-modal="false">
  184. <el-form ref="addForm" :model="addForm" :rules="rules" label-width="100px" label-position="right">
  185. <el-form-item label="经销商名称" prop="customerId">
  186. <el-select
  187. filterable
  188. class="selectStyle"
  189. v-model="addForm.customerId"
  190. placeholder="请选择"
  191. @change="changeFn"
  192. >
  193. <el-option v-for="item in dealerList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
  194. </el-select>
  195. </el-form-item>
  196. <el-form-item label="经销商编码" prop="customerNumber">
  197. <el-input disabled v-model="addForm.customerNumber"></el-input>
  198. <!-- <template slot-scope="scope">
  199. {{ scope.row }}
  200. </template> -->
  201. </el-form-item>
  202. <el-form-item label="金蝶部门编号" prop="k3OrgNumber">
  203. <!-- <el-input v-model="addForm.k3OrgNumber"></el-input>-->
  204. <el-select class="selectStyle" v-model="addForm.k3OrgNumber" placeholder="请选择" filterable>
  205. <el-option
  206. v-for="item in k3DepartmentList"
  207. :key="item.number"
  208. :label="item.name + '(' + item.number + ')'"
  209. :value="item.number"
  210. >
  211. </el-option>
  212. </el-select>
  213. </el-form-item>
  214. <el-form-item label="钱包" prop="customerWalletId">
  215. <el-select class="selectStyle" v-model="addForm.customerWalletId" placeholder="请选择" filterable>
  216. <el-option
  217. v-for="item in walletList"
  218. :key="item.customerWalletId"
  219. :label="item.customerWalletName"
  220. :value="item.customerWalletId"
  221. >
  222. </el-option>
  223. </el-select>
  224. </el-form-item>
  225. <el-form-item label="区域" prop="region">
  226. <el-cascader
  227. ref="locationCascader"
  228. v-model="addForm.region"
  229. class="selectStyle"
  230. :options="options"
  231. :props="props"
  232. clearable
  233. ></el-cascader>
  234. </el-form-item>
  235. <!-- <el-form-item label="一级区域" prop="oneParentId">
  236. <el-select
  237. class="selectStyle"
  238. v-model="addForm.oneParentId"
  239. placeholder="请选择"
  240. filterable
  241. @change="changeOneFn"
  242. >
  243. <el-option
  244. v-for="item in oneList"
  245. :key="item.adminWebsitId"
  246. :label="item.name"
  247. :value="item.adminWebsitId"
  248. >
  249. </el-option>
  250. </el-select>
  251. </el-form-item>
  252. <el-form-item label="二级区域" prop="">
  253. <el-select
  254. filterable
  255. class="selectStyle"
  256. v-model="addForm.twoParentId"
  257. placeholder="请选择"
  258. @change="changeTwoFn"
  259. >
  260. <el-option
  261. v-for="item in twoList"
  262. :key="item.adminWebsitId"
  263. :label="item.name"
  264. :value="item.adminWebsitId"
  265. >
  266. </el-option>
  267. </el-select>
  268. </el-form-item>
  269. <el-form-item label="三级区域" prop=""
  270. ><el-select
  271. class="selectStyle"
  272. v-model="addForm.threeParentId"
  273. placeholder="请选择"
  274. filterable
  275. @change="changeThreeFn"
  276. >
  277. <el-option
  278. v-for="item in threeList"
  279. :key="item.adminWebsitId"
  280. :label="item.name"
  281. :value="item.adminWebsitId"
  282. >
  283. </el-option>
  284. </el-select>
  285. </el-form-item> -->
  286. <el-form-item label="对应业务员" prop="serviceId">
  287. <el-select class="selectStyle" v-model="addForm.serviceId" placeholder="请选择" filterable>
  288. <el-option v-for="(item, i) in userList" :key="i" :label="item.nickName" :value="item.adminUserId">
  289. </el-option>
  290. </el-select>
  291. </el-form-item>
  292. </el-form>
  293. <div slot="footer" class="dialog-footer">
  294. <el-button @click="cancelFn">取 消</el-button>
  295. <el-button type="primary" @click="addDataListFn">确 定</el-button>
  296. </div>
  297. </el-dialog>
  298. </div>
  299. </template>
  300. <script>
  301. import {
  302. getDealerStockList,
  303. getDealerStockAdd,
  304. deleDealerStockList,
  305. getDictionaries,
  306. getProductCategoryList,
  307. getAdminWebsitByparent,
  308. getAdminUserList,
  309. getCustomerPtDetail,
  310. getCustomerPtUpdate,
  311. getWalletCustomerList,
  312. getK3DepartmentList
  313. } from '@/api/basic_data/dealer'
  314. import { getDealerList } from '@/api/basic_data/dealer'
  315. import { getDepartmentList } from '@/api/setting'
  316. import { downloadFiles, handleImport } from '@/utils/util'
  317. export default {
  318. data() {
  319. return {
  320. props: {
  321. checkStrictly: true,
  322. value: 'adminWebsitId',
  323. label: 'name'
  324. // expandTrigger: "hover",
  325. // lazy: true,
  326. // lazyLoad(node, resolve) {
  327. // console.log(node);
  328. // const { value } = node;
  329. // setTimeout(async () => {
  330. // let res = await getAdminWebsitByparent({
  331. // parentId: value,
  332. // });
  333. // let aaa = res.data.map((v) => {
  334. // return { value: v.adminWebsitId, label: v.name };
  335. // });
  336. // resolve(aaa);
  337. // }, 0);
  338. // },
  339. },
  340. options: [],
  341. importFileList: [],
  342. isDisabled: true,
  343. title: '',
  344. dialogForm: false,
  345. addForm: {
  346. customerId: '',
  347. customerName: '',
  348. customerNumber: '',
  349. k3OrgNumber: '',
  350. region: [],
  351. // oneParentId: "",
  352. // twoParentId: "",
  353. // threeParentId: "",
  354. serviceId: '',
  355. customerWalletId: ''
  356. },
  357. mainId: null,
  358. rules: {
  359. customerId: [{ required: true, message: '请选择经销商名称', trigger: 'change' }],
  360. customerWalletId: [{ required: true, message: '请选择经销商钱包', trigger: 'change' }],
  361. region: [{ required: true, message: '请选择区域', trigger: 'change' }],
  362. // oneParentId: [
  363. // { required: true, message: "请选择一级区域", trigger: "blur" },
  364. // ],
  365. // twoParentId: [
  366. // { required: true, message: "请选择二级区域", trigger: "blur" },
  367. // ],
  368. // threeParentId: [
  369. // { required: true, message: "请选择三级区域", trigger: "blur" },
  370. // ],
  371. serviceId: [{ required: true, message: '请选择业务员', trigger: 'change' }]
  372. },
  373. currentPage: 1, // 当前页码
  374. pageSize: 10, // 每页数量
  375. listTotal: 0, // 列表总数
  376. searchForm: {
  377. customerName: ''
  378. },
  379. isCollapse: true,
  380. dataList: [], // 列表数据
  381. listLoading: false, // 列表加载loading
  382. dealerList: [],
  383. // selectList: [],
  384. walletList: [], //产品大类列表
  385. // oneList: [], //一级区域数据
  386. // twoList: [], //二级区域数据
  387. // threeList: [], //三级区域数据
  388. userList: [], //业务员
  389. ids: [],
  390. rowID: null, //编辑ID
  391. k3DepartmentList: []
  392. }
  393. },
  394. async created() {
  395. this.getTree()
  396. // this.getAdminWebsit(1);
  397. this.getList()
  398. this.getK3DepartmentList()
  399. this.getDealerDataList({ pageNum: 1, pageSize: -1 })
  400. this.getUserList(1)
  401. // this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
  402. },
  403. computed: {},
  404. watch: {
  405. 'addForm.region': function (newValue) {
  406. // console.log(newValue, 888);
  407. if (newValue) {
  408. this.getUserList(newValue[newValue.length - 1])
  409. }
  410. },
  411. 'addForm.customerId': async function (newValue) {
  412. if (newValue) {
  413. // this.addForm.customerWalletId = "";
  414. const res = this.dealerList.filter(i => i.id == newValue)
  415. this.addForm.customerName = res[0].name
  416. this.addForm.customerNumber = res[0].number
  417. let res2 = await getWalletCustomerList({
  418. customerId: newValue,
  419. type: 'COMMONLY'
  420. })
  421. this.walletList = res2.data
  422. }
  423. }
  424. // "addForm.oneParentId": async function (newValue) {
  425. // if (newValue) {
  426. // let res = await getAdminWebsitByparent({
  427. // parentId: newValue,
  428. // // mainId: this.mainId,
  429. // });
  430. // this.twoList = res.data;
  431. // }
  432. // },
  433. // "addForm.twoParentId": async function (newValue) {
  434. // if (newValue) {
  435. // let res = await getAdminWebsitByparent({
  436. // parentId: newValue,
  437. // // mainId: this.mainId,
  438. // });
  439. // this.getUserList(newValue);
  440. // this.threeList = res.data;
  441. // }
  442. // },
  443. // "addForm.threeParentId": async function (newValue) {
  444. // if (newValue) {
  445. // this.getUserList(newValue);
  446. // }
  447. // },
  448. },
  449. methods: {
  450. // 导入
  451. async handleImport(param) {
  452. const file = param.file
  453. const formData = new FormData()
  454. formData.append('file', file)
  455. let result = await handleImport('customer/pt/importData', formData)
  456. this.importFileList = []
  457. if (result.code == 200) {
  458. this.$message.success('导入成功')
  459. await this.getList()
  460. } else {
  461. this.$message.error(result.message)
  462. }
  463. },
  464. getK3DepartmentList() {
  465. getK3DepartmentList().then(res => {
  466. this.k3DepartmentList = res.data
  467. })
  468. },
  469. //下载模板
  470. downLoadFn() {
  471. downloadFiles('customer/pt/download')
  472. },
  473. //下载模板
  474. downLoadFns() {
  475. downloadFiles('customer/pt/export')
  476. },
  477. // //改变产品大类
  478. // changeSelectFn(value) {
  479. // // const res = this.categoryList.filter((v) => v.productCategoryId == value);
  480. // // console.log(res);
  481. // // this.mainId = res[0].productCategoryNumber;
  482. // },
  483. //编辑
  484. async changeFn(v) {
  485. this.addForm.customerWalletId = ''
  486. },
  487. // async changeOneFn(v) {
  488. // this.addForm.twoParentId = "";
  489. // this.addForm.threeParentId = "";
  490. // this.addForm.serviceId = "";
  491. // },
  492. // async changeTwoFn(v) {
  493. // this.addForm.threeParentId = "";
  494. // this.addForm.serviceId = "";
  495. // },
  496. // async changeThreeFn(v) {
  497. // this.addForm.serviceId = "";
  498. // },
  499. async editFn(id) {
  500. this.title = '经销商业务关系管理 '
  501. this.rowID = id
  502. let res = await getCustomerPtDetail({ id })
  503. // console.log(res);
  504. this.addForm.customerId = res.data.customerId
  505. this.addForm.customerWalletId = res.data.customerWalletId
  506. // this.addForm.oneParentId = res.data.adminWebsitId1;
  507. // this.addForm.twoParentId = res.data.adminWebsitId2;
  508. // this.addForm.threeParentId = res.data.adminWebsitId3;
  509. this.addForm.region = [res.data.adminWebsitId1, res.data.adminWebsitId2, res.data.adminWebsitId3]
  510. this.addForm.serviceId = res.data.serviceId
  511. this.addForm.k3OrgNumber = res.data.k3OrgNumber
  512. this.dialogForm = true
  513. },
  514. //获取业务员数据
  515. async getUserList(v) {
  516. let res = await getAdminUserList({
  517. pageNum: 1,
  518. pageSize: -1,
  519. isCustomer: 0,
  520. adminWebsitId: v
  521. })
  522. if (res.data.records.length == 0) {
  523. this.addForm.serviceId = ''
  524. }
  525. this.userList = res.data.records
  526. },
  527. // 获取部门列表
  528. getTree() {
  529. getDepartmentList().then(res => {
  530. // console.log(res, 8888);
  531. this.options = res.data[0].children
  532. })
  533. },
  534. // //根据父级查询部门
  535. // async getAdminWebsit(data) {
  536. // let res = await getAdminWebsitByparent({
  537. // parentId: data,
  538. // // mainId: this.mainId,
  539. // });
  540. // let arr = res.data.map((v) => {
  541. // return {
  542. // value: v.adminWebsitId,
  543. // label: v.name,
  544. // };
  545. // });
  546. // // this.options = arr;
  547. // this.oneList = res.data;
  548. // },
  549. // //获取产品类别数据
  550. // async getCategoryList() {
  551. // let res = await getProductCategoryList();
  552. // console.log(res);
  553. // this.categoryList = res.data;
  554. // },
  555. // 筛选部分数据或者单个
  556. hanleSelect(selection) {
  557. // this.ids = selection.map((k) => {
  558. // return k.id;
  559. // });
  560. // console.log(selection);
  561. this.ids = selection.map(v => v.id)
  562. },
  563. // //存货分类
  564. // async getSelectList(data) {
  565. // const res = await getDictionaries(data);
  566. // console.log(res);
  567. // this.selectList = res.data;
  568. // },
  569. //删除
  570. async deleFn(id) {
  571. if (id) {
  572. let arr = []
  573. arr.push(id)
  574. let res2 = arr.toString()
  575. await deleDealerStockList({ ids: res2 })
  576. } else {
  577. let res = this.ids.toString()
  578. await deleDealerStockList({ ids: res })
  579. }
  580. this.getList()
  581. this.$message.success('删除成功')
  582. this.ids = []
  583. },
  584. async addFn() {
  585. this.title = '经销商业务关系管理'
  586. this.dialogForm = true
  587. },
  588. async addDataListFn() {
  589. await this.$refs.addForm.validate()
  590. let data2 = this.walletList.filter(v => {
  591. return v.customerWalletId == this.addForm.customerWalletId
  592. })
  593. let data3 = this.userList.filter(v => {
  594. return v.adminUserId == this.addForm.serviceId
  595. })
  596. // console.log(data3);
  597. // console.log(data2, 22222);
  598. let value = {
  599. customerId: this.addForm.customerId,
  600. customerName: this.addForm.customerName,
  601. customerNumber: this.addForm.customerNumber,
  602. customerWalletId: this.addForm.customerWalletId,
  603. customerWalletName: data2[0].customerWalletName,
  604. k3OrgNumber: this.addForm.k3OrgNumber,
  605. serviceId: this.addForm.serviceId,
  606. serviceName: data3[0].nickName
  607. }
  608. if (this.title == '经销商业务关系管理 ') {
  609. await getCustomerPtUpdate({ ...value, id: this.rowID })
  610. this.$message.success('编辑成功')
  611. } else {
  612. await getDealerStockAdd(value)
  613. this.$message.success('添加成功')
  614. }
  615. if (this.$refs.locationCascader) {
  616. this.$refs.locationCascader.$refs.panel.activePath = []
  617. this.$refs.locationCascader.$refs.panel.calculateCheckedNodePaths()
  618. }
  619. this.addForm.customerId = ''
  620. this.addForm.customerNumber = ''
  621. this.addForm.customerName = ''
  622. this.addForm.customerWalletId = ''
  623. this.addForm.region = []
  624. this.addForm.k3OrgNumber = ''
  625. // this.addForm.oneParentId = "";
  626. // this.addForm.twoParentId = "";
  627. // this.addForm.threeParentId = "";
  628. this.addForm.serviceId = ''
  629. // this.userList = [];
  630. // this.twoList = [];
  631. // this.threeList = [];
  632. this.walletList = []
  633. this.$nextTick(() => {
  634. this.$refs['addForm'].clearValidate()
  635. })
  636. this.getList()
  637. this.dialogForm = false
  638. },
  639. //取消
  640. async cancelFn() {
  641. if (this.$refs.locationCascader) {
  642. this.$refs.locationCascader.$refs.panel.activePath = []
  643. this.$refs.locationCascader.$refs.panel.calculateCheckedNodePaths()
  644. }
  645. this.addForm.customerId = ''
  646. this.addForm.customerNumber = ''
  647. this.addForm.customerWalletId = ''
  648. this.addForm.region = []
  649. this.addForm.k3OrgNumber = ''
  650. // this.addForm.oneParentId = "";
  651. // this.addForm.twoParentId = "";
  652. // this.addForm.threeParentId = "";
  653. this.addForm.serviceId = ''
  654. // this.userList = [];
  655. // this.twoList = [];
  656. // this.threeList = [];
  657. this.walletList = []
  658. this.$nextTick(() => {
  659. this.$refs['addForm'].clearValidate()
  660. })
  661. this.dialogForm = false
  662. },
  663. //获取经销商数据
  664. async getDealerDataList(data) {
  665. const res = await getDealerList(data)
  666. this.dealerList = res.data.records
  667. },
  668. // 更改每页数量
  669. handleSizeChange(val) {
  670. this.pageSize = val
  671. this.currentPage = 1
  672. this.getList()
  673. },
  674. // 更改当前页
  675. handleCurrentChange(val) {
  676. this.currentPage = val
  677. this.getList()
  678. },
  679. //搜索功能
  680. searchFn() {
  681. this.currentPage = 1
  682. this.getList()
  683. },
  684. //重置
  685. clearFn() {
  686. this.$refs.searchForm.resetFields()
  687. },
  688. //获取列表数据
  689. async getList() {
  690. let params = {
  691. customerName: this.searchForm.customerName,
  692. pageNum: this.currentPage,
  693. pageSize: this.pageSize
  694. }
  695. const res = await getDealerStockList(params)
  696. this.dataList = res.data.records
  697. this.listTotal = res.data.total
  698. }
  699. }
  700. }
  701. </script>
  702. <style lang="scss" scoped>
  703. .add-right {
  704. margin-right: 10px;
  705. }
  706. .import-btn {
  707. margin-left: 10px;
  708. display: inline-block;
  709. }
  710. // ::v-deep .selectStyle .el-input--suffix {
  711. // width: 200%;
  712. // }
  713. // ::v-deep .el-input--suffix {
  714. // width: 300px;
  715. // }
  716. // ::v-deep .el-dialog__header {
  717. // background-color: #dddddd;
  718. // }
  719. // ::v-deep .dialog-footer {
  720. // display: flex;
  721. // justify-content: center;
  722. // }
  723. // .formWidth {
  724. // width: 70%;
  725. // margin-right: 20px;
  726. // }
  727. .selectStyle {
  728. width: 100%;
  729. }
  730. </style>