agreementUnitDetailForm.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  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. 佣金
  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. export default {
  290. name: 'agreementUnitDetailForm',
  291. components: { CheckInList, ContactsList, CustomerList },
  292. computed: {
  293. formDisabled(){
  294. return this.disabled
  295. },
  296. },
  297. data() {
  298. return {
  299. collapsed: false,
  300. activeMneu: 1,
  301. dateList: ['今天', '昨日', '本周', '更多'],
  302. activeIndex: 0,
  303. model:{
  304. receptionValue:false,
  305. commissionValue:false,
  306. bookkStatusValue:false,
  307. },
  308. otherModel:{
  309. },
  310. labelCol: {
  311. xs: { span: 24 },
  312. sm: { span: 2 },
  313. },
  314. wrapperCol: {
  315. xs: { span: 24 },
  316. sm: { span: 20 },
  317. },
  318. labelCol1: {
  319. xs: { span: 24 },
  320. sm: { span: 8 },
  321. },
  322. wrapperCol1: {
  323. xs: { span: 24 },
  324. sm: { span: 14 },
  325. },
  326. confirmLoading: false,
  327. validatorRules:{
  328. customerName: [
  329. { required: true, message: '请输入客户全称!'},
  330. ],
  331. customerShortName: [
  332. { required: true, message: '请输入客户简称!'},
  333. ],
  334. systemType_dictText: [
  335. { required: true, message: '请选择系统类型!'},
  336. ],
  337. customerNo: [
  338. { required: true, message: '请输入客户编号!'},
  339. ],
  340. contactsName: [
  341. { required: true, message: '请输入主联系人!'},
  342. ],
  343. customerType_dictText: [
  344. { required: true, message: '请选择客户类型!'},
  345. ],
  346. sellerId_dictText: [
  347. { required: true, message: '请选择销售人员!'},
  348. ],
  349. phone: [
  350. { required: true, message: '请输入手机号!'},
  351. ],
  352. status_dictText: [
  353. { required: true, message: '请选择状态!'},
  354. ],
  355. customerSource_dictText: [
  356. { required: true, message: '请选择客户来源!'},
  357. ],
  358. customerIndustry_dictText: [
  359. { required: true, message: '请选择客户行业!'},
  360. ],
  361. },
  362. url: {
  363. editOther: "/business/busMarketAgreementUnit/editOther",
  364. queryById: "/business/busMarketAgreementUnit/queryById",
  365. query_saleList: "/business/busSalesPerson/queryList",
  366. listCheckInRecord: "/business/busMarketAgreementUnit/listCheckInRecord",
  367. },
  368. };
  369. },
  370. created() {
  371. getAction(this.url.listCheckInRecord,{}).then((res)=>{
  372. console.log(res)
  373. if(res.success){
  374. //res.result
  375. }else{
  376. }
  377. })
  378. },
  379. methods: {
  380. add() {
  381. this.edit(this.modelDefault);
  382. },
  383. edit(record) {
  384. console.log(record)
  385. this.model = Object.assign({}, record);
  386. this.visible = true;
  387. this.model.receptionValue = record.reception == 1?true:false;
  388. this.model.commissionValue = record.commission == 1?true:false;
  389. this.model.bookkStatusValue = record.bookkStatus == 1?true:false;
  390. },
  391. toggleCollapsed() {
  392. this.collapsed = !this.collapsed;
  393. },
  394. handleMneuClick(e) {
  395. console.log('click', e);
  396. console.log('click', e.key);
  397. this.activeMneu = e.key;
  398. },
  399. handleClick(index) {
  400. this.activeIndex = index
  401. // this.searchQuery()
  402. console.log(index)
  403. switch (index) {
  404. case 0:
  405. console.log('今天')
  406. break;
  407. case 1:
  408. console.log('昨天')
  409. break;
  410. case 2:
  411. console.log('本周')
  412. break;
  413. }
  414. },
  415. onChange(date, dateString) {
  416. console.log(date, dateString)
  417. },
  418. onReceptionChange(e){
  419. // console.log(e)
  420. //
  421. // console.log(this.model)
  422. // var newModel = this.model
  423. // newModel.receptionValue = e.target.checked
  424. // newModel.reception = 1
  425. // this.$nextTick(() => {
  426. // this.$set(this.model, 'receptionValue', e.target.checked)
  427. // this.$set(this.model, 'reception', e.target.checked?1:0)
  428. // })
  429. this.$forceUpdate();
  430. },
  431. submitOtherData(){
  432. var that = this;
  433. that.confirmLoading = true;
  434. let httpurl = this.url.editOther;
  435. let method = 'put';
  436. var param = {
  437. id:that.model.id,
  438. bookkeeping:that.model.bookkeeping,
  439. remarks:that.model.remarks,
  440. reception:that.model.receptionValue?1:0,
  441. commission:that.model.commissionValue?1:0,
  442. bookkStatus:that.model.bookkStatusValue?1:0,
  443. };
  444. console.log(param);
  445. httpAction(httpurl,param,method).then((res)=>{
  446. if(res.success){
  447. that.$message.success(res.message);
  448. that.$emit('ok');
  449. }else{
  450. that.$message.warning(res.message);
  451. }
  452. }).finally(() => {
  453. that.confirmLoading = false;
  454. })
  455. },
  456. },
  457. }
  458. </script>
  459. <style scoped>
  460. .container{
  461. display: flex;
  462. flex-direction: row;
  463. }
  464. .right{
  465. flex: 3;
  466. }
  467. .content{
  468. width: 100%;
  469. margin: auto;
  470. margin-top: 60px;
  471. }
  472. .item-content{
  473. display: flex;
  474. flex-direction: row;
  475. /*align-items: center;*/
  476. /*justify-items: center;*/
  477. }
  478. .list-container {
  479. display: grid;
  480. grid-template-columns: 1fr 1fr 1fr 1fr;
  481. border: solid 1px #d9d9d9;
  482. width: 260px;
  483. border-radius: 5px;
  484. margin-right: 10px;
  485. overflow: hidden;
  486. /*height: 32px;*/
  487. /*line-height: 32px;*/
  488. }
  489. .list-item {
  490. padding: 0px;
  491. border-right: solid 1px #d9d9d9;
  492. cursor: pointer;
  493. text-align: center;
  494. }
  495. .list-item.active {
  496. background-color: #1890ff;
  497. color: #fff;
  498. }
  499. </style>