Customer.vue 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160
  1. <template>
  2. <div class="custome_container">
  3. <div class="title">
  4. <el-row>
  5. <el-col :span="24">
  6. <div class="top">
  7. <el-input placeholder="客户名称" class="input-demo" v-model="formCondition.customerName"></el-input>
  8. <el-button type="success" style="margin-left: 1%;" @click="loadData">查询</el-button>
  9. <!-- <el-button type="success" style="margin-left: 1%;" @click="addCustomerShow = true">添加</el-button>-->
  10. <el-button type="primary" style="margin-left: 1%;" @click="exportExcel">导出报表</el-button>
  11. </div>
  12. </el-col>
  13. </el-row>
  14. </div>
  15. <!-- 表格部分 -->
  16. <template>
  17. <el-table
  18. class="table"
  19. v-loading="loading"
  20. ref="multipleTable"
  21. :data="coustomerTable"
  22. :height="heightt"
  23. border
  24. tooltip-effect="dark">
  25. <el-table-column
  26. label="客户名称"
  27. prop="customerName"
  28. show-overflow-tooltip>
  29. </el-table-column>
  30. <el-table-column
  31. label="客户密钥"
  32. prop="appSecret"
  33. show-overflow-tooltip>
  34. </el-table-column>
  35. <el-table-column
  36. label="主体名称"
  37. prop="company"
  38. show-overflow-tooltip>
  39. </el-table-column>
  40. <el-table-column
  41. prop="fee"
  42. label="etc卡月费"
  43. show-overflow-tooltip>
  44. </el-table-column>
  45. <el-table-column
  46. prop="bussinessType"
  47. label="业务类型"
  48. show-overflow-tooltip>
  49. <template slot-scope="scope">
  50. <span v-if="scope.row.bussinessType == 2" >无车</span>
  51. <span v-else-if="scope.row.integrationType == 0" >自有车</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column
  55. prop="accountBalance"
  56. label="账号余额"
  57. show-overflow-tooltip>
  58. <template slot-scope="scope">
  59. <span>{{scope.row.accountBalance| rounding}}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column
  63. prop="firstSign"
  64. label="首签日"
  65. show-overflow-tooltip>
  66. </el-table-column>
  67. <el-table-column
  68. prop="accstatus"
  69. label="账号状态"
  70. show-overflow-tooltip>
  71. <template slot-scope="scope">
  72. <span v-if="scope.row.accstatus == 0" style="color:green">正常</span>
  73. <span v-else-if="scope.row.accstatus == 1" style="color: red">停用</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column
  77. label="操作"
  78. width="280">
  79. <template slot-scope="scope" show-overflow-tooltip>
  80. <el-link style="cursor:pointer; color: blue;" @click="investMone(scope.row)">充值</el-link>
  81. <el-link style="margin-left: 10px; cursor:pointer; color: blue;" @click="recInfoList(scope.row)">备案列表</el-link>
  82. <!-- <el-link style="margin-left: 10px; cursor:pointer; color: blue;" @click="carInfo(scope.row)">车辆信息</el-link> -->
  83. <el-link style="margin-left: 10px; cursor:pointer; color: blue;" @click="updateStatus(scope.row)">状态修改</el-link>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. </template>
  88. <!-- 分页 -->
  89. <div class="block">
  90. <el-pagination
  91. @size-change="handleSizeChange"
  92. @current-change="handleCurrentChange"
  93. :current-page="current"
  94. :page-sizes="[6, 8, 10 , 20, 50, 100]"
  95. :page-size="pagesize"
  96. layout="total, sizes, prev, pager, next, jumper"
  97. :total="total">
  98. </el-pagination>
  99. </div>
  100. <el-dialog
  101. @close="addCustomerClose"
  102. :visible.sync="addCustomerShow"
  103. style="font-size: 0px;">
  104. <div class="tou">客戶--添加</div>
  105. <div class="line"></div>
  106. <el-form
  107. label-position="right"
  108. label-width="80px"
  109. :rules="custAddrules"
  110. ref="customerForm"
  111. :model="customer">
  112. <el-form-item label="客戶名称" prop="customerName">
  113. <el-input v-model="customer.customerName" auto-complete="off" placeholder="请输入用户名"></el-input>
  114. </el-form-item>
  115. <el-form-item label="客户主体" prop="customerCompany">
  116. <el-input v-model="customer.company" auto-complete="off" placeholder="请输入主体名称"></el-input>
  117. </el-form-item>
  118. <el-form-item label="业务类型" prop="bussinessType">
  119. <el-select v-model="customer.bussinessType" @change="changeRow" placeholder="请选择业务类型" style="width: 100%">
  120. <el-option
  121. v-for="item in roleList"
  122. :key="item.value"
  123. :label="item.label"
  124. :value="item.value">
  125. </el-option>
  126. </el-select>
  127. </el-form-item>
  128. <el-form-item label="ETC卡月费" v-show="showEtcFee" prop="customerCompany">
  129. <el-input v-model="customer.fee" auto-complete="off" placeholder="etc卡月费用"></el-input>
  130. </el-form-item>
  131. </el-form>
  132. <div slot="footer" class="dialog-footer">
  133. <el-button @click="addCustomerShow = false" type="info">取 消</el-button>
  134. <el-button type="primary" @click="addCustomer('customerForm')">新 增</el-button>
  135. </div>
  136. </el-dialog>
  137. <!-- 修改锁定和解锁状态 -->
  138. <el-dialog
  139. @close="addCustomerClose"
  140. :visible.sync="changeStatus"
  141. style="font-size: 0px;">
  142. <div class="tou">客户--修改状态</div>
  143. <div class="line"></div>
  144. <el-form
  145. label-position="right"
  146. label-width="80px"
  147. :model="customer">
  148. <el-form-item label="用户名">
  149. <el-input v-model="customer.customerName" disabled="true" auto-complete="off" placeholder="请输入用户名"></el-input>
  150. </el-form-item>
  151. <el-form-item label="状态">
  152. <el-select v-model="customer.accstatus" placeholder="请选择状态" style="width: 100%">
  153. <el-option
  154. v-for="item in optionone"
  155. :key="item.value"
  156. :label="item.label"
  157. :value="item.value">
  158. </el-option>
  159. </el-select>
  160. </el-form-item>
  161. </el-form>
  162. <div slot="footer" class="dialog-footer">
  163. <el-button @click="changeStatus = false" type="info">取 消</el-button>
  164. <el-button type="primary" @click="changeStatusM">修 改</el-button>
  165. </div>
  166. </el-dialog>
  167. <el-dialog
  168. @close="addCustomerClose"
  169. :visible.sync="recVisList"
  170. style="font-size: 0px;">
  171. <div class="tou">客户--备案列表 <el-button type="success" size="small" style="margin-left: 1%;" @click="showAddCustomerRec">添加</el-button></div>
  172. <div class="line"></div>
  173. <!-- 表格部分 -->
  174. <template>
  175. <el-table
  176. v-loading="loading"
  177. ref="multipleTable"
  178. :data="customeRecQueryListTable"
  179. height="370px"
  180. border
  181. tooltip-effect="dark">
  182. <el-table-column
  183. label="客户名称"
  184. prop="customerName"
  185. show-overflow-tooltip>
  186. </el-table-column>
  187. <el-table-column
  188. prop="companyNum"
  189. label="企业编号"
  190. show-overflow-tooltip>
  191. </el-table-column>
  192. <el-table-column
  193. prop="contrantNum"
  194. label="协议编号"
  195. show-overflow-tooltip>
  196. </el-table-column>
  197. <el-table-column
  198. prop="companyName"
  199. label="公司名称"
  200. show-overflow-tooltip>
  201. </el-table-column>
  202. <el-table-column
  203. prop="companyReferencenum"
  204. label="税号"
  205. show-overflow-tooltip>
  206. </el-table-column>
  207. <el-table-column
  208. prop="companyOpenbank"
  209. label="开户行"
  210. show-overflow-tooltip>
  211. </el-table-column>
  212. <!-- <el-table-column
  213. prop="companyOpenbankAcc"
  214. label="银行账号"
  215. show-overflow-tooltip>
  216. </el-table-column> -->
  217. <el-table-column
  218. prop="recStatus"
  219. label="备案状态"
  220. show-overflow-tooltip>
  221. <template slot-scope="scope">
  222. <span v-if="scope.row.recStatus == 0">备案中</span>
  223. <span v-else-if="scope.row.recStatus == 1" style="color: green">备案成功</span>
  224. <span v-else-if="scope.row.recStatus == 2" style="color: red">备案失败</span>
  225. <span v-else-if="scope.row.recStatus == 3" style="color: red">等待协议上传</span>
  226. <span v-else-if="scope.row.recStatus == 4" style="color: red">手工停用</span>
  227. </template>
  228. </el-table-column>
  229. <el-table-column
  230. prop="contractSuc"
  231. label="协议上传状态"
  232. width="120"
  233. show-overflow-tooltip>
  234. <template slot-scope="scope">
  235. <span v-if="scope.row.contractSuc == 1" style="color: green">协议上传成功</span>
  236. <span v-else-if="scope.row.contractSuc == 2" style="color: red">协议未上传</span>
  237. </template>
  238. </el-table-column>
  239. <el-table-column
  240. prop="interType"
  241. label="对接方式"
  242. show-overflow-tooltip>
  243. <template slot-scope="scope">
  244. <span v-if="scope.row.interType == 0">接口</span>
  245. <span v-if="scope.row.interType == 1">平台</span>
  246. <span v-if="scope.row.interType == 3">平台</span>
  247. </template>
  248. </el-table-column>
  249. <el-table-column
  250. prop="bussinessType"
  251. label="业务类型"
  252. show-overflow-tooltip>
  253. <template slot-scope="scope">
  254. <span v-if="scope.row.bussinessType == 0">自有车</span>
  255. <span v-if="scope.row.bussinessType == 1">外协车</span>
  256. <span v-if="scope.row.bussinessType == 2">无车</span>
  257. </template>
  258. </el-table-column>
  259. <el-table-column
  260. label="操作"
  261. width="280">
  262. <template slot-scope="scope" show-overflow-tooltip>
  263. <el-link style="margin-left: 10px; cursor:pointer; color: blue;" @click="recInfo(scope.row)">备案信息</el-link>
  264. <el-link style="margin-left: 10px; cursor:pointer; color: blue;" @click="concatInfo(scope.row)">协议信息</el-link>
  265. <el-link v-if="scope.row.recStatus == 1" style="margin-left: 10px; cursor:pointer; color: blue;" @click="stopUse(scope.row)">停用</el-link>
  266. </template>
  267. </el-table-column>
  268. </el-table>
  269. </template>
  270. </el-dialog>
  271. <el-dialog
  272. @close="custRecClose"
  273. :visible.sync="concatVis"
  274. style="font-size: 0px;">
  275. <div class="tou">客户-协议信息</div>
  276. <div class="line"></div>
  277. <el-form
  278. label-position="right"
  279. label-width="80px"
  280. :model="formUserList">
  281. <el-row :span="24">
  282. <el-col :span="12">
  283. <el-form-item label-width=120px label="协议类型" prop="serviceType">
  284. <el-select v-model="customerRec.serviceType" placeholder="运营范围" style="width: 100%">
  285. <el-option
  286. v-for="item in serviceTypeList"
  287. :key="item.id"
  288. :label="item.name"
  289. :value="item.id">
  290. </el-option>
  291. </el-select>
  292. </el-form-item>
  293. </el-col>
  294. <el-col :span="12" v-show= false>
  295. <el-form-item label-width=120px label="协议文件名">
  296. <el-input v-model="customerRec.contractFileName" auto-complete="off" :disabled=disable ></el-input>
  297. </el-form-item>
  298. </el-col>
  299. <el-col :span="12" v-show= true>
  300. <el-form-item label-width=120px label="协议文件" prop="contractFileName">
  301. <el-upload
  302. class="avatar-uploader"
  303. style="width: 100%"
  304. action="#"
  305. :show-file-list="false"
  306. :http-request="httpRequest">
  307. <el-input label-width=120px v-model="customerRec.contractFileName" auto-complete="off" style="width: 100%"></el-input>
  308. <!-- <el-button type="primary" @click="getFile(index)">选取文件</el-button> -->
  309. </el-upload>
  310. <el-input label-width=120px v-model="customerRec.base64Str" v-show="false" auto-complete="off"></el-input>
  311. </el-form-item>
  312. </el-col>
  313. </el-row>
  314. <el-row :span="24">
  315. <el-col :span="12">
  316. <el-form-item label-width=120px label="服务开始时间">
  317. <!-- <el-input v-model="customerRec.serviceStartTime" auto-complete="off" :disabled=false ></el-input> -->
  318. <el-date-picker v-model="customerRec.serviceStartTime" type="date" value-format="yyyy-MM-dd HH:mm:SS" placeholder="服务开始时间"></el-date-picker>
  319. </el-form-item>
  320. </el-col>
  321. <el-col :span="12">
  322. <el-form-item label-width=120px label="服务结束时间">
  323. <!-- <el-input v-model="customerRec.serviceEndTime" auto-complete="off" :disabled=false ></el-input> -->
  324. <el-date-picker v-model="customerRec.serviceEndTime" type="date" value-format="yyyy-MM-dd HH:mm:SS" placeholder="服务结束时间"></el-date-picker>
  325. </el-form-item>
  326. </el-col>
  327. </el-row>
  328. </el-form>
  329. <div slot="footer" class="dialog-footer">
  330. <el-button @click="contractDownload" v-show="customerRec.lowerFileName" type="primary">下游文件下载</el-button>
  331. <el-button @click="contractAdd" type="primary">协议上传</el-button>
  332. </div>
  333. </el-dialog>
  334. <el-dialog
  335. @close="custRecClose"
  336. :visible.sync="recVis"
  337. style="font-size: 0px;">
  338. <div class="tou">客户--备案信息</div>
  339. <div class="line"></div>
  340. <el-form
  341. label-position="right"
  342. label-width="80px"
  343. :model="formUserList">
  344. <el-row :span="24">
  345. <el-col :span="12">
  346. <el-form-item label-width=120px label="客户名称">
  347. <el-input v-model="customerRec.customerName" auto-complete="off" :disabled= true ></el-input>
  348. </el-form-item>
  349. </el-col>
  350. <el-col :span="12">
  351. <el-form-item label-width=120px label="公司负责人">
  352. <el-input v-model="customerRec.companyLeader" :disabled=disable style="width: 100%"></el-input>
  353. </el-form-item>
  354. </el-col>
  355. </el-row>
  356. <el-row :span="24">
  357. <el-col :span="12">
  358. <el-form-item label-width=120px label="负责人手机号">
  359. <el-input v-model="customerRec.companyLeaderPhone" auto-complete="off" :disabled=disable ></el-input>
  360. </el-form-item>
  361. </el-col>
  362. <el-col :span="12">
  363. <el-form-item label-width=120px label="公司名称">
  364. <el-input v-model="customerRec.companyName" :disabled=disable style="width: 100%"></el-input>
  365. </el-form-item>
  366. </el-col>
  367. </el-row>
  368. <el-row :span="24">
  369. <el-col :span="12">
  370. <el-form-item label-width=120px label="公司税号">
  371. <el-input v-model="customerRec.companyReferencenum" auto-complete="off" :disabled=disable ></el-input>
  372. </el-form-item>
  373. </el-col>
  374. <el-col :span="12">
  375. <el-form-item label-width=120px label="公司开户行">
  376. <el-input v-model="customerRec.companyOpenbank" :disabled=disable style="width: 100%"></el-input>
  377. </el-form-item>
  378. </el-col>
  379. </el-row>
  380. <el-row :span="24">
  381. <el-col :span="12">
  382. <el-form-item label-width=120px label="公司开户行账号">
  383. <el-input v-model="customerRec.companyOpenbankAcc" auto-complete="off" :disabled=disable ></el-input>
  384. </el-form-item>
  385. </el-col>
  386. <el-col :span="12">
  387. <el-form-item label-width=120px label="公司地址">
  388. <el-input v-model="customerRec.companyAdress" style="width: 100%" :disabled=disable></el-input>
  389. </el-form-item>
  390. </el-col>
  391. </el-row>
  392. <el-row :span="24">
  393. <el-col :span="12">
  394. <el-form-item label-width=120px label="公司电话">
  395. <el-input v-model="customerRec.companyPhone" auto-complete="off" :disabled=disable ></el-input>
  396. </el-form-item>
  397. </el-col>
  398. <el-col :span="12">
  399. <el-form-item label-width=120px label="业务类型">
  400. <el-select v-model="customerRec.bussinessType" placeholder="业务类型" :disabled=disable style="width: 100%">
  401. <el-option
  402. v-for="item in bussinessTypeList"
  403. :key="item.id"
  404. :label="item.name"
  405. :value="item.id">
  406. </el-option>
  407. </el-select>
  408. </el-form-item>
  409. </el-col>
  410. </el-row>
  411. <el-row :span="24">
  412. <el-col :span="12">
  413. <!-- <el-form-item label-width=120px label="公司类型">
  414. <el-input v-model="customerRec.companyType" auto-complete="off" readonly=true ></el-input>
  415. </el-form-item> -->
  416. <el-form-item label-width=120px label="公司类型" prop="companyType">
  417. <el-select v-model="customerRec.companyType" placeholder="公司类型" style="width: 100%" :disabled=disable>
  418. <el-option
  419. v-for="item in companyList"
  420. :key="item.id"
  421. :label="item.name"
  422. :value="item.id">
  423. </el-option>
  424. </el-select>
  425. </el-form-item>
  426. </el-col>
  427. <el-col :span="12">
  428. <!-- <el-form-item label-width=120px label="公司类型">
  429. <el-input v-model="customerRec.companyType" auto-complete="off" readonly=true ></el-input>
  430. </el-form-item> -->
  431. <el-form-item label-width=120px label="运营范围" prop="operatingRangeType">
  432. <el-select v-model="customerRec.operatingRangeType" placeholder="运营范围" style="width: 100%" :disabled=disable>
  433. <el-option
  434. v-for="item in operatingRangeList"
  435. :key="item.id"
  436. :label="item.name"
  437. :value="item.id">
  438. </el-option>
  439. </el-select>
  440. </el-form-item>
  441. </el-col>
  442. </el-row>
  443. </el-form>
  444. <div slot="footer" class="dialog-footer">
  445. <el-button @click="customerRecConform" type="primary">信息上传</el-button>
  446. <el-button type="primary" @click="generateWord">生成文档</el-button>
  447. </div>
  448. </el-dialog>
  449. <el-dialog
  450. @close="custRecClose"
  451. :visible.sync="addCustomerRecShow1"
  452. style="font-size: 0px;">
  453. <div class="tou">客户--备案信息</div>
  454. <div class="line"></div>
  455. <el-form
  456. label-position="right"
  457. label-width="80px"
  458. :rules="custRecAddrules"
  459. ref="recRuleForm"
  460. :model="customerRec">
  461. <el-row :span="24">
  462. <el-col :span="12">
  463. <el-form-item label-width=120px label="客户名称">
  464. <el-input v-model="customerRec.customerName" auto-complete="off" :disabled=true ></el-input>
  465. </el-form-item>
  466. </el-col>
  467. <el-col :span="12">
  468. <el-form-item label-width=120px label="公司负责人" prop="companyLeader">
  469. <el-input v-model="customerRec.companyLeader" style="width: 100%"></el-input>
  470. </el-form-item>
  471. </el-col>
  472. </el-row>
  473. <el-row :span="24">
  474. <el-col :span="12">
  475. <el-form-item label-width=120px label="负责人手机号" prop="companyLeaderPhone">
  476. <el-input v-model="customerRec.companyLeaderPhone" auto-complete="off" ></el-input>
  477. </el-form-item>
  478. </el-col>
  479. <el-col :span="12">
  480. <el-form-item label-width=120px label="公司名称" prop="companyName">
  481. <el-input v-model="customerRec.companyName" style="width: 100%"></el-input>
  482. </el-form-item>
  483. </el-col>
  484. </el-row>
  485. <el-row :span="24">
  486. <el-col :span="12">
  487. <el-form-item label-width=120px label="公司税号" prop="companyReferencenum">
  488. <el-input v-model="customerRec.companyReferencenum" auto-complete="off" ></el-input>
  489. </el-form-item>
  490. </el-col>
  491. <el-col :span="12">
  492. <el-form-item label-width=120px label="公司开户行" prop="companyOpenbank">
  493. <el-input v-model="customerRec.companyOpenbank" style="width: 100%"></el-input>
  494. </el-form-item>
  495. </el-col>
  496. </el-row>
  497. <el-row :span="24">
  498. <el-col :span="12">
  499. <el-form-item label-width=120px label="公司开户行账号" prop="companyOpenbankAcc">
  500. <el-input v-model="customerRec.companyOpenbankAcc" auto-complete="off" ></el-input>
  501. </el-form-item>
  502. </el-col>
  503. <el-col :span="12">
  504. <el-form-item label-width=120px label="公司地址" prop="companyAdress">
  505. <el-input v-model="customerRec.companyAdress" style="width: 100%" ></el-input>
  506. </el-form-item>
  507. </el-col>
  508. </el-row>
  509. <el-row :span="24">
  510. <el-col :span="12">
  511. <el-form-item label-width=120px label="公司电话" prop="companyPhone">
  512. <el-input v-model="customerRec.companyPhone" auto-complete="off" ></el-input>
  513. </el-form-item>
  514. </el-col>
  515. <el-col :span="12">
  516. <el-form-item label-width=120px label="业务类型" prop="bussinessType">
  517. <el-select v-model="customerRec.bussinessType" placeholder="业务类型" style="width: 100%">
  518. <el-option
  519. v-for="item in bussinessTypeList"
  520. :key="item.id"
  521. :label="item.name"
  522. :value="item.id">
  523. </el-option>
  524. </el-select>
  525. </el-form-item>
  526. </el-col>
  527. </el-row>
  528. <el-row :span="24">
  529. <el-col :span="12">
  530. <!-- <el-form-item label-width=120px label="公司类型">
  531. <el-input v-model="customerRec.companyType" auto-complete="off" readonly=true ></el-input>
  532. </el-form-item> -->
  533. <el-form-item label-width=120px label="公司类型" prop="companyType">
  534. <el-select v-model="customerRec.companyType" placeholder="公司类型" style="width: 100%">
  535. <el-option
  536. v-for="item in companyList"
  537. :key="item.id"
  538. :label="item.name"
  539. :value="item.id">
  540. </el-option>
  541. </el-select>
  542. </el-form-item>
  543. </el-col>
  544. <el-col :span="12">
  545. <!-- <el-form-item label-width=120px label="公司类型">
  546. <el-input v-model="customerRec.companyType" auto-complete="off" readonly=true ></el-input>
  547. </el-form-item> -->
  548. <el-form-item label-width=120px label="运营范围" prop="operatingRangeType">
  549. <el-select v-model="customerRec.operatingRangeType" placeholder="运营范围" style="width: 100%">
  550. <el-option
  551. v-for="item in operatingRangeList"
  552. :key="item.id"
  553. :label="item.name"
  554. :value="item.id">
  555. </el-option>
  556. </el-select>
  557. </el-form-item>
  558. </el-col>
  559. </el-row>
  560. <el-row :span="24">
  561. <el-col :span="12">
  562. <el-form-item label-width=120px label="协议类型" prop="serviceType">
  563. <el-select v-model="customerRec.serviceType" placeholder="运营范围" style="width: 100%">
  564. <el-option
  565. v-for="item in serviceTypeList"
  566. :key="item.id"
  567. :label="item.name"
  568. :value="item.id">
  569. </el-option>
  570. </el-select>
  571. </el-form-item>
  572. </el-col>
  573. <el-col :span="12">
  574. <el-form-item label-width=120px label="协议文件" prop="contractFileName">
  575. <el-upload
  576. class="avatar-uploader"
  577. style="width: 100%"
  578. action="#"
  579. :show-file-list="false"
  580. :http-request="httpRequest">
  581. <el-input label-width=120px v-model="customerRec.contractFileName" auto-complete="off" style="width: 100%"></el-input>
  582. <!-- <el-button type="primary" @click="getFile(index)">选取文件</el-button> -->
  583. </el-upload>
  584. <el-input label-width=120px v-model="customerRec.base64Str" v-show="false" auto-complete="off"></el-input>
  585. </el-form-item>
  586. </el-col>
  587. </el-row>
  588. <el-row :span="24">
  589. <el-col :span="12">
  590. <el-form-item label-width=120px label="服务开始时间" prop="serviceStartTime">
  591. <!-- <el-input v-model="customerRec.serviceStartTime" auto-complete="off" ></el-input> -->
  592. <el-date-picker v-model="customerRec.serviceStartTime" type="date" value-format="yyyy-MM-dd HH:mm:SS" placeholder="服务开始时间"></el-date-picker>
  593. </el-form-item>
  594. </el-col>
  595. <el-col :span="12">
  596. <el-form-item label-width=120px label="服务结束时间" prop="serviceEndTime">
  597. <!-- <el-input v-model="customerRec.serviceEndTime" auto-complete="off" ></el-input> -->
  598. <el-date-picker v-model="customerRec.serviceEndTime" type="date" value-format="yyyy-MM-dd HH:mm:SS" placeholder="服务结束时间"></el-date-picker>
  599. </el-form-item>
  600. </el-col>
  601. </el-row>
  602. </el-form>
  603. <div slot="footer" class="dialog-footer">
  604. <el-button @click="customerRecAdd" type="primary">保存</el-button>
  605. </div>
  606. </el-dialog>
  607. <el-dialog
  608. @close="addCustomerClose"
  609. :visible.sync="accIsclose"
  610. style="font-size: 0px;">
  611. <div class="tou">客户--充值</div>
  612. <div class="line"></div>
  613. <el-form
  614. label-position="right"
  615. label-width="80px"
  616. :model="customer">
  617. <el-form-item label="客户名称">
  618. <el-input v-model="customer.customerName" auto-complete="off" readonly=true></el-input>
  619. </el-form-item>
  620. <el-form-item label="账号余额">
  621. <el-input v-model="customer.accountBalance" auto-complete="off" readonly=true></el-input>
  622. </el-form-item>
  623. <el-form-item label="充值金额">
  624. <el-input v-model="customerRecharge.rechargeMony" @input="changeAmt" auto-complete="off"></el-input>
  625. </el-form-item>
  626. </el-form>
  627. <div slot="footer" class="dialog-footer">
  628. <el-button @click="accIsclose = false" type="info">取 消</el-button>
  629. <el-button type="primary" @click="customRecharge">充值</el-button>
  630. </div>
  631. </el-dialog>
  632. </div>
  633. </template>
  634. <script type="text/javascript">
  635. import FileSaver from "file-saver";
  636. import XLSX from "xlsx";
  637. export default {
  638. data(){
  639. return{
  640. formCondition:{
  641. customerName:'',
  642. startTime:''
  643. },
  644. hightt:'0px',
  645. coustomerTable:[],
  646. coustomerCarTable:[],
  647. customeRecQueryListTable:[],
  648. companyList:[{id:1,name:"行业用户"},{id:2,name:"自营平台"},{id:3,name:"合作商户"}],
  649. bussinessTypeList:[{id:"0",name:"自有车"},{id:"2",name:"无车"}],
  650. operatingRangeList:[{id:1,name:"快递"},
  651. {id:2,name:"速运"},
  652. {id:3,name:"货运代理"},
  653. {id:4,name:"普通货运"},
  654. {id:5,name:"专线运输"},
  655. {id:6,name:"其他"}],
  656. serviceTypeList:[{id:1,name:"一级产品"},{id:2,name:"二级产品"},{id:3,name:"三级产品"}],
  657. custAddrules: {
  658. customerName: [
  659. { required: true, message: '请输入', trigger: 'blur' },
  660. { min: 3, max: 100, message: '长度在 3 到 100个字符', trigger: 'blur' }
  661. ],
  662. customerCompany: [
  663. { required: true, message: '请输入', trigger: 'blur' },
  664. { min: 3, max: 100, message: '长度在 3 到 300个字符', trigger: 'blur' }
  665. ],
  666. bussinessType: [
  667. { required: true, message: '请输入', trigger: 'blur' },
  668. ]
  669. },
  670. custRecAddrules: {
  671. customerName: [
  672. { required: true, message: '请输入', trigger: 'blur' },
  673. ],
  674. companyLeader: [
  675. { required: true, message: '请输入', trigger: 'blur' },
  676. ],
  677. companyLeaderPhone: [
  678. { required: true, message: '请输入', trigger: 'blur' },
  679. ],
  680. companyName: [
  681. { required: true, message: '请输入', trigger: 'blur' },
  682. ],
  683. companyReferencenum: [
  684. { required: true, message: '请输入', trigger: 'blur' },
  685. ],
  686. companyOpenbank: [
  687. { required: true, message: '请输入', trigger: 'blur' },
  688. ],
  689. companyOpenbankAcc: [
  690. { required: true, message: '请输入', trigger: 'blur' },
  691. ],
  692. companyAdress: [
  693. { required: true, message: '请输入', trigger: 'blur' },
  694. ],
  695. companyPhone: [
  696. { required: true, message: '请输入', trigger: 'blur' },
  697. ],
  698. bussinessType: [
  699. { required: true, message: '请输入', trigger: 'blur' },
  700. ],
  701. companyType: [
  702. { required: true, message: '请输入', trigger: 'blur' },
  703. ],
  704. operatingRangeType: [
  705. { required: true, message: '请输入', trigger: 'blur' },
  706. ],
  707. serviceType: [
  708. { required: true, message: '请输入', trigger: 'blur' },
  709. ],
  710. serviceStartTime: [
  711. { required: true, message: '请输入', trigger: 'blur' },
  712. ],
  713. serviceEndTime: [
  714. { required: true, message: '请输入', trigger: 'blur' },
  715. ]
  716. },
  717. customerRec:{
  718. },
  719. customer:{
  720. id:0,
  721. customerName:'',
  722. usenumAll:'',
  723. invoiceTime:'',
  724. usenumInterface:'',
  725. usenumPlat:'',
  726. accountBalance:'',
  727. bussinessType:'',
  728. integrationType:'',
  729. firstSign:'',
  730. accstatus:'0',
  731. company:''
  732. },
  733. customerRecharge:{
  734. customerName:'',
  735. rechargeMony:''
  736. },
  737. queryParam:{
  738. },
  739. optionone: [{
  740. value: 0,
  741. label: '正常'
  742. }, {
  743. value: 1,
  744. label: '停用'
  745. }],
  746. roleList: [{
  747. value: 0,
  748. label: '自有车'
  749. }, {
  750. value: 2,
  751. label: '无车'
  752. }],
  753. current: 1,
  754. pagesize: 8,
  755. total:'',
  756. addCustomerShow:false,
  757. addCustomerRecShow1:false,
  758. changeStatus:false,
  759. recVis:false,
  760. concatVis:false,
  761. accIsclose:false,
  762. carRecclose:false,
  763. recVisList:false,
  764. disable:false,
  765. showEtcFee:false
  766. }
  767. },
  768. created() {
  769. this.heightt = tableHeight;
  770. this.loadData();
  771. },
  772. filters: {
  773. rounding (value) {
  774. return value.toFixed(2)
  775. }
  776. },
  777. methods:{
  778. showAddCustomerRec(){
  779. this.addCustomerRecShow1 =true;
  780. this.customerRec.customerName = this.customer.customerName;
  781. },
  782. changeAmt(value){
  783. value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '');
  784. this.customerRecharge.rechargeMony = value;
  785. },
  786. getBase64(file) {
  787. this.customerRec.contractFileName = file.name;
  788. this.$forceUpdate()
  789. return new Promise((resolve, reject) => {
  790. let reader = new FileReader();
  791. let fileResult = "";
  792. reader.readAsDataURL(file);
  793.      //开始转
  794. reader.onload = function() {
  795. fileResult = reader.result;
  796. };
  797.      //转 失败
  798. reader.onerror = function(error) {
  799. reject(error);
  800. };
  801.      //转 结束 咱就 resolve 出去
  802. reader.onloadend = function() {
  803. resolve(fileResult);
  804. };
  805. });
  806. },
  807. httpRequest(data){  // 没事儿就打印data看看呗    //这是限制上传文件类型
  808. const isPFX = data.file.type === "application/pdf";
  809. const isLt2M = data.file.size / 1024 / 1024 < 10;
  810. if (!isPFX) {
  811. this.$message.error("上传文件只能是pdf格式!");
  812. }else if (!isLt2M) {
  813. this.$message.error("上传文件大小不能超过 10MB!");
  814. }else{
  815. // 转base64
  816. this.getBase64(data.file).then(resBase64 => {
  817. this.fileBase64 = resBase64.split(',')[1]  //直接拿到base64信息
  818. this.customerRec.base64Str = resBase64.split(',')[1];
  819. })
  820. this.$message.success('文件上传成功');
  821. }},
  822. addCustomer(formName){
  823. this.$refs[formName].validate(async (valid) => {
  824. if(valid) {
  825. const response = await this.$http.post(`customer/addCustomer`, this.customer);
  826. if(response.data.code === 0) {
  827. this.loadData();
  828. this.addCustomerShow = false;
  829. this.$message({
  830. type: 'success',
  831. message: '添加成功'
  832. });
  833. }else {
  834. this.$message({
  835. type: 'error',
  836. message: '添加失败'
  837. });
  838. }
  839. }else {
  840. this.$message.error('请查看是否有选项未填写或填错项');
  841. return false;
  842. }
  843. })
  844. },
  845. investMone(recoder){
  846. this.customer = this.customer= JSON.parse(JSON.stringify(recoder ));;
  847. this.customerRecharge['rechargeMony']='';
  848. this.accIsclose = true;
  849. },
  850. async customRecharge(){
  851. this.customerRecharge['customerName'] = this.customer['customerName'];
  852. const response = await this.$http.post(`customer/customRecharge`, this.customerRecharge);
  853. if(response.data.code === 0) {
  854. this.loadData();
  855. this.accIsclose = false;
  856. this.$message({
  857. type: 'success',
  858. message: '充值成功'
  859. });
  860. }else {
  861. this.$message({
  862. type: 'error',
  863. message: '充值失败'
  864. });
  865. }
  866. },
  867. async changeStatusM(){
  868. const response = await this.$http.post(`customer/updateCustomer`, this.customer);
  869. if(response.data.code === 0) {
  870. this.loadData();
  871. this.changeStatus = false;
  872. this.$message({
  873. type: 'success',
  874. message: '修改成功'
  875. });
  876. }else {
  877. this.$message({
  878. type: 'error',
  879. message: '修改失败'
  880. });
  881. }
  882. },
  883. updateStatus(recoder){
  884. this.changeStatus = true;
  885. this.customer= JSON.parse(JSON.stringify(recoder ));
  886. },
  887. async recInfo(recoder){
  888. this.recVis = true;
  889. const response = await this.$http.post(`lowerService/customeRecQuery`, {"customerName":recoder.customerName,"companyName":recoder.companyName});
  890. if (response.data.code === 0) {
  891. this.customerRec = response.data.data;
  892. this.disable = !((this.customerRec.interType ==1) && (this.customerRec.recStatus ==2 || this.customerRec.recStatus ==0));
  893. }
  894. },
  895. async concatInfo(recoder){
  896. //this.recVis = true;
  897. this.concatVis = true;
  898. const response = await this.$http.post(`lowerService/customeRecQuery`, {"customerName":recoder.customerName,"companyName":recoder.companyName});
  899. if (response.data.code === 0) {
  900. this.customerRec = response.data.data;
  901. this.disable = !((this.customerRec.interType ==1) && (this.customerRec.recStatus ==2));
  902. }
  903. },
  904. stopUse(recoder){
  905. this.$confirm('此操作将任务状态改为删除状态, 是否继续?', '提示', {
  906. confirmButtonText: '确定',
  907. cancelButtonText: '取消',
  908. type: 'warning'
  909. }).then(async () => {
  910. const response = await this.$http.post("customer/customeRecStop", {"customerName":recoder.customerName,"companyName":recoder.companyName});
  911. if (response.data.code === 0) {
  912. this.$message({
  913. type: 'success',
  914. message: '停用成功'
  915. });
  916. recoder.recStatus=4;
  917. }else{
  918. this.$message({
  919. type: 'error',
  920. message: '停用失败:'+response.data.msg
  921. });
  922. }
  923. }).catch(() => {
  924. //几点取消的提示
  925. });
  926. },
  927. async recInfoList(recoder){
  928. this.customer.customerName =recoder.customerName;
  929. const response = await this.$http.post(`lowerService/customeRecQueryList`, {"customerName":recoder.customerName});
  930. if (response.data.code === 0) {
  931. this.customeRecQueryListTable = response.data.data;
  932. }
  933. this.recVisList = true;
  934. },
  935. async carInfo(recoder){
  936. const response = await this.$http.post(`lowerService/customerCarRecQuery`, {"customerName":recoder.customerName});
  937. if (response.data.code === 0) {
  938. this.coustomerCarTable = response.data.data;
  939. }
  940. this.carRecclose = true;
  941. },
  942. // 清空表单数据
  943. addCustomerClose() {
  944. for (var key in this.customer) {
  945. this.customer[key] = '';
  946. };
  947. this.customer['id'] = 0;
  948. this.customer['accstatus'] = 0;
  949. this.current = 1;
  950. this.pagesize = 8;
  951. },
  952. custRecClose() {
  953. this.recVis = false,
  954. this.concatVis = false,
  955. this.addCustomerRecShow1 =false;
  956. this.customerRec = {};
  957. },
  958. async customerRecAdd(){
  959. console.log(this.customerRec);
  960. this.$refs['recRuleForm'].validate(async (valid) => {
  961. if(valid){
  962. const response = await this.$http.post(`customer/customerRecAdd`, this.customerRec);
  963. if(response.data.code === 0) {
  964. this.loadData();
  965. this.addCustomerRecShow1 = false;
  966. this.$message({
  967. type: 'success',
  968. message: '保存成功'
  969. });
  970. }else {
  971. this.$message({
  972. type: 'error',
  973. message: '保存失败:'+response.data.msg
  974. });
  975. }
  976. }
  977. });
  978. },
  979. generateWord(){
  980. const token = sessionStorage.getItem('token');
  981. window.open(hostUrl+'customer/generateWord?customerRecId='+this.customerRec['id']+'&token='+token);
  982. },
  983. async customerRecConform(){
  984. const response = await this.$http.post(`customer/customeRec`, this.customerRec);
  985. debugger
  986. if(response.data.code === 0) {
  987. this.loadData();
  988. this.recInfoList(this.customerRec)
  989. this.changeStatus = false;
  990. this.$message({
  991. type: 'success',
  992. message: '备案成功'
  993. });
  994. }else {
  995. this.$message({
  996. type: 'error',
  997. message: '备案失败:'+response.data.msg
  998. });
  999. }
  1000. },
  1001. changeRow(id){
  1002. if(id == 0){
  1003. this.showEtcFee =true
  1004. }else{
  1005. this.showEtcFee =false
  1006. }
  1007. },
  1008. async contractAdd(){
  1009. const response = await this.$http.post(`customer/contractAdd`, this.customerRec);
  1010. if(response.data.code === 0) {
  1011. this.loadData();
  1012. this.recInfoList(this.customerRec)
  1013. this.changeStatus = false;
  1014. this.$message({
  1015. type: 'success',
  1016. message: '协议上传成功'
  1017. });
  1018. }else {
  1019. this.$message({
  1020. type: 'error',
  1021. message: '协议上传失败:'+response.data.msg
  1022. });
  1023. }
  1024. },
  1025. contractDownload(){
  1026. const token = sessionStorage.getItem('token');
  1027. window.open(hostUrl+'customer/contractDownload?customerRecId='+this.customerRec['id']+'&token='+token);
  1028. },
  1029. // 列表展示
  1030. async loadData() {
  1031. const formData = new FormData();
  1032. formData.append('current', this.current);
  1033. formData.append('size', this.pagesize);
  1034. formData.append('customerName', this.formCondition.customerName);
  1035. const response = await this.$http.post(`customer/findCustomer`, formData);
  1036. if (response.data.code === 0) {
  1037. this.coustomerTable = response.data.data.records;
  1038. this.total = response.data.data.total;
  1039. }
  1040. },
  1041. // 分页方法
  1042. handleSizeChange(val) {
  1043. this.pagesize = val;
  1044. this.loadData();
  1045. },
  1046. handleCurrentChange(val) {
  1047. this.current = val;
  1048. this.loadData();
  1049. // console.log(`当前页: ${val}`);
  1050. },
  1051. async exportExcel() {
  1052. let curr = this.current;
  1053. let pagesize1 = this.pagesize;
  1054. this.current = 1;
  1055. this.pagesize = this.total;
  1056. await this.loadData();
  1057. // 设置当前日期
  1058. let time = new Date();
  1059. //console.log(time);
  1060. let year = time.getFullYear();
  1061. let month = time.getMonth() + 1;
  1062. let day = time.getDate();
  1063. let name = "客户管理查询列表_"+year + "" + month + "" + day;
  1064. // console.log(name)
  1065. /* generate workbook object from table */
  1066. // .table要导出的是哪一个表格
  1067. var wb = XLSX.utils.table_to_book(document.querySelector(".table"),{ raw: true });
  1068. /* get binary string as output */
  1069. var wbout = XLSX.write(wb, {
  1070. bookType: "xlsx",
  1071. bookSST: true,
  1072. type: "array"
  1073. });
  1074. try {
  1075. // name+'.xlsx'表示导出的excel表格名字
  1076. FileSaver.saveAs(
  1077. new Blob([wbout], { type: "application/octet-stream" }),
  1078. name + ".xlsx"
  1079. );
  1080. } catch (e) {
  1081. if (typeof console !== "undefined") console.log(e, wbout);
  1082. }
  1083. this.current = curr;
  1084. this.pagesize = pagesize1;
  1085. this.loadData();
  1086. return wbout;
  1087. },
  1088. }
  1089. };
  1090. </script>
  1091. <style>
  1092. .custome_container {
  1093. border: 1px solid #d9d9d9;
  1094. border-radius: 10px;
  1095. }
  1096. .custome_container .title {
  1097. font-size: 5px;
  1098. margin-bottom: 20px;
  1099. }
  1100. .custome_container .top {
  1101. padding-top: 20px;
  1102. padding-left: 20px;
  1103. }
  1104. .custome_container .text {
  1105. display: inline-block;
  1106. color: #000;
  1107. font-size: 16px ;
  1108. margin-left: 1%;
  1109. }
  1110. .custome_container .input-demo {
  1111. display: inline-block;
  1112. width: 20%;
  1113. margin-left: 1%;
  1114. }
  1115. .custome_container .block {
  1116. font-size: 5px;
  1117. text-align: center;
  1118. margin-top: 25px;
  1119. margin-bottom: 25px;
  1120. }
  1121. .custome_container .el-dialog {
  1122. width: 60%;
  1123. }
  1124. .custome_container .el-dialog__header, .el-dialog__body {
  1125. padding: 0 20px;
  1126. }
  1127. .custome_container .tou {
  1128. font-size: 20px;
  1129. height: 30px;
  1130. line-height: 30px;
  1131. padding-top: 15px;
  1132. }
  1133. .custome_container .line {
  1134. margin-top: 15px;
  1135. margin-bottom: 15px;
  1136. width: 100%;
  1137. height: 2px;
  1138. background-color: #d9d9d9;
  1139. }
  1140. .custome_container .xinxi {
  1141. text-align: center;
  1142. margin: 15px auto;
  1143. font-size: 18px;
  1144. }
  1145. </style>