agreementUnitDetailForm.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <template>
  2. <div class="container">
  3. <div class="left">
  4. <a-button type="primary" style="margin-bottom: 16px" @click="toggleCollapsed">
  5. <!-- <a-icon :type="collapsed ? 'menu-unfold' : 'menu-fold'" />-->
  6. {{collapsed ? '展开':'收起'}}
  7. </a-button>
  8. <a-menu
  9. :default-selected-keys="['1']"
  10. mode="inline"
  11. :inline-collapsed="collapsed"
  12. @click="handleMneuClick"
  13. >
  14. <a-menu-item key="1">
  15. <a-icon type="team" />
  16. <span>客户信息</span>
  17. </a-menu-item>
  18. <a-menu-item key="2">
  19. <a-icon type="file-text" />
  20. <span>客户协议</span>
  21. </a-menu-item>
  22. <a-menu-item key="3">
  23. <a-icon type="phone" />
  24. <span>联系人</span>
  25. </a-menu-item>
  26. <a-menu-item key="4">
  27. <a-icon type="property-safety" />
  28. <span>佣金</span>
  29. </a-menu-item>
  30. <a-menu-item key="5">
  31. <a-icon type="file-done" />
  32. <span>入住记录</span>
  33. </a-menu-item>
  34. <!-- <a-sub-menu key="sub1">-->
  35. <!-- <span slot="title"><a-icon type="mail" /><span>Navigation One</span></span>-->
  36. <!-- <a-menu-item key="5">-->
  37. <!-- Option 5-->
  38. <!-- </a-menu-item>-->
  39. <!-- <a-menu-item key="6">-->
  40. <!-- Option 6-->
  41. <!-- </a-menu-item>-->
  42. <!-- <a-menu-item key="7">-->
  43. <!-- Option 7-->
  44. <!-- </a-menu-item>-->
  45. <!-- <a-menu-item key="8">-->
  46. <!-- Option 8-->
  47. <!-- </a-menu-item>-->
  48. <!-- </a-sub-menu>-->
  49. </a-menu>
  50. </div>
  51. <!-- <a-divider type="vertical" style="height: inherit;margin-left: 20px;" />-->
  52. <div class="right">
  53. <div class="content">
  54. <div v-if="activeMneu == 1">
  55. <a-spin :spinning="confirmLoading">
  56. <j-form-container>
  57. <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  58. <a-row :gutter="[16,16]">
  59. <a-col :span="24">
  60. <a-form-model-item label="选择日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
  61. <div class="item-content">
  62. <div class="list-container">
  63. <div class="list-item" v-for="(item, index) in dateList" :key="index" :class="{active: activeIndex === index}" @click="handleClick(index)">
  64. {{ item }}
  65. </div>
  66. </div>
  67. <div>
  68. <a-range-picker v-show="activeIndex==3" @change="onChange" size="large"/>
  69. </div>
  70. </div>
  71. </a-form-model-item>
  72. </a-col>
  73. <a-col :span="8">
  74. <a-form-model-item label="客户全称" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="customerName">
  75. <a-input disabled="disabled" v-model="model.customerName" ></a-input>
  76. </a-form-model-item>
  77. </a-col>
  78. <a-col :span="8">
  79. <a-form-model-item label="客户简称" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="customerShortName">
  80. <a-input disabled="disabled" v-model="model.customerShortName" ></a-input>
  81. </a-form-model-item>
  82. </a-col>
  83. <a-col :span="8">
  84. <a-form-model-item label="系统类型" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="systemType_dictText">
  85. <a-input disabled="disabled" v-model="model.systemType_dictText" ></a-input>
  86. <!-- <a-select-->
  87. <!-- disabled="disabled"-->
  88. <!-- v-model="model.systemType"-->
  89. <!-- placeholder="请选择系统类型"-->
  90. <!-- :allowClear="true"-->
  91. <!-- >-->
  92. <!-- <a-select-option :value="item.id" v-for="(item,index) in systemTypeList" :key="index">{{ item.itemText }}</a-select-option>-->
  93. <!-- </a-select>-->
  94. </a-form-model-item>
  95. </a-col>
  96. <a-col :span="8">
  97. <a-form-model-item label="客户编号" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="customerNo">
  98. <a-input disabled="disabled" v-model="model.customerNo"></a-input>
  99. </a-form-model-item>
  100. </a-col>
  101. <a-col :span="8">
  102. <a-form-model-item label="主联系人" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="contactsName">
  103. <a-input disabled="disabled" v-model="model.contactsName"></a-input>
  104. </a-form-model-item>
  105. </a-col>
  106. <a-col :span="8">
  107. <a-form-model-item label="客户类型" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="customerType_dictText">
  108. <a-input disabled="disabled" v-model="model.customerType_dictText" ></a-input>
  109. <!-- <a-select-->
  110. <!-- v-model="model.customerType"-->
  111. <!-- placeholder="请选择客户类型"-->
  112. <!-- :allowClear="true"-->
  113. <!-- >-->
  114. <!-- <a-select-option :value="item.id" v-for="(item,index) in customerTypeList" :key="index">{{ item.itemText }}</a-select-option>-->
  115. <!-- </a-select>-->
  116. </a-form-model-item>
  117. </a-col>
  118. <a-col :span="8">
  119. <a-form-model-item label="销售人员" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="sellerId_dictText">
  120. <a-input disabled="disabled" v-model="model.sellerId_dictText"></a-input>
  121. <!-- <a-select-->
  122. <!-- v-model="model.sellerId"-->
  123. <!-- placeholder="请选择销售人员"-->
  124. <!-- :allowClear="true"-->
  125. <!-- >-->
  126. <!-- <a-select-option :value="item.id" v-for="(item,index) in saleList" :key="index">{{ item.name }}</a-select-option>-->
  127. <!-- </a-select>-->
  128. </a-form-model-item>
  129. </a-col>
  130. <a-col :span="8">
  131. <a-form-model-item label="手机号" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="phone">
  132. <a-input disabled="disabled" v-model="model.phone" ></a-input>
  133. </a-form-model-item>
  134. </a-col>
  135. <a-col :span="8">
  136. <a-form-model-item label="客户状态" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="status_dictText">
  137. <a-input disabled="disabled" v-model="model.status_dictText" ></a-input>
  138. <!-- <a-select-->
  139. <!-- v-model="model.status"-->
  140. <!-- placeholder="请选择客户状态"-->
  141. <!-- :allowClear="true"-->
  142. <!-- >-->
  143. <!-- <a-select-option :value="item.id" v-for="(item,index) in customerStatusList" :key="index">{{ item.itemText }}</a-select-option>-->
  144. <!-- </a-select>-->
  145. </a-form-model-item>
  146. </a-col>
  147. <a-col :span="8">
  148. <a-form-model-item label="地区" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="region">
  149. <a-input disabled="disabled" v-model="model.region" ></a-input>
  150. </a-form-model-item>
  151. </a-col>
  152. <a-col :span="8">
  153. <a-form-model-item label="邮编" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="postalCode">
  154. <a-input disabled="disabled" v-model="model.postalCode" ></a-input>
  155. </a-form-model-item>
  156. </a-col>
  157. <a-col :span="8">
  158. <a-form-model-item label="地址" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="address">
  159. <a-input disabled="disabled" v-model="model.address" ></a-input>
  160. </a-form-model-item>
  161. </a-col>
  162. <a-col :span="8">
  163. <a-form-model-item label="公司电话" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="companyPhone">
  164. <a-input disabled="disabled" v-model="model.companyPhone" ></a-input>
  165. </a-form-model-item>
  166. </a-col>
  167. <a-col :span="8">
  168. <a-form-model-item label="传真" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="fax">
  169. <a-input disabled="disabled" v-model="model.fax" placeholder="请输入传真" ></a-input>
  170. </a-form-model-item>
  171. </a-col>
  172. <a-col :span="8">
  173. <a-form-model-item label="客户来源" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="customerSource_dictText">
  174. <a-input disabled="disabled" v-model="model.customerSource_dictText"></a-input>
  175. <!-- <a-select-->
  176. <!-- v-model="model.customerSource"-->
  177. <!-- placeholder="请选择客户来源"-->
  178. <!-- :allowClear="true"-->
  179. <!-- >-->
  180. <!-- <a-select-option :value="item.id" v-for="(item,index) in customerSourceList" :key="index">{{ item.itemText }}</a-select-option>-->
  181. <!-- </a-select>-->
  182. </a-form-model-item>
  183. </a-col>
  184. <a-col :span="8">
  185. <a-form-model-item label="主页" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="homepage">
  186. <a-input disabled="disabled" v-model="model.homepage" ></a-input>
  187. </a-form-model-item>
  188. </a-col>
  189. <a-col :span="8">
  190. <a-form-model-item label="Email" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="email">
  191. <a-input disabled="disabled" v-model="model.email" ></a-input>
  192. </a-form-model-item>
  193. </a-col>
  194. <a-col :span="8">
  195. <a-form-model-item label="客户行业" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="customerIndustry_dictText">
  196. <a-input disabled="disabled" v-model="model.customerIndustry_dictText" ></a-input>
  197. <!-- <a-select-->
  198. <!-- v-model="model.customerIndustry"-->
  199. <!-- placeholder="请选择客户行业"-->
  200. <!-- :allowClear="true"-->
  201. <!-- >-->
  202. <!-- <a-select-option :value="item.id" v-for="(item,index) in customerIndustryList" :key="index">{{ item.itemText }}</a-select-option>-->
  203. <!-- </a-select>-->
  204. </a-form-model-item>
  205. </a-col>
  206. <a-col :span="8">
  207. <a-form-model-item label="累计入住天数" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="email">
  208. <a-input disabled="disabled" v-model="otherModel.email" ></a-input>
  209. </a-form-model-item>
  210. </a-col>
  211. <a-col :span="8">
  212. <a-form-model-item label="累计NoShow次数" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="email">
  213. <a-input disabled="disabled" v-model="otherModel.email" ></a-input>
  214. </a-form-model-item>
  215. </a-col>
  216. <a-col :span="8">
  217. <a-form-model-item label="累计取消预计" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="email">
  218. <a-input disabled="disabled" v-model="otherModel.email" ></a-input>
  219. </a-form-model-item>
  220. </a-col>
  221. <a-col :span="8">
  222. <a-form-model-item label="同类客户排名" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="email">
  223. <a-input disabled="disabled" v-model="otherModel.email" ></a-input>
  224. </a-form-model-item>
  225. </a-col>
  226. <a-col :span="8">
  227. <a-form-model-item label="未结算佣金" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="email">
  228. <a-input disabled="disabled" v-model="otherModel.email" ></a-input>
  229. </a-form-model-item>
  230. </a-col>
  231. <a-col :span="8">
  232. <a-form-model-item label="已结算佣金" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="email">
  233. <a-input disabled="disabled" v-model="otherModel.email" ></a-input>
  234. </a-form-model-item>
  235. </a-col>
  236. <a-col :span="8">
  237. <a-form-model-item label="记账限额" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="bookkeeping">
  238. <a-input-number style="width: 100%;margin: auto" v-model="model.bookkeeping" :min="0" :precision="2" placeholder="请输入记账限额" />
  239. </a-form-model-item>
  240. </a-col>
  241. <a-col :span="8">
  242. <a-form-model-item label="备注" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="remark">
  243. <a-input v-model="model.remarks" placeholder="请输入备注" ></a-input>
  244. </a-form-model-item>
  245. </a-col>
  246. <a-col :span="8">
  247. <a-form-model-item >
  248. <a-checkbox @change="onReceptionChange" v-model="model.commissionValue">
  249. 是否返佣
  250. </a-checkbox>
  251. <a-checkbox @change="onReceptionChange" v-model="model.receptionValue">
  252. 前台是否查询
  253. </a-checkbox>
  254. <a-checkbox @change="onReceptionChange" v-model="model.bookkStatusValue">
  255. 不允许该单位记账
  256. </a-checkbox>
  257. </a-form-model-item>
  258. </a-col>
  259. </a-row>
  260. <div style="width:100%;display: flex;">
  261. <a-button type="primary" @click="submitOtherData" style="margin: auto;">保存</a-button>
  262. </div>
  263. </a-form-model>
  264. </j-form-container>
  265. </a-spin>
  266. </div>
  267. <div v-if="activeMneu == 2">
  268. <customer-list :agreementModel="model"></customer-list>
  269. </div>
  270. <div v-if="activeMneu == 3">
  271. <contacts-list :agreementModel="model"></contacts-list>
  272. </div>
  273. <div v-if="activeMneu == 4">
  274. <commission :agreementModel="model"></commission>
  275. </div>
  276. <div v-if="activeMneu == 5">
  277. <check-in-list :agreementModel="model"></check-in-list>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. </template>
  283. <script>
  284. import { httpAction, getAction } from '@/api/manage'
  285. import '@/assets/less/TableExpand.less'
  286. import CustomerList from './details/customerList'
  287. import ContactsList from './details/contactsList'
  288. import CheckInList from './details/checkInList'
  289. import Commission from './details/commission'
  290. export default {
  291. name: 'agreementUnitDetailForm',
  292. components: { Commission, CheckInList, ContactsList, CustomerList },
  293. computed: {
  294. formDisabled(){
  295. return this.disabled
  296. },
  297. },
  298. data() {
  299. return {
  300. collapsed: false,
  301. activeMneu: 1,
  302. dateList: ['今天', '昨日', '本周', '更多'],
  303. activeIndex: 0,
  304. model:{
  305. receptionValue:false,
  306. commissionValue:false,
  307. bookkStatusValue:false,
  308. },
  309. otherModel:{
  310. },
  311. labelCol: {
  312. xs: { span: 24 },
  313. sm: { span: 2 },
  314. },
  315. wrapperCol: {
  316. xs: { span: 24 },
  317. sm: { span: 20 },
  318. },
  319. labelCol1: {
  320. xs: { span: 24 },
  321. sm: { span: 8 },
  322. },
  323. wrapperCol1: {
  324. xs: { span: 24 },
  325. sm: { span: 14 },
  326. },
  327. confirmLoading: false,
  328. validatorRules:{
  329. customerName: [
  330. { required: true, message: '请输入客户全称!'},
  331. ],
  332. customerShortName: [
  333. { required: true, message: '请输入客户简称!'},
  334. ],
  335. systemType_dictText: [
  336. { required: true, message: '请选择系统类型!'},
  337. ],
  338. customerNo: [
  339. { required: true, message: '请输入客户编号!'},
  340. ],
  341. contactsName: [
  342. { required: true, message: '请输入主联系人!'},
  343. ],
  344. customerType_dictText: [
  345. { required: true, message: '请选择客户类型!'},
  346. ],
  347. sellerId_dictText: [
  348. { required: true, message: '请选择销售人员!'},
  349. ],
  350. phone: [
  351. { required: true, message: '请输入手机号!'},
  352. ],
  353. status_dictText: [
  354. { required: true, message: '请选择状态!'},
  355. ],
  356. customerSource_dictText: [
  357. { required: true, message: '请选择客户来源!'},
  358. ],
  359. customerIndustry_dictText: [
  360. { required: true, message: '请选择客户行业!'},
  361. ],
  362. },
  363. url: {
  364. editOther: "/business/busMarketAgreementUnit/editOther",
  365. queryById: "/business/busMarketAgreementUnit/queryById",
  366. query_saleList: "/business/busSalesPerson/queryList",
  367. listCheckInRecord: "/business/busMarketAgreementUnit/listCheckInRecord",
  368. },
  369. };
  370. },
  371. created() {
  372. getAction(this.url.listCheckInRecord,{}).then((res)=>{
  373. console.log(res)
  374. if(res.success){
  375. //res.result
  376. }else{
  377. }
  378. })
  379. },
  380. methods: {
  381. add() {
  382. this.edit(this.modelDefault);
  383. },
  384. edit(record) {
  385. console.log(record)
  386. this.model = Object.assign({}, record);
  387. this.visible = true;
  388. this.model.receptionValue = record.reception == 1?true:false;
  389. this.model.commissionValue = record.commission == 1?true:false;
  390. this.model.bookkStatusValue = record.bookkStatus == 1?true:false;
  391. },
  392. toggleCollapsed() {
  393. this.collapsed = !this.collapsed;
  394. },
  395. handleMneuClick(e) {
  396. console.log('click', e);
  397. console.log('click', e.key);
  398. this.activeMneu = e.key;
  399. },
  400. handleClick(index) {
  401. this.activeIndex = index
  402. // this.searchQuery()
  403. console.log(index)
  404. switch (index) {
  405. case 0:
  406. console.log('今天')
  407. break;
  408. case 1:
  409. console.log('昨天')
  410. break;
  411. case 2:
  412. console.log('本周')
  413. break;
  414. }
  415. },
  416. onChange(date, dateString) {
  417. console.log(date, dateString)
  418. },
  419. onReceptionChange(e){
  420. // console.log(e)
  421. //
  422. // console.log(this.model)
  423. // var newModel = this.model
  424. // newModel.receptionValue = e.target.checked
  425. // newModel.reception = 1
  426. // this.$nextTick(() => {
  427. // this.$set(this.model, 'receptionValue', e.target.checked)
  428. // this.$set(this.model, 'reception', e.target.checked?1:0)
  429. // })
  430. this.$forceUpdate();
  431. },
  432. submitOtherData(){
  433. var that = this;
  434. that.confirmLoading = true;
  435. let httpurl = this.url.editOther;
  436. let method = 'put';
  437. var param = {
  438. id:that.model.id,
  439. bookkeeping:that.model.bookkeeping,
  440. remarks:that.model.remarks,
  441. reception:that.model.receptionValue?1:0,
  442. commission:that.model.commissionValue?1:0,
  443. bookkStatus:that.model.bookkStatusValue?1:0,
  444. };
  445. console.log(param);
  446. httpAction(httpurl,param,method).then((res)=>{
  447. if(res.success){
  448. that.$message.success(res.message);
  449. that.$emit('ok');
  450. }else{
  451. that.$message.warning(res.message);
  452. }
  453. }).finally(() => {
  454. that.confirmLoading = false;
  455. })
  456. },
  457. },
  458. }
  459. </script>
  460. <style scoped>
  461. .container{
  462. display: flex;
  463. flex-direction: row;
  464. }
  465. .right{
  466. flex: 3;
  467. }
  468. .content{
  469. width: 100%;
  470. margin: auto;
  471. margin-top: 60px;
  472. }
  473. .item-content{
  474. display: flex;
  475. flex-direction: row;
  476. /*align-items: center;*/
  477. /*justify-items: center;*/
  478. }
  479. .list-container {
  480. display: grid;
  481. grid-template-columns: 1fr 1fr 1fr 1fr;
  482. border: solid 1px #d9d9d9;
  483. width: 260px;
  484. border-radius: 5px;
  485. margin-right: 10px;
  486. overflow: hidden;
  487. /*height: 32px;*/
  488. /*line-height: 32px;*/
  489. }
  490. .list-item {
  491. padding: 0px;
  492. border-right: solid 1px #d9d9d9;
  493. cursor: pointer;
  494. text-align: center;
  495. }
  496. .list-item.active {
  497. background-color: #1890ff;
  498. color: #fff;
  499. }
  500. </style>