RepairDetails.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <template>
  2. <view>
  3. <!-- 状态 -->
  4. <!-- && userInfoRoleName.indexOf('admin') == -1 -->
  5. <view class="label" v-if="(form.dispatchingWorkers == 2 || form.status == 3 || form.status == 4)">
  6. <view class="tab" ref="wx" :style="{'color':wxStyle,'height':'100%','border-right': '1rpx solid #f4f4f4'}" @click="tab('wx')">
  7. <text>报修单</text>
  8. </view>
  9. <view class="tab" ref="gz" :style="{'color':gzStyle,'height':'100%','border-left': '1rpx solid #f4f4f4'}"
  10. @click="tab('gz')">
  11. <text>工作单</text>
  12. </view>
  13. </view>
  14. <view class="repairdetails" v-if="form.status == 1">
  15. <view class="cardBox">
  16. <!-- <view class="text">设备信息:</view> -->
  17. <u-input v-model="form.deviceName" disabledColor="#fff" disabled
  18. border="none" placeholder="请选择设备信息" >
  19. <!-- <template slot="suffix">
  20. <u-icon name="scan" color="#bbb" size="32"></u-icon>
  21. </template> -->
  22. </u-input>
  23. </view>
  24. <view class="cardBox">
  25. <!-- <view class="text">客户名称:</view> -->
  26. <u-input v-model="form.corpName" disabled disabledColor="#fff"
  27. border="none" placeholder="客户名称" ></u-input>
  28. </view>
  29. <view class="cardBox">
  30. <!-- <view class="text">地址:</view> -->
  31. <u-input v-model="form.deviceAddress" disabledColor="#fff" disabled
  32. border="none" placeholder="设备地址" ></u-input>
  33. </view>
  34. <view class="cardBox">
  35. <!-- <view class="text">故障描述:</view> -->
  36. <u--textarea v-model="form.faultDescribe" placeholder="故障描述" disabled
  37. border="none" >
  38. </u--textarea>
  39. </view>
  40. <view class="kapian">
  41. <!-- <view style="font-size: 30rpx;color: #999;margin-left: 10rpx;">添加图片</view> -->
  42. <view style="margin-top: 20rpx;">
  43. <u-upload
  44. :fileList="userImgList"
  45. :disabled="form.status != 3"
  46. @afterRead="afterRead"
  47. @delete="deletePic"
  48. name="1"
  49. multiple
  50. :maxCount="10"
  51. ></u-upload>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 维修单 -->
  56. <view class="repairdetails" v-if="wxStyle != ''">
  57. <view class="cardBox">
  58. <!-- <view class="text">设备信息:</view> -->
  59. <u-input v-model="form.deviceName" disabledColor="#fff" disabled
  60. border="none" placeholder="请选择设备信息" >
  61. <!-- <template slot="suffix">
  62. <u-icon name="scan" color="#bbb" size="32"></u-icon>
  63. </template> -->
  64. </u-input>
  65. </view>
  66. <view class="cardBox">
  67. <!-- <view class="text">客户名称:</view> -->
  68. <u-input v-model="form.corpName" disabled disabledColor="#fff"
  69. border="none" placeholder="客户名称" ></u-input>
  70. </view>
  71. <view class="cardBox">
  72. <!-- <view class="text">地址:</view> -->
  73. <u-input v-model="form.deviceAddress" disabledColor="#fff" disabled
  74. border="none" placeholder="设备地址" ></u-input>
  75. </view>
  76. <view class="cardBox">
  77. <!-- <view class="text">故障描述:</view> -->
  78. <u--textarea v-model="form.faultDescribe" placeholder="故障描述" disabled
  79. border="none" >
  80. </u--textarea>
  81. </view>
  82. <view class="kapian">
  83. <!-- <view style="font-size: 30rpx;color: #999;margin-left: 10rpx;">添加图片</view> -->
  84. <view style="margin-top: 20rpx;">
  85. <u-upload
  86. :fileList="userImgList"
  87. disabled
  88. @afterRead="afterRead"
  89. @delete="deletePic"
  90. name="1"
  91. multiple
  92. :maxCount="10"
  93. ></u-upload>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 工作单 -->
  98. <view class="repairdetails" v-if="gzStyle != ''">
  99. <view class="cardBox">
  100. <!-- <view class="text">设备信息:</view> -->
  101. <u-input v-model="form.deviceName" disabledColor="#fff" disabled
  102. border="none" placeholder="请选择设备信息" >
  103. <!-- <template slot="suffix">
  104. <u-icon name="scan" color="#bbb" size="32"></u-icon>
  105. </template> -->
  106. </u-input>
  107. </view>
  108. <view class="cardBox">
  109. <u--textarea v-model="form.repairDescription" placeholder="维修描述" border="none" :disabled="form.status != 3" >
  110. </u--textarea>
  111. </view>
  112. <view class="kapian">
  113. <!-- <view style="font-size: 30rpx;color: #999;margin-left: 10rpx;">添加图片</view> -->
  114. <view style="margin-top: 20rpx;">
  115. <u-upload
  116. :fileList="form.maintenanceFiles"
  117. :disabled="form.status != 3"
  118. @afterRead="afterRead"
  119. @delete="deletePic"
  120. name="1"
  121. multiple
  122. :maxCount="10"
  123. ></u-upload>
  124. </view>
  125. </view>
  126. <view>
  127. <view class="kapian" v-for="(item,index) in form.maintenanceFees" :key="item.id">
  128. <view class="WXflex">
  129. <view class="wxscfun" style="color: #fff; background-color: #FD4B09;" v-if="form.status == 3" @click="kapianClick(item,index)">修改</view>
  130. </view>
  131. <view class="repairProject">
  132. <view class="wxbox">
  133. {{item.costName}}
  134. </view>
  135. <view class="wxbox" style="color: #FD4B09;">
  136. {{item.amount}}元
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. <view class="kapian" >
  142. <view class="wxtitleflex">
  143. <view class="wxtitle">添加费用</view>
  144. <view v-if="form.status == 3 || userInfoRoleName.indexOf('admin') != -1"
  145. style="color: #fff; background-color: #FD4B09;" class="addwx"
  146. @click="kapianShow = true">添加</view>
  147. </view>
  148. </view>
  149. </view>
  150. <!-- wxaddfun -->
  151. <u-gap height="60"></u-gap>
  152. <view class="bottombox">
  153. <view class="bottombox_name" v-if="form.dispatchingWorkers == 2 && form.status != 1">
  154. <text>{{form.maintenanceWorkerName}}</text>
  155. </view>
  156. <view class="bottombox_name" @click="pickerShowfun" v-if="form.dispatchingWorkers == 1 && userInfoRoleName.indexOf('admin') != -1">
  157. <text>{{form.maintenanceWorkerName == null || form.maintenanceWorkerName == '' ? '请选择维修工' : form.maintenanceWorkerName}}</text>
  158. </view>
  159. <view v-if="(form.status == 3 || form.status == 4) && form.dispatchingWorkers == 3" style="color: #FD4B09;">维修费:{{form.maintenanceAmount?form.maintenanceAmount:0}}元</view>
  160. <view class="bottombox_right">
  161. <view class="buttonClass"
  162. v-if="form.dispatchingWorkers == 1 && userInfoRoleName.indexOf('admin') != -1"
  163. @click="maintenanceDispatchingWorkersfun">确认派工</view>
  164. <view class="buttonClass"
  165. v-if="form.dispatchingWorkers == 2 && userInfoRoleName.indexOf('admin') != -1"
  166. @click="maintenanceRevokeDispatchingWorkersfun">撤销派工</view>
  167. <view class="buttonClass" v-if="form.dispatchingWorkers == 2 && userInfoRoleName.indexOf('维修工') != -1" @click="receivingOrdersfun">确认接单</view>
  168. <view class="buttonClass" v-if="form.status == 3 && userInfoRoleName.indexOf('维修工') != -1 && form.dispatchingWorkers == 3" @click="Confirmexpenses">确认费用</view>
  169. <view class="buttonClass" v-if="form.status == 4" @click="Revocationfeesfun">撤销费用</view>
  170. <view class="buttonClass" v-if="form.status == 4" @click="ConfirmSettlement">确认结算</view>
  171. </view>
  172. </view>
  173. <u-picker :show="pickerShow" :columns="pickerList" keyName="name"
  174. @confirm="pickerShowConfirm" @cancel="pickerShowCancel"></u-picker>
  175. <u-toast ref="uToast"></u-toast>
  176. <!-- 添加费用弹窗 -->
  177. <!-- <u-popup :show="show" mode="top" @close="close" @open="open">
  178. <view>
  179. <text>人生若只如初见,何事秋风悲画扇</text>
  180. </view>
  181. </u-popup> -->
  182. <u-modal :show="kapianShow" title="收费项目" :showCancelButton="true" @cancel="kapianCancel" @confirm="kapianConfirm" confirmColor="#FD4B09">
  183. <view style="position: relative;">
  184. <view class="positionSC" @click="maintenanceDe(kapianindex)">删除</view>
  185. <view class="kapianModel">
  186. <text style="color: #FD4B09;font-size: 28rpx;">项目:</text>
  187. <u-input v-model="kapian.costName" disabledColor="#fff" :disabled="form.status != 3"
  188. border="bottom" confirm-type="next" placeholder="收费项目" ></u-input>
  189. </view>
  190. <view class="kapianModel">
  191. <text style="color: #FD4B09;font-size: 28rpx;">金额:</text>
  192. <u-input v-model="kapian.amount" disabledColor="#fff" :disabled="form.status != 3"
  193. border="bottom" type="digit" confirm-type="done" @input="moneyInput" placeholder="金额" ></u-input>
  194. </view>
  195. </view>
  196. <u-toast ref="uToastkapian"></u-toast>
  197. </u-modal>
  198. <!-- <u-overlay :show="overlayShow">
  199. <view class="warp">
  200. <view class="rect" @tap.stop></view>
  201. </view>
  202. </u-overlay> -->
  203. <u-loading-page bg-color="#e8e8e8" :loading="overlayShow" loading-text="加载中..." style="z-index: 999;" bgColor="rgba(0,0,0,0.5)"></u-loading-page>
  204. </view>
  205. </template>
  206. <script>
  207. import {
  208. maintenanceDetail,
  209. maintenanceReceivingOrders,
  210. maintenanceConfirm,
  211. userList,
  212. maintenanceDispatchingWorkers,
  213. maintenanceRevokeDispatchingWorkers,
  214. maintenancerRvokeConfirmFees
  215. } from '@/api/device/index.js'
  216. import http from '@/http/api.js'
  217. import {
  218. clientId,
  219. clientSecret
  220. } from '@/common/setting'
  221. export default {
  222. data() {
  223. return {
  224. id:null,
  225. wxStyle: '',
  226. gzStyle: '',
  227. overlayShow: false,
  228. form:{
  229. maintenanceFees:[
  230. {
  231. id:null,
  232. costId:null,
  233. costName:null,
  234. number:1,
  235. price:null,
  236. amount:null,
  237. currency:'CNY',
  238. settlementAmount:null,
  239. remarks:null,
  240. }
  241. ]
  242. },
  243. // 项目
  244. kapian: {},
  245. // 弹窗的开启
  246. pickerShow:false,
  247. // 添加费用弹窗
  248. kapianShow: false,
  249. pickerList:[],
  250. userInfoRoleName:[],
  251. // 当前点击费用的下标
  252. kapianindex:null,
  253. // 用户图片
  254. userImgList: [],
  255. }
  256. },
  257. onLoad(e) {
  258. this.id = e.id
  259. this.type = e.type
  260. this.userInfoRoleName = uni.getStorageSync('userInfo').role_name.split(',')
  261. this.maintenanceDetailfun()
  262. },
  263. onShow() {
  264. },
  265. methods: {
  266. // 添加费用的点击
  267. kapianClick(item,index) {
  268. if (this.form.status == 4) return
  269. this.kapian = item
  270. this.kapianindex = index
  271. this.kapianShow = true;
  272. },
  273. // 添加项目取消
  274. kapianCancel() {
  275. this.kapian = {};
  276. this.kapianShow = false;
  277. },
  278. // 添加项目确认
  279. kapianConfirm() {
  280. console.log(this.kapianindex,319);
  281. if(!this.kapian.costName) {
  282. this.$refs.uToastkapian.show({
  283. type: 'warning',
  284. position:'top',
  285. message: "请输入项目名称",
  286. })
  287. return
  288. }
  289. if(!this.kapian.amount) {
  290. this.$refs.uToastkapian.show({
  291. type: 'warning',
  292. position:'top',
  293. message: "请输入金额",
  294. })
  295. return
  296. }
  297. if(Number(this.kapian.amount) <= 0) {
  298. this.$refs.uToastkapian.show({
  299. type: 'warning',
  300. position:'top',
  301. message: "请输入不包含负数的数字",
  302. })
  303. return
  304. }
  305. if (this.kapianindex != null) {
  306. this.form.maintenanceFees[this.kapianindex] = this.kapian
  307. }else {
  308. this.form.maintenanceFees.push(this.kapian)
  309. }
  310. var money = 0
  311. for (let fees of this.form.maintenanceFees) {
  312. money += Number(fees.amount)
  313. }
  314. this.form.maintenanceAmount = money;
  315. this.kapianindex = null
  316. this.kapianShow = false;
  317. this.kapian = {}
  318. },
  319. moneyInput(value) {
  320. //正则表达试
  321. value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  322. //重新赋值给input
  323. this.$nextTick(() => {
  324. this.kapian.amount = value
  325. })
  326. // var money = 0
  327. // for (let fees of this.form.maintenanceFees) {
  328. // money += Number(fees.amount)
  329. // }
  330. // this.form.maintenanceAmount = money;
  331. },
  332. tab(type) {
  333. if(type == "wx") {
  334. this.wxStyle = "#fd4b09"
  335. this.gzStyle = ""
  336. // this.form.status = 2
  337. } else if (type == "gz") {
  338. if (this.form.dispatchingWorkers == 2 && this.userInfoRoleName.indexOf('admin') == -1) return
  339. this.gzStyle = "#fd4b09"
  340. this.wxStyle = ""
  341. // this.form.status = 3
  342. }
  343. },
  344. // 设备删除
  345. maintenanceDe(index){
  346. this.kapianindex = null
  347. this.kapianShow = false;
  348. this.kapian = {}
  349. this.form.maintenanceFees.splice(index,1)
  350. this.moneyInput()
  351. },
  352. // 撤销派工
  353. maintenanceRevokeDispatchingWorkersfun(){
  354. this.overlayShow = true;
  355. this.form.maintenanceWorkerId = null
  356. this.form.maintenanceWorkerName = null
  357. this.form.maintenanceWorkerTel = null
  358. maintenanceRevokeDispatchingWorkers(this.form).then(res=>{
  359. if (res.code == 200) {
  360. this.$refs.uToast.show({
  361. type: 'success',
  362. message: "撤销派工成功",
  363. })
  364. this.form = res.data
  365. this.wxStyle = ""
  366. this.gzStyle = ""
  367. }else {
  368. this.$refs.uToast.show({
  369. type: 'error',
  370. message: res.msg,
  371. })
  372. }
  373. this.overlayShow = false;
  374. })
  375. },
  376. // 派工
  377. maintenanceDispatchingWorkersfun(){
  378. this.overlayShow = true;
  379. if (!this.form.maintenanceWorkerId) {
  380. this.overlayShow = false;
  381. return this.$refs.uToast.show({type: 'warning',message: '请选择维修工'})
  382. }
  383. // if (!this.form.maintenanceWorkerTel) {
  384. // return this.$refs.uToast.show({type: 'warning',message: '请输入维修工电话'})
  385. // }
  386. maintenanceDispatchingWorkers(this.form).then(res=>{
  387. if (res.code == 200) {
  388. this.$refs.uToast.show({
  389. type: 'success',
  390. message: "派工成功",
  391. })
  392. this.form = res.data
  393. this.tab('wx')
  394. }else {
  395. this.$refs.uToast.show({
  396. type: 'error',
  397. message: res.msg,
  398. })
  399. }
  400. this.overlayShow = false;
  401. })
  402. },
  403. // 维修工弹窗开启
  404. pickerShowfun(){
  405. this.pickerShow = true
  406. this.userListfun()
  407. },
  408. // 维修工获取
  409. userListfun(){
  410. userList({roleAlias:'维修工'}).then(res=>{
  411. this.pickerList = [res.data]
  412. })
  413. },
  414. // 维修工弹窗的确认
  415. pickerShowConfirm(e){
  416. console.log(e.value[0],181);
  417. this.form.maintenanceWorkerId = e.value[0].id
  418. this.form.maintenanceWorkerName = e.value[0].name
  419. this.form.maintenanceWorkerTel = e.value[0].phone
  420. this.pickerShow = false
  421. },
  422. // 维修工弹窗取消
  423. pickerShowCancel() {
  424. this.pickerShow = false
  425. },
  426. // 维修费用的添加
  427. wxaddfun(){
  428. this.form.maintenanceFees.push({
  429. id:null,
  430. costId:null,
  431. costName:null,
  432. number:1,
  433. price:null,
  434. amount:null,
  435. currency:'CNY',
  436. settlementAmount:null,
  437. remarks:null,
  438. })
  439. },
  440. // 确认费用
  441. Confirmexpenses(){
  442. this.overlayShow = true
  443. let a = true
  444. if (this.form.maintenanceFees.length <= 0) {
  445. this.overlayShow = false;
  446. return this.$refs.uToast.show({type: 'warning',message: '请添加维修费用'})
  447. }else {
  448. this.form.maintenanceFees.map((item,index)=>{
  449. if (!item.costName) {
  450. this.$refs.uToast.show({type: 'warning',message: `请填写序号${index + 1}的费用名称`})
  451. a = false
  452. this.overlayShow = false;
  453. return
  454. }
  455. if (!item.amount) {
  456. this.$refs.uToast.show({type: 'warning',message: `请填写序号${index + 1}的金额`})
  457. a = false
  458. this.overlayShow = false;
  459. return
  460. }
  461. })
  462. if (a == false) {
  463. this.overlayShow = false;
  464. return
  465. }
  466. var imgList = this.form.maintenanceFiles
  467. for (let key in imgList) {
  468. this.form.maintenanceFiles[key].sort = key + 1
  469. }
  470. maintenanceConfirm(this.form).then(res=>{
  471. if (res.code == 200) {
  472. this.$refs.uToast.show({
  473. type: 'success',
  474. message: "操作成功",
  475. })
  476. // uni.navigateBack({
  477. // delta: 1
  478. // });
  479. this.form = res.data
  480. }else {
  481. this.$refs.uToast.show({
  482. type: 'error',
  483. message: res.msg,
  484. })
  485. }
  486. this.overlayShow = false;
  487. })
  488. }
  489. },
  490. // 撤销费用
  491. Revocationfeesfun(){
  492. this.overlayShow = true;
  493. maintenancerRvokeConfirmFees(this.form).then(res=>{
  494. if (res.code == 200) {
  495. this.$refs.uToast.show({
  496. type: 'success',
  497. message: "撤销成功",
  498. })
  499. this.form = res.data
  500. }else {
  501. this.$refs.uToast.show({
  502. type: 'error',
  503. message: res.msg,
  504. })
  505. }
  506. this.overlayShow = false;
  507. })
  508. },
  509. // 确认结算
  510. ConfirmSettlement(){
  511. this.overlayShow = true;
  512. this.overlayShow = false;
  513. },
  514. // 确认接单接口
  515. receivingOrdersfun(){
  516. this.overlayShow = true
  517. maintenanceReceivingOrders(this.form).then(res=>{
  518. console.log(res,180);
  519. if (res.code == 200) {
  520. this.$refs.uToast.show({
  521. type: 'success',
  522. message: "接单成功",
  523. })
  524. this.form = res.data
  525. this.tab('gz')
  526. }else {
  527. this.$refs.uToast.show({
  528. type: 'error',
  529. message: res.msg,
  530. })
  531. }
  532. this.overlayShow = false
  533. })
  534. },
  535. // 维修设备详情
  536. maintenanceDetailfun(){
  537. maintenanceDetail({id:this.id}).then(res=>{
  538. this.form = res.data
  539. for (let index in this.form.maintenanceFiles) {
  540. if(this.form.maintenanceFiles[index].uploadType == 0) {
  541. this.userImgList.push(this.form.maintenanceFiles[index])
  542. this.form.maintenanceFiles.splice(index, 1)
  543. }
  544. }
  545. if (this.form.status == 4) {
  546. this.gzStyle = "#fd4b09"
  547. this.wxStyle = ""
  548. } else if (this.form.status == 3 && this.form.dispatchingWorkers == 3) {
  549. this.gzStyle = "#fd4b09"
  550. this.wxStyle = ""
  551. } else if (this.form.status == 3 && this.form.dispatchingWorkers == 1) {
  552. this.wxStyle = "#fd4b09"
  553. this.gzStyle = ""
  554. } else if (this.form.dispatchingWorkers == 2) {
  555. console.log(this.form.status);
  556. this.wxStyle = "#fd4b09"
  557. this.gzStyle = ""
  558. } else if (this.form.status == 1) {
  559. userList({roleAlias:'维修工'}).then(res=>{
  560. this.wxUserList = [res.data]
  561. })
  562. }
  563. // if (this.type == 'JD') {
  564. // this.form.maintenanceFees.push({
  565. // id:null,
  566. // costId:null,
  567. // costName:null,
  568. // number:1,
  569. // price:null,
  570. // amount:null,
  571. // currency:'CNY',
  572. // settlementAmount:null,
  573. // remarks:null,
  574. // })
  575. // }
  576. })
  577. },
  578. // 图片删除
  579. deletePic(e){
  580. if(e.file.uploadType == 0) return this.$refs.uToast.show({ type: 'warning', message: '请勿删除客户添加的图片',})
  581. if(this.form.status != 3) return this.$refs.uToast.show({ type: 'warning', message: '修改数据请撤销费用',})
  582. this.form.maintenanceFiles.splice(e.index,1)
  583. },
  584. // 上传图片
  585. async afterRead(event){
  586. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  587. let lists = [].concat(event.file)
  588. console.log(lists);
  589. let fileListLen = this.form.maintenanceFiles.length
  590. lists.map((item) => {
  591. this.form.maintenanceFiles.push({
  592. uploadType:1,
  593. ...item
  594. })
  595. })
  596. for (let i = 0; i < lists.length; i++) {
  597. const result = await this.uploadFilePromise(lists[i].url)
  598. let item = this.form.maintenanceFiles[fileListLen]
  599. this.form.maintenanceFiles.splice(fileListLen, 1, Object.assign(item, {
  600. sort: this.form.maintenanceFiles.length,
  601. fileName: JSON.parse(result).data.originalName,
  602. url: JSON.parse(result).data.link
  603. }))
  604. fileListLen++
  605. }
  606. },
  607. uploadFilePromise(url) {
  608. return new Promise((resolve, reject) => {
  609. let a = uni.uploadFile({
  610. url: http.config.baseURL +
  611. '/blade-resource/oss/endpoint/put-file', // 仅为示例,非真实的接口地址
  612. filePath: url,
  613. name: 'file',
  614. formData: {
  615. user: 'test'
  616. },
  617. header: {
  618. // 客户端认证参数
  619. 'Authorization': 'Basic ' + Base64.encode(clientId + ':' +
  620. clientSecret),
  621. 'Blade-Auth': 'bearer ' + uni.getStorageSync('accessToken')
  622. },
  623. success: (res) => {
  624. setTimeout(() => {
  625. resolve(res.data)
  626. }, 1000)
  627. }
  628. });
  629. })
  630. },
  631. }
  632. }
  633. </script>
  634. <style lang="scss" scoped>
  635. .kapianModel {
  636. display: flex;
  637. align-items: center;
  638. // justify-content: flex-start;
  639. }
  640. .positionSC {
  641. position: absolute;
  642. top: -80rpx;
  643. right: -60rpx;
  644. background: #fd4b09;
  645. color: #fff;
  646. font-size: 30rpx;
  647. padding: 10rpx 15rpx;
  648. border-radius: 12rpx;
  649. }
  650. .label {
  651. left: 0rpx;
  652. top: 190rpx;
  653. width: 100%;
  654. height: 114rpx;
  655. line-height: 40rpx;
  656. background-color: rgba(255, 255, 255, 1);
  657. text-align: center;
  658. display: flex;
  659. align-items: center;
  660. .tab {
  661. width: 50%;
  662. display: flex;
  663. color: #c4c4c4;
  664. align-items: center;
  665. justify-content: center;
  666. font-size: 40rpx;
  667. text-align: left;
  668. font-family: PingFangSC-semiBold;
  669. }
  670. }
  671. .repairdetails {
  672. padding: 20rpx;
  673. box-sizing: border-box;
  674. }
  675. .cardBox {
  676. background: #fff;
  677. border-radius: 12rpx;
  678. width: 100%;
  679. padding: 30rpx;
  680. box-sizing: border-box;
  681. margin-bottom: 20rpx;
  682. display: flex;
  683. align-items: center;
  684. justify-content: center;
  685. }
  686. .text {
  687. font-size: 30rpx;
  688. color: #999;
  689. margin-right: 10rpx;
  690. }
  691. .kapian {
  692. background: #fff;
  693. border-radius: 12rpx;
  694. width: 100%;
  695. padding: 30rpx;
  696. box-sizing: border-box;
  697. margin-bottom: 20rpx;
  698. .repairProject {
  699. display: flex;
  700. justify-content: space-between;
  701. padding: 0 20rpx;
  702. }
  703. .wxtitleflex {
  704. display: flex;
  705. align-items: center;
  706. justify-content: space-between;
  707. }
  708. .wxtitle {
  709. font-size: 34rpx;
  710. color: #888;
  711. }
  712. .wxbox {
  713. border-bottom: 2rpx solid #eee;
  714. display: flex;
  715. align-items: center;
  716. justify-content: center;
  717. padding: 20rpx 0;
  718. margin: 10rpx 0;
  719. }
  720. .addwx {
  721. color: #dd451b;
  722. font-size: 30rpx;
  723. padding: 10rpx 20rpx;
  724. border: 2rpx solid;
  725. border-radius: 30rpx;
  726. }
  727. .WXflex {
  728. display: flex;
  729. justify-content: space-between;
  730. align-items: center;
  731. .xuhao {
  732. font-size: 32rpx;
  733. color: #101010;
  734. }
  735. .wxscfun {
  736. color: red;
  737. font-size: 30rpx;
  738. padding: 10rpx 20rpx;
  739. border: 2rpx solid;
  740. border-radius: 28rpx;
  741. }
  742. }
  743. }
  744. .bottombox {
  745. position: fixed;
  746. bottom: 0;
  747. width: 100%;
  748. height: 120rpx;
  749. background: #fff;
  750. box-shadow: 0rpx 4rpx 4rpx 4rpx rgba(0, 0, 0, 0.5);
  751. padding: 0 40rpx;
  752. box-sizing: border-box;
  753. display: flex;
  754. justify-content: space-between;
  755. align-items: center;
  756. .bottombox_name {
  757. font-size: 38rpx;
  758. color: #101010;
  759. }
  760. .bottombox_right {
  761. display: flex;
  762. .buttonClass {
  763. // background: #2d4a6a;
  764. background: #FD4B09;
  765. padding: 15rpx;
  766. margin: 0 5rpx;
  767. border-radius: 30rpx;
  768. color: #fff;
  769. // font-weight: bold;
  770. // margin: 0 10rpx;
  771. }
  772. }
  773. }
  774. </style>