subMerchantDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  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 disabled />
  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" disabled />
  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" disabled />
  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 disabled />
  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 disabled />
  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" disabled />
  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" disabled />
  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" disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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" disabled />
  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" disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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 disabled />
  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" disabled />
  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" disabled />
  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" disabled />
  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" disabled />
  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 disabled />
  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. <el-row :gutter="20" class="flex">
  241. <el-col :span="4">售后系统销售编号</el-col>
  242. <el-col :span="4"> <el-input v-model="infoList.afterNumber" disabled placeholder="" size="mini" /></el-col>
  243. <el-col :span="4">售后系统绑定状态</el-col>
  244. <el-col :span="10">{{ infoList.binding === 'YES' ? '是' : '否' }}</el-col>
  245. </el-row>
  246. <el-row :gutter="20" class="flex">
  247. <el-col :span="8">
  248. <el-radio-group v-model="infoList.afterType" disabled>
  249. <el-radio v-for="item in afterTypeList" :key="item.value" :label="item.value">{{
  250. item.label
  251. }}</el-radio>
  252. </el-radio-group>
  253. </el-col>
  254. <el-col :span="2"> 绑定时间 </el-col>
  255. <el-col :span="4"> {{ infoList.bindingTime }}</el-col>
  256. <el-col :span="2"> 绑定人 </el-col>
  257. <el-col :span="4"> {{ infoList.bindingName }} </el-col>
  258. </el-row>
  259. </el-card>
  260. </div>
  261. </template>
  262. <script>
  263. import { getKingDeeCategory } from '@/api/basic_data/material'
  264. import { getStageCustomerDetail, updateCustomer, updatePick } from '@/api/basic_data/dealer'
  265. export default {
  266. props: {
  267. detailsId: {
  268. type: String,
  269. required: true
  270. }
  271. },
  272. data() {
  273. return {
  274. infoList: {},
  275. dataList: [],
  276. radio: [],
  277. isFront: false,
  278. isPick: false,
  279. pickCategory: [],
  280. frontCategory: [],
  281. categoryArr: [],
  282. code: '',
  283. afterTypeList: [
  284. { label: '绑定上级商户销售编号', value: 'CHARGE' },
  285. { label: '绑定二级商户编号', value: 'STAGE' }
  286. ]
  287. }
  288. },
  289. async created() {
  290. await this.getDataList()
  291. const res = await getStageCustomerDetail({ id: this.detailsId })
  292. // this.isFront = res.data.isFront
  293. // this.isPick = res.data.isPick
  294. if (res.data.kingDeeCustomerCategoriesFront && res.data.kingDeeCustomerCategoriesFront.length) {
  295. this.frontCategory = res.data.kingDeeCustomerCategoriesFront.map(k => {
  296. return k.categoryId
  297. })
  298. }
  299. if (res.data.kingDeeCustomerCategories && res.data.kingDeeCustomerCategories.length) {
  300. this.pickCategory = res.data.kingDeeCustomerCategories.map(k => {
  301. return k.categoryId
  302. })
  303. }
  304. this.frontCategory.forEach(k => {
  305. this.dataList.forEach(i => {
  306. if (i.id === k) {
  307. i.isFront = true
  308. }
  309. })
  310. })
  311. this.pickCategory.forEach(k => {
  312. this.dataList.forEach(i => {
  313. if (i.id === k) {
  314. i.isPick = true
  315. }
  316. })
  317. })
  318. this.categoryArr = [...new Set([...this.frontCategory, ...this.pickCategory])]
  319. this.infoList = res.data
  320. },
  321. methods: {
  322. goBack() {
  323. this.$emit('close')
  324. },
  325. // 金蝶存货类别列表
  326. async getDataList() {
  327. const res = await getKingDeeCategory()
  328. res.data.forEach(k => {
  329. k.isFront = false
  330. k.isPick = false
  331. })
  332. this.dataList = res.data
  333. },
  334. handelSubmit() {
  335. updateCustomer({
  336. id: this.infoList.id,
  337. isFront: this.infoList.isFront
  338. }).then(res => {
  339. this.$successMsg(this.infoList.isFront ? '已更改为前置仓' : '已更改为经销商自有仓库')
  340. })
  341. },
  342. onSubmit() {
  343. this.pickCategory = []
  344. this.frontCategory = []
  345. this.dataList.map(k => {
  346. this.categoryArr.map(i => {
  347. if (i === k.id) {
  348. if (k.isFront) {
  349. this.frontCategory.push(i)
  350. }
  351. if (k.isPick) {
  352. this.pickCategory.push(i)
  353. }
  354. } else {
  355. this.$errorMsg('必须选择产品类别')
  356. return
  357. }
  358. })
  359. })
  360. updatePick({
  361. id: this.detailsId,
  362. isFront: !!this.frontCategory.length,
  363. isPick: !!this.pickCategory.length,
  364. pickCategory: this.pickCategory.length ? this.pickCategory.join(',') : '',
  365. frontCategory: this.frontCategory.length ? this.frontCategory.join(',') : ''
  366. }).then(res => {
  367. this.$successMsg('保存成功')
  368. this.$emit('close')
  369. })
  370. }
  371. }
  372. }
  373. </script>
  374. <style lang="scss" scoped>
  375. .sty {
  376. margin-bottom: 20px;
  377. }
  378. ::v-deep .diy-table-1 {
  379. width: 50%;
  380. .xyed {
  381. border-top: 1px solid #ebeef5;
  382. .item {
  383. margin-bottom: 18px;
  384. }
  385. }
  386. }
  387. .pick {
  388. width: 600px;
  389. border: 1px solid #ebeef5;
  390. border-bottom: none;
  391. &-item {
  392. height: 40px;
  393. border-bottom: 1px solid #ebeef5;
  394. &-category {
  395. border-right: 1px solid #ebeef5;
  396. }
  397. &-category,
  398. &-way {
  399. padding: 0 20px;
  400. }
  401. }
  402. }
  403. .flex {
  404. display: flex;
  405. align-items: center;
  406. margin-bottom: 20px;
  407. }
  408. .tagStyle {
  409. margin: 0 18px;
  410. }
  411. </style>