index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  1. <template>
  2. <div class="app-container">
  3. <el-tabs v-model="step">
  4. <el-tab-pane label="商户信息" name="first"></el-tab-pane>
  5. <el-tab-pane label="商城配置信息" name="second"></el-tab-pane>
  6. <el-tab-pane label="微信配置信息" name="third"></el-tab-pane>
  7. <el-tab-pane label="结算配置信息" name="four"></el-tab-pane>
  8. <el-tab-pane label="移动端二维码" name="five"></el-tab-pane>
  9. </el-tabs>
  10. <div v-show="step == 'first'">
  11. <el-card>
  12. <div slot="header" class="clearfix">
  13. <span>商户信息</span>
  14. </div>
  15. <el-form class="my-form" ref="step1Form" :model="step1Form" label-width="130px" label-position="right" size="mini">
  16. <el-row :gutter="20">
  17. <el-col :span="6">
  18. <el-form-item label="商户账号" prop="account">
  19. <el-input v-model="step1Form.account" disabled></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="6">
  23. <el-form-item label="账户昵称" prop="nickName">
  24. <el-input v-model="step1Form.nickName" disabled></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="6">
  28. <el-form-item label="小程序名称" prop="appName">
  29. <el-input v-model="step1Form.appName" disabled></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item label="负责人" prop="chargePerson">
  34. <el-input v-model="step1Form.chargePerson" disabled></el-input>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="6">
  38. <el-form-item label="联系电话" prop="phone">
  39. <el-input v-model="step1Form.phone" disabled></el-input>
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="6">
  43. <el-form-item label="电子邮箱" prop="email">
  44. <el-input v-model="step1Form.email" disabled></el-input>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="12">
  48. <el-form-item label="地址" prop="address">
  49. <el-input v-model="step1Form.address" disabled></el-input>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="6">
  53. <el-form-item label="登录密码" prop="password">
  54. <el-input v-model="step1Form.password" type="password" disabled>
  55. <el-button slot="append" @click="handleReset()">重置密码</el-button>
  56. </el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="6">
  60. <el-form-item label="打印单名称" prop="billTitle">
  61. <el-input v-model="step1Form.billTitle" placeholder="请输入"></el-input>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="12">
  65. <el-form-item label="到期时间" prop="companyExpireTime">
  66. <el-date-picker :disabled="!~[2].indexOf(userType)" v-model="step1Form.companyExpireTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
  67. placeholder="选择日期时间">
  68. </el-date-picker>
  69. <el-button :disabled="!~[2].indexOf(userType)" type="primary" @click="saveTime()">保存</el-button>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="6">
  73. <el-form-item label="辅材配件权限" prop="moduleMaterialPart">
  74. <el-radio-group v-model="step1Form.moduleMaterialPart">
  75. <el-radio :label="true">开启</el-radio>
  76. <el-radio :label="false">禁用</el-radio>
  77. </el-radio-group>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="6">
  81. <el-form-item label="延保权限" prop="moduleYb">
  82. <el-radio-group v-model="step1Form.moduleYb">
  83. <el-radio :label="true">开启</el-radio>
  84. <el-radio :label="false">禁用</el-radio>
  85. </el-radio-group>
  86. </el-form-item>
  87. </el-col>
  88. <el-col :span="6">
  89. <el-form-item label="工程维保权限" prop="moduleWb">
  90. <el-radio-group v-model="step1Form.moduleWb">
  91. <el-radio :label="true">开启</el-radio>
  92. <el-radio :label="false">禁用</el-radio>
  93. </el-radio-group>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="6">
  97. <el-form-item label="商品出入库" prop="joinCode">
  98. <el-radio-group v-model="step1Form.joinCode">
  99. <el-radio :label="true">关联条码</el-radio>
  100. <el-radio :label="false">不关联条码</el-radio>
  101. </el-radio-group>
  102. </el-form-item>
  103. </el-col>
  104. <el-col :span="6">
  105. <el-form-item label="租赁业务" prop="moduleZl">
  106. <el-radio-group v-model="step1Form.moduleZl">
  107. <el-radio :label="true">开启</el-radio>
  108. <el-radio :label="false">禁用</el-radio>
  109. </el-radio-group>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="6">
  113. <el-form-item label="二手商城" prop="moduleEs">
  114. <el-radio-group v-model="step1Form.moduleEs">
  115. <el-radio :label="true">开启</el-radio>
  116. <el-radio :label="false">禁用</el-radio>
  117. </el-radio-group>
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="6">
  121. <el-form-item label="是否允许到店支付" prop="storePay">
  122. <el-radio-group v-model="step1Form.storePay">
  123. <el-radio :label="true">开启</el-radio>
  124. <el-radio :label="false">禁用</el-radio>
  125. </el-radio-group>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="12">
  129. <el-form-item label="以旧换新抵扣方式" prop="yjhxDkFlag">
  130. <el-radio-group v-model="step1Form.yjhxDkFlag">
  131. <el-radio :label="1">线上支付抵扣订单货款</el-radio>
  132. <el-radio :label="2">仅线上展示旧机价格</el-radio>
  133. </el-radio-group>
  134. </el-form-item>
  135. </el-col>
  136. </el-row>
  137. </el-form>
  138. </el-card>
  139. </div>
  140. <div v-show="step == 'second'">
  141. <el-form label-width="100px" label-position="right">
  142. <el-upload class="avatar-uploader" :action="baseURL + 'common/upload'" :headers="myHeaders"
  143. :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload">
  144. </el-upload>
  145. <el-form-item label="主logo" prop="imgUrl">
  146. <div class="images">
  147. <div class="main-img">
  148. <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
  149. <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px"
  150. fit="contain"></el-image>
  151. <div class="mask" v-show="img1_hover">
  152. <i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
  153. <i class="el-icon-upload2" @click="uploadImage('img1')"></i>
  154. <i class="el-icon-delete" @click="img1_url=''"></i>
  155. </div>
  156. </div>
  157. <div class="add" v-else @click="uploadImage('img1')">
  158. <i class="el-icon-plus avatar-uploader-icon"></i>
  159. </div>
  160. </div>
  161. <div class="tmp-img">
  162. <el-image :src="require('@/assets/template/template_1.png')"
  163. :preview-src-list="[require('@/assets/template/template_1.png')]"
  164. style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  165. <div class="tmp">示例图</div>
  166. </div>
  167. </div>
  168. <div class="tips">
  169. <span>建议尺寸:400*400</span>
  170. </div>
  171. </el-form-item>
  172. <el-form-item label="通用logo" prop="imgUrl">
  173. <div class="images">
  174. <div class="main-img">
  175. <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
  176. <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px"
  177. fit="contain"></el-image>
  178. <div class="mask" v-show="img2_hover">
  179. <i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
  180. <i class="el-icon-upload2" @click="uploadImage('img2')"></i>
  181. <i class="el-icon-delete" @click="img2_url=''"></i>
  182. </div>
  183. </div>
  184. <div class="add" v-else @click="uploadImage('img2')">
  185. <i class="el-icon-plus avatar-uploader-icon"></i>
  186. </div>
  187. </div>
  188. <div class="tmp-img">
  189. <el-image :src="require('@/assets/template/template_2.png')"
  190. :preview-src-list="[require('@/assets/template/template_2.png')]"
  191. style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  192. <div class="tmp">示例图</div>
  193. </div>
  194. </div>
  195. <div class="tips">
  196. <span>建议尺寸:280*60</span>
  197. </div>
  198. </el-form-item>
  199. <el-form-item label="头像logo" prop="imgUrl">
  200. <div class="images">
  201. <div class="main-img">
  202. <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
  203. <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px"
  204. fit="contain"></el-image>
  205. <div class="mask" v-show="img3_hover">
  206. <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
  207. <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
  208. <i class="el-icon-delete" @click="img3_url=''"></i>
  209. </div>
  210. </div>
  211. <div class="add" v-else @click="uploadImage('img3')">
  212. <i class="el-icon-plus avatar-uploader-icon"></i>
  213. </div>
  214. </div>
  215. <div class="tmp-img">
  216. <el-image :src="require('@/assets/template/template_3.png')"
  217. :preview-src-list="[require('@/assets/template/template_3.png')]"
  218. style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  219. <div class="tmp">示例图</div>
  220. </div>
  221. </div>
  222. <div class="tips">
  223. <span>建议尺寸:400*400</span>
  224. </div>
  225. </el-form-item>
  226. </el-form>
  227. </div>
  228. <div v-show="step == 'third'">
  229. <el-card>
  230. <div slot="header" class="clearfix">
  231. <span>微信配置信息</span>
  232. </div>
  233. <el-form class="my-form2" ref="step3Form" :model="step3Form" :rules="step3FormRules" label-width="130px" size="mini">
  234. <el-row :gutter="20">
  235. <el-col :span="6">
  236. <el-form-item label="服务商appId" prop="appId">
  237. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.appId" autocomplete="off" placeholder="请输入服务商appId"></el-input>
  238. </el-form-item>
  239. </el-col>
  240. <el-col :span="6">
  241. <el-form-item label="服务商商户号" prop="merchantId">
  242. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.merchantId" autocomplete="off" placeholder="请输入服务商商户号"></el-input>
  243. </el-form-item>
  244. </el-col>
  245. <el-col :span="6">
  246. <el-form-item label="服务商商户密钥" prop="merchantKey">
  247. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.merchantKey" autocomplete="off" placeholder="请输入服务商商户密钥"></el-input>
  248. </el-form-item>
  249. </el-col>
  250. <el-col :span="6">
  251. <el-form-item label="小程序appid" prop="appletAppid">
  252. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.appletAppid" autocomplete="off" placeholder="请输入小程序appid"></el-input>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="6">
  256. <el-form-item label="小程序密钥" prop="appletSecret">
  257. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.appletSecret" autocomplete="off" placeholder="请输入小程序密钥"></el-input>
  258. </el-form-item>
  259. </el-col>
  260. <el-col :span="6">
  261. <el-form-item label="子商户号Id" prop="childMerchantId">
  262. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.childMerchantId" autocomplete="off" placeholder="请输入子商户号Id"></el-input>
  263. </el-form-item>
  264. </el-col>
  265. <el-col :span="6">
  266. <el-form-item label="微信订阅模版" prop="templateId">
  267. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.templateId" autocomplete="off" placeholder="请输入微信订阅模版"></el-input>
  268. </el-form-item>
  269. </el-col>
  270. <el-col :span="6">
  271. <el-form-item label="公众号appid" prop="pubAppId">
  272. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubAppId" autocomplete="off" placeholder="请输入公众号appid"></el-input>
  273. </el-form-item>
  274. </el-col>
  275. <el-col :span="6">
  276. <el-form-item label="公众号密钥" prop="pubAppSecret">
  277. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubAppSecret" autocomplete="off" placeholder="请输入公众号密钥"></el-input>
  278. </el-form-item>
  279. </el-col>
  280. <el-col :span="6">
  281. <el-form-item label="改派通知" prop="pubTemplateId1">
  282. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubTemplateId1" autocomplete="off" placeholder="请输入工单派工,改派通知"></el-input>
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="6">
  286. <el-form-item label="发货通知" prop="pubTemplateId2">
  287. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubTemplateId2" autocomplete="off" placeholder="请输入商城订单支付成功提醒发货通知"></el-input>
  288. </el-form-item>
  289. </el-col>
  290. <el-col :span="6">
  291. <el-form-item label="维权订单提醒" prop="pubTemplateId3">
  292. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubTemplateId3" autocomplete="off" placeholder="请输入商城维权订单提醒"></el-input>
  293. </el-form-item>
  294. </el-col>
  295. <el-col :span="6">
  296. <el-form-item label="支付成功通知" prop="pubTemplateId4">
  297. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubTemplateId4" autocomplete="off" placeholder="请输入订单支付成功(含全部销售订单和延保)"></el-input>
  298. </el-form-item>
  299. </el-col>
  300. <el-col :span="6">
  301. <el-form-item label="维保费用申请" prop="pubTemplateId5">
  302. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubTemplateId5" autocomplete="off" placeholder="请输入维保的费用申请"></el-input>
  303. </el-form-item>
  304. </el-col>
  305. <el-col :span="6">
  306. <el-form-item label="安维费用发放通知" prop="pubTemplateId6">
  307. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubTemplateId6" autocomplete="off" placeholder="请输入安维费用发放通知"></el-input>
  308. </el-form-item>
  309. </el-col>
  310. <el-col :span="6">
  311. <el-form-item label="抢单新单通知" prop="pubTemplateId7">
  312. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubTemplateId7" autocomplete="off" placeholder="请输入抢单新单通知"></el-input>
  313. </el-form-item>
  314. </el-col>
  315. <el-col :span="6">
  316. <el-form-item label="配件到货通知" prop="pubTemplateId8">
  317. <el-input :disabled="!~[2].indexOf(userType)" v-model="step3Form.pubTemplateId8" autocomplete="off" placeholder="请输入配件到货通知"></el-input>
  318. </el-form-item>
  319. </el-col>
  320. </el-row>
  321. </el-form>
  322. </el-card>
  323. </div>
  324. <div v-show="step == 'four'">
  325. <el-form ref="step4Form" :model="step4Form" :rules="step4FormRules" label-width="100px" label-position="right">
  326. <h4>说明:将按照T+N天自动把销售订单“待结算”状态转为“可提现”状态,T为订单支付成功的日期。</h4>
  327. <h5>自动结算频率</h5>
  328. <el-form-item label="N等于" prop="dayNum">
  329. <el-input v-model="step4Form.dayNum" style="width: 220px;margin-right: 20px;" autocomplete="off"
  330. placeholder="请输入天数" type="number"></el-input>
  331. 天<span style="color: #EA8000;margin-left: 30px;">将在订单支付成功后T+{{ step4Form.dayNum }}天{{ step4Form.hourTime
  332. }}执行一次</span>
  333. </el-form-item>
  334. <el-form-item label="执行时间" prop="hourTime">
  335. <el-time-picker v-model="step4Form.hourTime" value-format="HH:mm:ss" placeholder="选择执行时间">
  336. </el-time-picker>
  337. </el-form-item>
  338. </el-form>
  339. </div>
  340. <div v-show="step == 'five'">
  341. <el-form label-width="100px" label-position="right">
  342. <el-upload class="avatar-uploader" :action="baseURL + 'common/upload'" :headers="myHeaders"
  343. :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload">
  344. </el-upload>
  345. <el-form-item label="小程序" prop="imgUrl">
  346. <div class="images">
  347. <div class="main-img">
  348. <div class="img" v-if="qrcode1_url" @mouseover="qrcode1_hover = true;" @mouseout="qrcode1_hover = false;">
  349. <el-image ref="qrcode1" :src="qrcode1_url" :preview-src-list="[qrcode1_url]"
  350. style="width: 120px; height: 120px" fit="contain"></el-image>
  351. <div class="mask" v-show="qrcode1_hover">
  352. <i class="el-icon-zoom-in" @click="previewImage('qrcode1')"></i>
  353. <i class="el-icon-upload2" @click="uploadImage('qrcode1')"></i>
  354. <i class="el-icon-delete" @click="qrcode1_url=''"></i>
  355. </div>
  356. </div>
  357. <div class="add" v-else @click="uploadImage('qrcode1')">
  358. <i class="el-icon-plus avatar-uploader-icon"></i>
  359. </div>
  360. </div>
  361. </div>
  362. <div class="tips">
  363. <span>建议尺寸:400*400</span>
  364. </div>
  365. </el-form-item>
  366. <el-form-item label="公众号" prop="imgUrl">
  367. <div class="images">
  368. <div class="main-img">
  369. <div class="img" v-if="qrcode2_url" @mouseover="qrcode2_hover = true;" @mouseout="qrcode2_hover = false;">
  370. <el-image ref="qrcode2" :src="qrcode2_url" :preview-src-list="[qrcode2_url]"
  371. style="width: 120px; height: 120px" fit="contain"></el-image>
  372. <div class="mask" v-show="qrcode2_hover">
  373. <i class="el-icon-zoom-in" @click="previewImage('qrcode2')"></i>
  374. <i class="el-icon-upload2" @click="uploadImage('qrcode2')"></i>
  375. <i class="el-icon-delete" @click="qrcode2_url=''"></i>
  376. </div>
  377. </div>
  378. <div class="add" v-else @click="uploadImage('qrcode2')">
  379. <i class="el-icon-plus avatar-uploader-icon"></i>
  380. </div>
  381. </div>
  382. </div>
  383. <div class="tips">
  384. <span>建议尺寸:400*400</span>
  385. </div>
  386. </el-form-item>
  387. <el-form-item label="收款二维码" prop="imgUrl">
  388. <div class="images">
  389. <div class="main-img">
  390. <div class="img" v-if="qrcode3_url" @mouseover="qrcode3_hover = true;" @mouseout="qrcode3_hover = false;">
  391. <el-image ref="qrcode3" :src="qrcode3_url" :preview-src-list="[qrcode3_url]"
  392. style="width: 120px; height: 120px" fit="contain"></el-image>
  393. <div class="mask" v-show="qrcode3_hover">
  394. <i class="el-icon-zoom-in" @click="previewImage('qrcode3')"></i>
  395. <i class="el-icon-upload2" @click="uploadImage('qrcode3')"></i>
  396. <i class="el-icon-delete" @click="qrcode3_url=''"></i>
  397. </div>
  398. </div>
  399. <div class="add" v-else @click="uploadImage('qrcode3')">
  400. <i class="el-icon-plus avatar-uploader-icon"></i>
  401. </div>
  402. </div>
  403. </div>
  404. <div class="tips">
  405. <span>建议尺寸:400*400</span>
  406. </div>
  407. </el-form-item>
  408. </el-form>
  409. </div>
  410. <div class="page-footer">
  411. <div class="footer" :class="classObj">
  412. <el-button type="primary" @click="submitStep1Form" :loading="formLoading" v-if="step == 'first'">{{ formLoading ?
  413. '保存中 ...' : '保 存' }}</el-button>
  414. <el-button type="primary" @click="submitStep2Form" :loading="formLoading" v-if="step == 'second'">{{ formLoading ?
  415. '保存中 ...' : '保 存' }}</el-button>
  416. <el-button type="primary" @click="submitStep3Form" :loading="formLoading" v-if="step == 'third'">{{ formLoading ?
  417. '保存中 ...' : '保 存' }}</el-button>
  418. <el-button type="primary" @click="submitStep4Form" :loading="formLoading" v-if="step == 'four'">{{ formLoading ?
  419. '保存中 ...' : '保 存' }}</el-button>
  420. <el-button type="primary" @click="submitStep5Form" :loading="formLoading" v-if="step == 'five'">{{ formLoading ?
  421. '保存中 ...' : '保 存' }}</el-button>
  422. <el-popconfirm title="确定关闭吗?" @confirm="goBack" style="margin-left: 10px;">
  423. <el-button slot="reference">关 闭</el-button>
  424. </el-popconfirm>
  425. </div>
  426. </div>
  427. <!-- 重置密码 -->
  428. <el-dialog title="重置密码" :visible.sync="resetFormVisible" :show-close="false" width="40%"
  429. :close-on-click-modal="false">
  430. <el-form ref="resetForm" :model="resetForm" :rules="resetFormRules" label-position="left" label-width="100px">
  431. <el-form-item label="输入新密码" prop="newPassword">
  432. <el-input v-model="resetForm.newPassword" ref="password1" autocomplete="off" placeholder="请输入新密码"
  433. :type="passwordType1"></el-input>
  434. <span class="show-pwd" @click="showPwd(1)">
  435. <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
  436. </span>
  437. </el-form-item>
  438. <el-form-item label="确认密码" prop="confirmPassword">
  439. <el-input v-model="resetForm.confirmPassword" ref="password2" autocomplete="off" placeholder="请再次输入新密码"
  440. :type="passwordType2"></el-input>
  441. <span class="show-pwd" @click="showPwd(2)">
  442. <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
  443. </span>
  444. </el-form-item>
  445. </el-form>
  446. <div slot="footer" class="dialog-footer">
  447. <el-button @click="cancelResetForm">取 消</el-button>
  448. <el-button type="primary" @click="submitResetForm">确 定</el-button>
  449. </div>
  450. </el-dialog>
  451. </div>
  452. </template>
  453. <script>
  454. import { getToken } from '@/utils/auth'
  455. import { getDetail, resetPassword, editAccount } from "@/api/merchant";
  456. import request from '@/utils/request'
  457. export default {
  458. data() {
  459. var validatePass = (rule, value, callback) => {
  460. if (value === '') {
  461. callback(new Error('请输入登录密码'));
  462. } else if (value.length < 12) {
  463. callback(new Error('密码长度至少12位'));
  464. } else if (/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test(value) == false) {
  465. callback(new Error('密码必须包含数字和字母'));
  466. } else {
  467. if (this.resetForm.confirmPassword !== '') {
  468. this.$refs.resetForm.validateField('confirmPassword');
  469. }
  470. callback();
  471. }
  472. };
  473. var validatePass2 = (rule, value, callback) => {
  474. if (value === '') {
  475. callback(new Error('请再次输入密码'));
  476. } else if (value !== this.resetForm.newPassword) {
  477. callback(new Error('两次输入密码不一致'));
  478. } else {
  479. callback();
  480. }
  481. };
  482. return {
  483. baseURL: process.env.VUE_APP_BASE_API,
  484. myHeaders: { 'x-token': getToken() },
  485. id: null,
  486. companyWechatId: null,
  487. step: 'first',
  488. step1Form: {
  489. account: '', // 账号
  490. nickName: '', // 用户名
  491. appName: '', // 小程序名称
  492. chargePerson: '', // 负责人
  493. phone: '', // 联系电话
  494. email: '', // 电子邮箱
  495. address: '', // 地址
  496. newPassword: '', // 新密码
  497. confirmPassword: '', // 确认密码
  498. companyExpireTime: '',
  499. moduleMaterialPart: '',
  500. billTitle: '',
  501. moduleYb: '',
  502. moduleWb: '',
  503. joinCode:'',
  504. moduleZl:'',
  505. moduleEs:'',
  506. storePay: '',
  507. yjhxDkFlag: '',
  508. },
  509. passwordType1: 'password',
  510. passwordType2: 'password',
  511. uploadImageType: null,
  512. img1_url: '',
  513. img1_hover: false,
  514. img2_url: '',
  515. img2_hover: false,
  516. img3_url: '',
  517. img3_hover: false,
  518. qrcode1_url: '',
  519. qrcode1_hover: false,
  520. qrcode2_url: '',
  521. qrcode2_hover: false,
  522. qrcode3_url: '',
  523. qrcode3_hover: false,
  524. resetFormVisible: false,
  525. resetForm: {
  526. newPassword: '', // 新密码
  527. confirmPassword: '', // 确认密码
  528. },
  529. resetFormRules: {
  530. newPassword: [
  531. { required: true, validator: validatePass, trigger: 'blur' }
  532. ],
  533. confirmPassword: [
  534. { required: true, validator: validatePass2, trigger: 'blur' }
  535. ],
  536. },
  537. step3Form: {
  538. enterpriseId: '',
  539. listSecret: '',
  540. listSyncSecret: '',
  541. appAgentId: '',
  542. appSecret: '',
  543. appId: '',
  544. merchantId: '',
  545. merchantKey: '',
  546. appletAppid: '',
  547. appletSecret: '',
  548. childMerchantId: '',
  549. templateId: '',
  550. pubAppId: '',
  551. pubAppSecret: '',
  552. pubTemplateId1:'',
  553. pubTemplateId2:'',
  554. pubTemplateId3:'',
  555. pubTemplateId4:'',
  556. pubTemplateId5:'',
  557. pubTemplateId6:'',
  558. pubTemplateId7:'',
  559. pubTemplateId8:'',
  560. },
  561. step3FormRules: {
  562. },
  563. step4Form: {
  564. dayNum: '',
  565. hourTime: ''
  566. },
  567. step4FormRules: {
  568. dayNum: [
  569. { required: true, message: '请输入天数', trigger: 'blur' }
  570. ],
  571. hourTime: [
  572. { required: true, message: '请选择执行时间', trigger: 'change' }
  573. ],
  574. },
  575. formLoading: false,
  576. }
  577. },
  578. computed: {
  579. sidebar() {
  580. return this.$store.state.app.sidebar
  581. },
  582. classObj() {
  583. return {
  584. hideSidebar: !this.sidebar.opened,
  585. openSidebar: this.sidebar.opened
  586. }
  587. },
  588. userType() {
  589. return JSON.parse(localStorage.getItem('greemall_user')).type
  590. },
  591. },
  592. created() {
  593. const { id, type } = this.$route.query;
  594. this.id = id;
  595. this.getDetail();
  596. if (type === 1) {
  597. this.step = 'first';
  598. } else if (type === 2) {
  599. this.step = 'second';
  600. } else if (type === 3) {
  601. this.step = 'third';
  602. }
  603. },
  604. methods: {
  605. goBack() {
  606. this.$router.go(-1);
  607. },
  608. // 获取详情
  609. getDetail() {
  610. getDetail({ adminUserId: this.id }).then(res => {
  611. this.step1Form.account = res.data.userName;
  612. this.step1Form.nickName = res.data.nickName;
  613. this.step1Form.appName = res.data.minAppName;
  614. this.step1Form.chargePerson = res.data.linkName;
  615. this.step1Form.phone = res.data.linkPhone;
  616. this.step1Form.email = res.data.email;
  617. this.step1Form.address = res.data.address;
  618. this.step1Form.password = '************';
  619. this.step1Form.companyExpireTime = res.data.companyExpireTime
  620. this.step1Form.moduleMaterialPart = res.data.moduleMaterialPart
  621. this.step1Form.billTitle = res.data.billTitle
  622. this.step1Form.moduleYb = res.data.moduleYb
  623. this.step1Form.moduleWb = res.data.moduleWb
  624. this.step1Form.joinCode = res.data.joinCode
  625. this.step1Form.moduleZl = res.data.moduleZl
  626. this.step1Form.moduleEs = res.data.moduleEs
  627. this.step1Form.storePay = res.data.storePay
  628. this.step1Form.yjhxDkFlag = res.data.yjhxDkFlag
  629. this.img1_url = res.data.minLogo1;
  630. this.img2_url = res.data.minLogo2;
  631. this.img3_url = res.data.minLogo3;
  632. this.qrcode1_url = res.data.qrcode1;
  633. this.qrcode2_url = res.data.qrcode2;
  634. this.qrcode3_url = res.data.payQrcode;
  635. this.step3Form.enterpriseId = res.data.corpId;
  636. this.step3Form.listSecret = res.data.secret2;
  637. this.step3Form.listSyncSecret = res.data.secret3;
  638. this.step3Form.appAgentId = res.data.agentId1;
  639. this.step3Form.appSecret = res.data.secret1;
  640. this.step3Form.appId = res.data.appId;
  641. this.step3Form.merchantId = res.data.mchId;
  642. this.step3Form.merchantKey = res.data.mchKey;
  643. this.step3Form.appletAppid = res.data.appletAppid;
  644. this.step3Form.appletSecret = res.data.appletSecret;
  645. this.step3Form.childMerchantId = res.data.subMchId;
  646. this.step3Form.templateId = res.data.template;
  647. this.step3Form.pubAppId = res.data.pubAppId;
  648. this.step3Form.pubAppSecret = res.data.pubAppSecret;
  649. this.step3Form.pubTemplateId1 = res.data.pubTemplateId1;
  650. this.step3Form.pubTemplateId2 = res.data.pubTemplateId2;
  651. this.step3Form.pubTemplateId3 = res.data.pubTemplateId3;
  652. this.step3Form.pubTemplateId4 = res.data.pubTemplateId4;
  653. this.step3Form.pubTemplateId5 = res.data.pubTemplateId5;
  654. this.step3Form.pubTemplateId6 = res.data.pubTemplateId6;
  655. this.step3Form.pubTemplateId7 = res.data.pubTemplateId7;
  656. this.step3Form.pubTemplateId8 = res.data.pubTemplateId8;
  657. this.companyWechatId = res.data.companyWechatId;
  658. this.step4Form.dayNum = res.data.dayNum
  659. this.step4Form.hourTime = res.data.hourTime
  660. })
  661. },
  662. // 重置密码
  663. handleReset(id) {
  664. this.resetId = id;
  665. this.resetFormVisible = true;
  666. },
  667. // 取消重置密码
  668. cancelResetForm() {
  669. this.resetFormVisible = false;
  670. this.passwordType1 = 'password';
  671. this.passwordType2 = 'password';
  672. this.$refs.resetForm.resetFields();
  673. },
  674. saveTime() {
  675. request({
  676. url: '/admin/user/user/updateCompanyWechat',
  677. method: 'post',
  678. data: {
  679. expireTime: this.step1Form.companyExpireTime,
  680. companyWechatId: this.companyWechatId
  681. }
  682. }).then(res => {
  683. if (res.code == 200) {
  684. this.$successMsg('保存成功');
  685. this.getDetail()
  686. }
  687. })
  688. },
  689. // 提交重置密码
  690. submitResetForm() {
  691. this.$refs.resetForm.validate((valid) => {
  692. if (valid) {
  693. let params = {
  694. password: this.resetForm.newPassword,
  695. adminUserId: this.id
  696. }
  697. resetPassword(params).then(res => {
  698. this.cancelResetForm();
  699. this.getDetail();
  700. this.$successMsg();
  701. })
  702. }
  703. })
  704. },
  705. // 显示隐藏密码
  706. showPwd(num) {
  707. if (num == 1) {
  708. if (this.passwordType1 === 'password') {
  709. this.passwordType1 = ''
  710. } else {
  711. this.passwordType1 = 'password'
  712. }
  713. this.$nextTick(() => {
  714. this.$refs.password1.focus()
  715. })
  716. }
  717. if (num == 2) {
  718. if (this.passwordType2 === 'password') {
  719. this.passwordType2 = ''
  720. } else {
  721. this.passwordType2 = 'password'
  722. }
  723. this.$nextTick(() => {
  724. this.$refs.password2.focus()
  725. })
  726. }
  727. },
  728. uploadImage(type) {
  729. this.uploadImageType = type;
  730. document.querySelector('.avatar-uploader input').click();
  731. },
  732. // 上传图片
  733. uploadSuccess(res, file) {
  734. this[this.uploadImageType + '_url'] = res.data.url;
  735. },
  736. beforeUpload(file) {
  737. const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
  738. const whiteList = ['jpg', 'jpeg', 'png'];
  739. if (whiteList.indexOf(fileSuffix) === -1) {
  740. this.$errorMsg('只支持上传jpg/jpeg/png文件!');
  741. return false;
  742. }
  743. },
  744. // 预览图片
  745. previewImage(type) {
  746. this.$refs[type].showViewer = true;
  747. },
  748. submitStep1Form() {
  749. this.formLoading = true;
  750. let params = {
  751. // adminUserId: this.id,
  752. companyWechatId: this.companyWechatId,
  753. moduleMaterialPart: this.step1Form.moduleMaterialPart,
  754. billTitle: this.step1Form.billTitle,
  755. moduleYb: this.step1Form.moduleYb,
  756. moduleWb: this.step1Form.moduleWb,
  757. joinCode: this.step1Form.joinCode,
  758. moduleZl: this.step1Form.moduleZl,
  759. moduleEs: this.step1Form.moduleEs,
  760. storePay: this.step1Form.storePay,
  761. yjhxDkFlag: this.step1Form.yjhxDkFlag,
  762. }
  763. editAccount(params).then(res => {
  764. this.$successMsg('保存成功');
  765. setTimeout(() => {
  766. this.goBack();
  767. }, 1500)
  768. }).finally(res => {
  769. this.formLoading = false;
  770. })
  771. },
  772. submitStep2Form() {
  773. if (!this.img1_url) {
  774. return this.$errorMsg('请上传主logo');
  775. }
  776. if (!this.img2_url) {
  777. return this.$errorMsg('请上传通用logo');
  778. }
  779. if (!this.img3_url) {
  780. return this.$errorMsg('请上传头像logo');
  781. }
  782. this.formLoading = true;
  783. let params = {
  784. adminUserId: this.id,
  785. minLogo1: this.img1_url,
  786. minLogo2: this.img2_url,
  787. minLogo3: this.img3_url,
  788. companyWechatId: this.companyWechatId
  789. }
  790. editAccount(params).then(res => {
  791. this.$successMsg('保存成功');
  792. setTimeout(() => {
  793. this.goBack();
  794. }, 1500)
  795. }).finally(res => {
  796. this.formLoading = false;
  797. })
  798. },
  799. submitStep3Form() {
  800. this.$refs.step3Form.validate((valid) => {
  801. if (valid) {
  802. this.formLoading = true;
  803. let params = {
  804. adminUserId: this.id,
  805. corpId: this.step3Form.enterpriseId,
  806. secret2: this.step3Form.listSecret,
  807. secret3: this.step3Form.listSyncSecret,
  808. agentId1: this.step3Form.appAgentId,
  809. secret1: this.step3Form.appSecret,
  810. appId: this.step3Form.appId,
  811. mchId: this.step3Form.merchantId,
  812. mchKey: this.step3Form.merchantKey,
  813. appletAppid: this.step3Form.appletAppid,
  814. appletSecret: this.step3Form.appletSecret,
  815. subMchId: this.step3Form.childMerchantId,
  816. template: this.step3Form.templateId,
  817. pubAppId: this.step3Form.pubAppId,
  818. pubAppSecret: this.step3Form.pubAppSecret,
  819. pubTemplateId1: this.step3Form.pubTemplateId1,
  820. pubTemplateId2: this.step3Form.pubTemplateId2,
  821. pubTemplateId3: this.step3Form.pubTemplateId3,
  822. pubTemplateId4: this.step3Form.pubTemplateId4,
  823. pubTemplateId5: this.step3Form.pubTemplateId5,
  824. pubTemplateId6: this.step3Form.pubTemplateId6,
  825. pubTemplateId7: this.step3Form.pubTemplateId7,
  826. pubTemplateId8: this.step3Form.pubTemplateId8,
  827. companyWechatId: this.companyWechatId
  828. }
  829. editAccount(params).then(res => {
  830. this.$successMsg('保存成功');
  831. setTimeout(() => {
  832. this.goBack();
  833. }, 1500)
  834. }).finally(res => {
  835. this.formLoading = false;
  836. })
  837. }
  838. })
  839. },
  840. submitStep4Form() {
  841. this.$refs.step4Form.validate((valid) => {
  842. if (valid) {
  843. this.formLoading = true;
  844. let params = {
  845. adminUserId: this.id,
  846. companyWechatId: this.companyWechatId,
  847. dayNum: this.step4Form.dayNum,
  848. hourTime: this.step4Form.hourTime,
  849. }
  850. editAccount(params).then(res => {
  851. this.$successMsg('保存成功');
  852. setTimeout(() => {
  853. this.goBack();
  854. }, 1500)
  855. }).finally(res => {
  856. this.formLoading = false;
  857. })
  858. }
  859. })
  860. },
  861. submitStep5Form() {
  862. // if (!this.qrcode1_url) {
  863. // return this.$errorMsg('请上传小程序图片');
  864. // }
  865. if (!this.qrcode2_url) {
  866. return this.$errorMsg('请上传公众号图片');
  867. }
  868. // if (!this.qrcode3_url) {
  869. // return this.$errorMsg('请上传收款二维码图片');
  870. // }
  871. this.formLoading = true;
  872. let params = {
  873. adminUserId: this.id,
  874. qrcode1: this.qrcode1_url,
  875. qrcode2: this.qrcode2_url,
  876. payQrcode: this.qrcode3_url,
  877. companyWechatId: this.companyWechatId
  878. }
  879. editAccount(params).then(res => {
  880. this.$successMsg('保存成功');
  881. setTimeout(() => {
  882. this.goBack();
  883. }, 1500)
  884. }).finally(res => {
  885. this.formLoading = false;
  886. })
  887. },
  888. }
  889. }
  890. </script>
  891. <style lang="scss" scoped>
  892. .setting_title {
  893. padding-left: 0;
  894. }
  895. .tips {
  896. font-size: 14px;
  897. }
  898. .my-card {
  899. margin-top: 20px;
  900. .box {
  901. background: rgb(235, 240, 249);
  902. padding: 10px;
  903. font-size: 14px;
  904. margin: 20px 0;
  905. line-height: 18px;
  906. ::v-deep .el-link {
  907. vertical-align: unset;
  908. }
  909. }
  910. }
  911. .my-form {
  912. width: 100%;
  913. margin-top: 20px;
  914. }
  915. .show-pwd {
  916. position: absolute;
  917. right: 15px;
  918. top: 0;
  919. font-size: 16px;
  920. cursor: pointer;
  921. user-select: none;
  922. }
  923. .question {
  924. position: absolute;
  925. right: -30px;
  926. top: 0;
  927. font-size: 20px;
  928. cursor: pointer;
  929. user-select: none;
  930. }
  931. .reset {
  932. position: absolute;
  933. right: -110px;
  934. top: 0;
  935. }
  936. .my-form2 {
  937. ::v-deep input {
  938. // width: 400px;
  939. }
  940. }
  941. .tips {
  942. margin-top: 10px;
  943. span {
  944. display: inline-block;
  945. width: 300px;
  946. text-align: center;
  947. line-height: 32px;
  948. background: #ffefef;
  949. font-size: 14px;
  950. color: #f66460;
  951. }
  952. }
  953. .images {
  954. display: flex;
  955. flex-wrap: wrap;
  956. .main-img {
  957. display: flex;
  958. flex-direction: column;
  959. justify-content: center;
  960. align-items: center;
  961. width: 120px;
  962. margin-right: 20px;
  963. .img {
  964. border: 1px dashed #eaeaea;
  965. border-radius: 5px;
  966. overflow: hidden;
  967. position: relative;
  968. .el-image {
  969. display: block;
  970. }
  971. .mask {
  972. position: absolute;
  973. left: 0;
  974. top: 0;
  975. width: 120px;
  976. height: 120px;
  977. background: rgba($color: #000000, $alpha: 0.3);
  978. display: flex;
  979. align-items: center;
  980. justify-content: center;
  981. i {
  982. font-size: 20px;
  983. color: #ffffff;
  984. cursor: pointer;
  985. margin: 0 8px;
  986. }
  987. }
  988. }
  989. .text {
  990. font-size: 14px;
  991. color: #666666;
  992. }
  993. }
  994. .add {
  995. width: 120px;
  996. height: 120px;
  997. border: 1px dashed #eaeaea;
  998. border-radius: 5px;
  999. cursor: pointer;
  1000. display: flex;
  1001. align-items: center;
  1002. justify-content: center;
  1003. i {
  1004. font-size: 30px;
  1005. color: #999;
  1006. }
  1007. }
  1008. .tmp-img {
  1009. position: relative;
  1010. .tmp {
  1011. position: absolute;
  1012. left: 0;
  1013. top: 0;
  1014. line-height: 20px;
  1015. padding: 0 8px;
  1016. background: #f66460;
  1017. border-radius: 0 0 10px 0;
  1018. font-size: 12px;
  1019. color: #ffffff;
  1020. }
  1021. }
  1022. }
  1023. </style>