dealer_list-detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <template>
  2. <div>
  3. <div class="sty">
  4. <el-page-header content="详情" @back="goBack" />
  5. </div>
  6. <el-form :model="infoList" label-width="130px" size="small" label-position="right">
  7. <el-card class="">
  8. <div slot="header" class="clearfix">
  9. <strong>客户</strong>
  10. </div>
  11. <div>
  12. <!-- <el-form label-width="130px" size="small" label-position="right"> -->
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="创建组织" prop="">
  16. <el-input />
  17. </el-form-item>
  18. </el-col>
  19. <el-col :xs="24" :sm="12" :lg="6">
  20. <el-form-item label="客户编码" prop="">
  21. <el-input v-model="infoList.number" />
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="使用组织" prop="">
  26. <el-input v-model="infoList.useOrgName" />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="12" :lg="6">
  30. <el-form-item label="简称" prop="">
  31. <el-input />
  32. </el-form-item>
  33. </el-col>
  34. </el-row>
  35. <!-- </el-form> -->
  36. </div>
  37. </el-card>
  38. <br>
  39. <el-card class="">
  40. <div slot="header" class="clearfix">
  41. <strong>基本信息</strong>
  42. </div>
  43. <span>地址</span>
  44. <el-divider />
  45. <div>
  46. <!-- <el-form label-width="130px" size="small" label-position="right"> -->
  47. <el-row :gutter="20">
  48. <el-col :xs="24" :sm="12" :lg="6">
  49. <el-form-item label="国家" prop="">
  50. <el-input />
  51. </el-form-item>
  52. </el-col>
  53. <el-col :xs="24" :sm="12" :lg="6">
  54. <el-form-item label="地区" prop="">
  55. <el-input v-model="infoList.region" />
  56. </el-form-item>
  57. </el-col>
  58. <el-col :xs="24" :sm="12" :lg="6">
  59. <el-form-item label="省份" prop="">
  60. <el-input v-model="infoList.province" />
  61. </el-form-item>
  62. </el-col>
  63. <el-col :xs="24" :sm="12" :lg="6">
  64. <el-form-item label="城市" prop="">
  65. <el-input v-model="infoList.city" />
  66. </el-form-item>
  67. </el-col>
  68. <el-col :xs="24" :sm="12" :lg="6">
  69. <el-form-item label="通信地址" prop="">
  70. <el-input />
  71. </el-form-item>
  72. </el-col>
  73. <el-col :xs="24" :sm="12" :lg="6">
  74. <el-form-item label="邮政编码" prop="">
  75. <el-input />
  76. </el-form-item>
  77. </el-col>
  78. <el-col :xs="24" :sm="12" :lg="6">
  79. <el-form-item label="公司网址" prop="">
  80. <el-input />
  81. </el-form-item>
  82. </el-col>
  83. <el-col :xs="24" :sm="12" :lg="6">
  84. <el-form-item label="商城订单对应组织" prop="">
  85. <el-input />
  86. </el-form-item>
  87. </el-col>
  88. <el-col :xs="24" :sm="12" :lg="6">
  89. <el-form-item label="联系邮箱" prop="">
  90. <el-input v-model="infoList.email" />
  91. </el-form-item>
  92. </el-col>
  93. </el-row>
  94. <!-- </el-form> -->
  95. </div>
  96. <span>管理</span>
  97. <el-divider />
  98. <div>
  99. <!-- <el-form label-width="130px" size="small" label-position="right"> -->
  100. <el-row :gutter="20">
  101. <el-col :xs="24" :sm="12" :lg="6">
  102. <el-form-item label="联系电话" prop="">
  103. <el-input v-model="infoList.mobile" />
  104. </el-form-item>
  105. </el-col>
  106. <el-col :xs="24" :sm="12" :lg="6">
  107. <el-form-item label="传真" prop="">
  108. <el-input />
  109. </el-form-item>
  110. </el-col>
  111. <el-col :xs="24" :sm="12" :lg="6">
  112. <el-form-item label="公司类别" prop="">
  113. <el-input />
  114. </el-form-item>
  115. </el-col>
  116. <el-col :xs="24" :sm="12" :lg="6">
  117. <el-form-item label="公司性质" prop="">
  118. <el-input />
  119. </el-form-item>
  120. </el-col>
  121. <el-col :xs="24" :sm="12" :lg="6">
  122. <el-form-item label="公司规模" prop="">
  123. <el-input />
  124. </el-form-item>
  125. </el-col>
  126. </el-row>
  127. <!-- </el-form> -->
  128. </div>
  129. <span>相关</span>
  130. <el-divider />
  131. <div>
  132. <!-- <el-form label-width="130px" size="small" label-position="right"> -->
  133. <el-row :gutter="20">
  134. <el-col :xs="24" :sm="12" :lg="6">
  135. <el-form-item label="对应供应商" prop="">
  136. <el-input />
  137. </el-form-item>
  138. </el-col>
  139. <el-col :xs="24" :sm="12" :lg="6">
  140. <el-form-item label="对应集团客户" prop="">
  141. <el-input />
  142. </el-form-item>
  143. </el-col>
  144. <el-col :xs="24" :sm="12" :lg="6">
  145. <el-form-item label="客户类别" prop="">
  146. <el-input />
  147. </el-form-item>
  148. </el-col>
  149. <el-col :xs="24" :sm="12" :lg="6">
  150. <el-form-item label="客户分组" prop="">
  151. <el-input />
  152. </el-form-item>
  153. </el-col>
  154. <el-col :xs="24" :sm="12" :lg="6">
  155. <el-form-item label="集团客户" prop="">
  156. <el-checkbox />
  157. </el-form-item>
  158. </el-col>
  159. <el-col :xs="24" :sm="12" :lg="6">
  160. <el-form-item label="默认付款方" prop="">
  161. <el-checkbox />
  162. </el-form-item>
  163. </el-col>
  164. <el-col :xs="24" :sm="12" :lg="6">
  165. <el-form-item label="不校验可发量" prop="">
  166. <el-checkbox />
  167. </el-form-item>
  168. </el-col>
  169. <el-col :xs="24" :sm="12" :lg="6">
  170. <el-form-item label="对应组织" prop="">
  171. <el-input />
  172. </el-form-item>
  173. </el-col>
  174. <el-col :xs="24" :sm="12" :lg="6">
  175. <el-form-item label="备注" prop="">
  176. <el-input />
  177. </el-form-item>
  178. </el-col>
  179. </el-row>
  180. <!-- </el-form> -->
  181. </div>
  182. <span>开票信息</span>
  183. <el-divider />
  184. <div>
  185. <!-- <el-form label-width="130px" size="small" label-position="right"> -->
  186. <el-row :gutter="20">
  187. <el-col :xs="24" :sm="12" :lg="6">
  188. <el-form-item label="发票抬头" prop="">
  189. <el-input />
  190. </el-form-item>
  191. </el-col>
  192. <el-col :xs="24" :sm="12" :lg="6">
  193. <el-form-item label="纳税登记号" prop="">
  194. <el-input />
  195. </el-form-item>
  196. </el-col>
  197. <el-col :xs="24" :sm="12" :lg="6">
  198. <el-form-item label="开户银行" prop="">
  199. <el-input v-model="infoList.bank" />
  200. </el-form-item>
  201. </el-col>
  202. <el-col :xs="24" :sm="12" :lg="6">
  203. <el-form-item label="银行账号" prop="">
  204. <el-input v-model="infoList.bankAccount" />
  205. </el-form-item>
  206. </el-col>
  207. <el-col :xs="24" :sm="12" :lg="6">
  208. <el-form-item label="开票联系电话" prop="">
  209. <el-input v-model="infoList.invoicePhone" />
  210. </el-form-item>
  211. </el-col>
  212. <el-col :xs="24" :sm="12" :lg="6">
  213. <el-form-item label="开票通讯地址" prop="">
  214. <el-input v-model="infoList.invoiceAddress" />
  215. </el-form-item>
  216. </el-col>
  217. </el-row>
  218. <!-- </el-form> -->
  219. </div>
  220. <span>智慧订货</span>
  221. <el-divider />
  222. <div>
  223. <!-- <el-form label-width="130px" size="small" label-position="right"> -->
  224. <el-row :gutter="20">
  225. <el-col :xs="24" :sm="12" :lg="6">
  226. <el-form-item label="允许对接智慧订单" prop="">
  227. <el-checkbox />
  228. </el-form-item>
  229. </el-col>
  230. </el-row>
  231. <!-- </el-form> -->
  232. </div>
  233. </el-card>
  234. </el-form>
  235. <br>
  236. <el-card>
  237. <div slot="header" class="clearfix">
  238. <strong>信用额度</strong>
  239. </div>
  240. <div class="diy-table-1">
  241. <el-row :gutter="0" class="xyed">
  242. <div v-for="(v, i) in infoList.customerWallets" v-show="v.type == 'COMMONLY'" :key="i">
  243. <el-col :span="12" class="item">
  244. <div class="label">信用额度</div>
  245. <div class="value">{{ v.freeCreditAmount }}</div>
  246. </el-col>
  247. <el-col :span="12" class="item">
  248. <div class="label">钱包类型</div>
  249. <div class="value">{{ v.customerWalletName }}-{{ v.type == 'COMMONLY' ? '普通钱包' : '返利钱包' }}</div>
  250. </el-col>
  251. </div>
  252. </el-row>
  253. </div>
  254. </el-card>
  255. <br>
  256. <el-card>
  257. <div slot="header" class="clearfix">
  258. <strong>标签信息</strong>
  259. </div>
  260. <div class="diy-table-1" style="width: 100%">
  261. <el-form label-width="120px" class="demo-ruleForm">
  262. <el-row>
  263. <el-col :span="6">
  264. <el-form-item label="集团客户" prop="">
  265. <el-radio v-model="infoList.isGroupCompany" :label="true">是</el-radio>
  266. <el-radio v-model="infoList.isGroupCompany" :label="false">否</el-radio>
  267. </el-form-item>
  268. </el-col>
  269. <el-col :span="6">
  270. <el-form-item label="是否可转折让" prop="">
  271. <el-radio v-model="infoList.isZr" :label="true">是</el-radio>
  272. <el-radio v-model="infoList.isZr" :label="false">否</el-radio>
  273. </el-form-item>
  274. </el-col>
  275. <el-col :span="12">
  276. <el-form-item label-width="0px"> 注:设置后返利可以转入折让钱包 </el-form-item>
  277. </el-col>
  278. <!-- <el-col :span="12">
  279. <el-form-item label="是否前置仓" prop="">
  280. <el-radio v-model="infoList.isFront" :label="true">前置仓</el-radio>
  281. <el-radio v-model="infoList.isFront" :label="false">经销商自有仓库</el-radio>
  282. <el-button type="primary" size="mini" @click="handelSubmit">修改</el-button>
  283. </el-form-item>
  284. </el-col> -->
  285. </el-row>
  286. <el-col>
  287. <el-form-item label="分子公司">
  288. <el-tag v-for="v in infoList.kingDeeCustomers" :key="v.id" class="tagStyle">{{ v.name }}</el-tag>
  289. </el-form-item>
  290. </el-col>
  291. <el-col>
  292. <el-form-item label="提货方式">
  293. <div class="pick">
  294. <el-row v-if="dataList.length">
  295. <el-col v-for="(item, index) in dataList" :key="index" :span="24" class="pick-item">
  296. <el-checkbox-group v-model="categoryArr">
  297. <el-col :span="6" class="pick-item-category">
  298. <el-checkbox :label="item.id">
  299. {{ item.name }}
  300. </el-checkbox>
  301. </el-col>
  302. </el-checkbox-group>
  303. <el-col :span="18" class="pick-item-way">
  304. <el-checkbox v-model="item.isFront" :label="true"> 物流配送(嘉贤物流)</el-checkbox>
  305. <el-checkbox v-model="item.isPick" :label="true">商家自提</el-checkbox>
  306. </el-col>
  307. </el-col>
  308. </el-row>
  309. </div>
  310. <div>注:设置配送方式后提货预约可根据配置的提货方式进行选择</div>
  311. <div style="margin: 20px 0">
  312. <el-button type="primary" size="default" @click="onSubmit">保存</el-button>
  313. </div>
  314. <!-- <el-col :span="12">
  315. <div>
  316. <el-checkbox v-model="isFront" :label="true"> 物流配送(嘉贤物流)</el-checkbox>
  317. </div>
  318. <div>选择商家自提需配置物流产品类别</div>
  319. <div>
  320. </div>
  321. </el-col>
  322. <el-col :span="12">
  323. <div>
  324. <el-checkbox v-model="isPick" :label="true">商家自提</el-checkbox>
  325. </div>
  326. <div>选择商家自提需配置自提产品类别</div>
  327. <div>
  328. <el-checkbox-group v-model="pickCategory">
  329. <el-checkbox v-for="(item, index) in dataList" :key="index" :label="item.id">
  330. {{ item.name }}
  331. </el-checkbox>
  332. </el-checkbox-group>
  333. </div>
  334. </el-col>
  335. <div>注:设置配送方式后提货预约可根据配置的提货方式进行选择</div>
  336. <div>
  337. <el-button type="primary" size="default" @click="onSubmit">保存</el-button>
  338. </div> -->
  339. </el-form-item>
  340. </el-col>
  341. </el-form>
  342. </div>
  343. </el-card>
  344. <br>
  345. <el-card>
  346. <div slot="header" class="clearfix">
  347. <strong>售后系统关联信息</strong>
  348. </div>
  349. <!-- type="flex" justify="center" align="middle" class="" -->
  350. <el-row class="flex">
  351. <el-col :span="2">售后系统编号</el-col>
  352. <el-col
  353. :span="3"
  354. style="margin: 0 20px"
  355. ><el-input v-model="infoList.afterNumber" placeholder="请输入售后系统编号" size="mini" clearable />
  356. </el-col>
  357. <el-col :span="4">售后系统绑定状态</el-col>
  358. <el-col :span="3">{{ infoList.binding === 'YES' ? '是' : '否' }}</el-col>
  359. <el-col :span="3">绑定时间</el-col>
  360. <el-col :span="3">{{ infoList.bindingTime }}</el-col>
  361. <el-col :span="3">绑定人</el-col>
  362. <el-col :span="2">{{ infoList.bindingName }}</el-col>
  363. </el-row>
  364. <div style="margin: 20px 0">
  365. <el-button type="primary" size="default" @click="onSave">保存</el-button>
  366. </div>
  367. <!-- <zj-table /> -->
  368. </el-card>
  369. </div>
  370. </template>
  371. <script>
  372. import { getKingDeeCategory } from '@/api/basic_data/material'
  373. import { getDealerInfo, updateCustomer, updatePick, updateSystem } from '@/api/basic_data/dealer'
  374. export default {
  375. props: {
  376. detailsId: {
  377. type: String,
  378. required: true
  379. }
  380. },
  381. data() {
  382. return {
  383. infoList: {},
  384. dataList: [],
  385. radio: [],
  386. isFront: false,
  387. isPick: false,
  388. pickCategory: [],
  389. frontCategory: [],
  390. categoryArr: [],
  391. afterNumber: ''
  392. }
  393. },
  394. async created() {
  395. await this.getDataList()
  396. const res = await getDealerInfo({ id: this.detailsId })
  397. // this.isFront = res.data.isFront
  398. // this.isPick = res.data.isPick
  399. if (res.data.kingDeeCustomerCategoriesFront && res.data.kingDeeCustomerCategoriesFront.length) {
  400. this.frontCategory = res.data.kingDeeCustomerCategoriesFront.map(k => {
  401. return k.categoryId
  402. })
  403. }
  404. if (res.data.kingDeeCustomerCategories && res.data.kingDeeCustomerCategories.length) {
  405. this.pickCategory = res.data.kingDeeCustomerCategories.map(k => {
  406. return k.categoryId
  407. })
  408. }
  409. this.frontCategory.forEach(k => {
  410. this.dataList.forEach(i => {
  411. if (i.id === k) {
  412. i.isFront = true
  413. }
  414. })
  415. })
  416. this.pickCategory.forEach(k => {
  417. this.dataList.forEach(i => {
  418. if (i.id === k) {
  419. i.isPick = true
  420. }
  421. })
  422. })
  423. this.categoryArr = [...new Set([...this.frontCategory, ...this.pickCategory])]
  424. this.infoList = res.data
  425. },
  426. methods: {
  427. goBack() {
  428. this.$emit('close')
  429. },
  430. // 金蝶存货类别列表
  431. async getDataList() {
  432. const res = await getKingDeeCategory()
  433. res.data.forEach(k => {
  434. k.isFront = false
  435. k.isPick = false
  436. })
  437. this.dataList = res.data
  438. },
  439. handelSubmit() {
  440. updateCustomer({
  441. id: this.infoList.id,
  442. isFront: this.infoList.isFront
  443. }).then(res => {
  444. this.$successMsg(this.infoList.isFront ? '已更改为前置仓' : '已更改为经销商自有仓库')
  445. })
  446. },
  447. onSubmit() {
  448. this.pickCategory = []
  449. this.frontCategory = []
  450. if (this.categoryArr.length) {
  451. for (let i = 0; i < this.dataList.length; i++) {
  452. const item = this.dataList[i]
  453. for (let j = 0; j < this.categoryArr.length; j++) {
  454. const category = this.categoryArr[j]
  455. if (category === item.id) {
  456. if (item.isFront) {
  457. this.frontCategory.push(category)
  458. }
  459. if (item.isPick) {
  460. this.pickCategory.push(category)
  461. }
  462. }
  463. }
  464. }
  465. } else {
  466. this.$errorMsg('必须选择产品类别')
  467. return
  468. }
  469. updatePick({
  470. id: this.detailsId,
  471. isFront: !!this.frontCategory.length,
  472. isPick: !!this.pickCategory.length,
  473. pickCategory: this.pickCategory.length ? this.pickCategory.join(',') : '',
  474. frontCategory: this.frontCategory.length ? this.frontCategory.join(',') : ''
  475. }).then(res => {
  476. this.$successMsg('保存成功')
  477. this.$emit('close')
  478. })
  479. },
  480. onSave() {
  481. updateSystem({
  482. id: this.detailsId,
  483. afterNumber: this.afterNumber
  484. }).then(res => {
  485. getDealerInfo({ id: this.detailsId }).then(res => {
  486. const { afterType, bindingTime, bindingName } = res.data
  487. this.infoList.afterType = afterType
  488. this.infoList.bindingTime = bindingTime
  489. this.infoList.bindingName = bindingName
  490. this.$successMsg('保存成功')
  491. })
  492. })
  493. }
  494. }
  495. }
  496. </script>
  497. <style lang="scss" scoped>
  498. .sty {
  499. margin-bottom: 20px;
  500. }
  501. ::v-deep .diy-table-1 {
  502. width: 50%;
  503. .xyed {
  504. border-top: 1px solid #ebeef5;
  505. .item {
  506. margin-bottom: 18px;
  507. }
  508. }
  509. }
  510. .pick {
  511. width: 600px;
  512. border: 1px solid #ebeef5;
  513. border-bottom: none;
  514. &-item {
  515. height: 40px;
  516. border-bottom: 1px solid #ebeef5;
  517. &-category {
  518. border-right: 1px solid #ebeef5;
  519. }
  520. &-category,
  521. &-way {
  522. padding: 0 20px;
  523. }
  524. }
  525. }
  526. .flex {
  527. display: flex;
  528. align-items: center;
  529. }
  530. .tagStyle {
  531. margin: 0 18px;
  532. }
  533. </style>