Customer.vue 50 KB

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