salesOrderDetails.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. <template>
  2. <view style="padding-top: 1rpx;">
  3. <u--form labelPosition="left" :labelStyle="{ color: '#fd4b09' }" :model="form" ref="form" labelWidth="180rpx"
  4. style="margin-top: 10rpx;padding-bottom: 130rpx;">
  5. <view style="width: calc(96%);margin: 0 auto;background-color: #fff;border-radius: 20rpx;">
  6. <u-cell-group :border="false">
  7. <u-cell :border="false" center title="基本信息" arrow-direction="down">
  8. <view slot="icon" style="width: 10rpx;height: 35rpx;
  9. background-color: #fd4b09;"></view>
  10. </u-cell>
  11. </u-cell-group>
  12. <view style="padding: 0 10rpx;">
  13. <u-form-item leftIcon="account" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }"
  14. label="业务对象" prop="cname" borderBottom>
  15. <u-input v-model="form.customerName" inputAlign="right" border="none" placeholder="请填写业务对象"
  16. disabled disabledColor="#ffffff" />
  17. </u-form-item>
  18. <u-form-item leftIcon="account" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }" label="仓库"
  19. prop="home" borderBottom @click="filterAll(['storageName', 'storageId'])">
  20. <u-input v-model="form.storageName" placeholder="请选择仓库" inputAlign="right" border="none"
  21. disabled disabledColor="#ffffff" />
  22. </u-form-item>
  23. <u-form-item leftIcon="account" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }" label="库管"
  24. prop="cname" borderBottom @click="filterAll(['stockClerkIdName', 'stockClerkId'])">
  25. <u-input v-model="form.stockClerkName" inputAlign="right" border="none" disabled
  26. disabledColor="#ffffff" />
  27. </u-form-item>
  28. <u-form-item leftIcon="calendar" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }"
  29. label="业务日期" prop="cname" borderBottom>
  30. <u-input v-model="form.businesDate" inputAlign="right" border="none" disabled
  31. disabledColor="#ffffff" />
  32. </u-form-item>
  33. <!-- <u-form-item label="入库单号" prop="cname" borderBottom>
  34. <u-input v-model="form.billno" border="none" inputAlign="right"
  35. placeholder="请输入入库单号" disabled
  36. disabledColor="#ffffff" />
  37. </u-form-item>
  38. <u-form-item label="来源单号" prop="cname" borderBottom>
  39. <u-input v-model="form.ordNo" border="none" inputAlign="right"
  40. placeholder="请输入来源单号" disabled
  41. disabledColor="#ffffff" />
  42. </u-form-item> -->
  43. <u-form-item leftIcon="car" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }" label="配送方式"
  44. prop="cname" borderBottom @click="filterAll(['shipType', 'shipType'])">
  45. <u-input v-model="form.shipType" inputAlign="right" border="none" placeholder="请选择配送方式" disabled
  46. disabledColor="#ffffff" />
  47. </u-form-item>
  48. <u-form-item leftIcon="home" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }" label="物流公司"
  49. prop="cname" borderBottoms @click="filterAll(['logisticsCorpName', 'logisticsCorpId'])">
  50. <u-input v-model="form.logisticsCorpName" inputAlign="right" border="none" placeholder="请选择物流公司"
  51. disabled disabledColor="#ffffff" />
  52. </u-form-item>
  53. <u-form-item leftIcon="file-text" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }"
  54. label="物流单号" prop="cname" borderBottom>
  55. <u-input v-model="form.expressNo" inputAlign="right" border="none" placeholder="请输入物流单号"
  56. :disabled="form.statusName == '已出库'" disabledColor="#ffffff" />
  57. </u-form-item>
  58. <u-form-item leftIcon="edit-pen" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }"
  59. label="订单数量" prop="cname" borderBottom>
  60. <u-input v-model="form.goodsTotalNum" border="none" inputAlign="right" placeholder="请输入订单数量"
  61. disabled disabledColor="#ffffff" />
  62. </u-form-item>
  63. <u-form-item leftIcon="edit-pen" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }"
  64. label="出库数量" prop="cname" borderBottom>
  65. <u-input v-model="form.sendTotalNum" border="none" inputAlign="right" placeholder="0" disabled
  66. disabledColor="#ffffff" />
  67. </u-form-item>
  68. <u-form-item leftIcon="file-text" :leftIconStyle="{ color: '#FD4B09', fontSize: '40rpx' }"
  69. label="备注" prop="cname" borderBottom>
  70. <u--textarea v-model="form.remarks" height="40" :disabled="form.statusName == '已出库'"
  71. border="none" placeholder="请输入备注"></u--textarea>
  72. </u-form-item>
  73. </view>
  74. </view>
  75. <view style="width: calc(96%);margin: 0 auto;
  76. border-radius: 20rpx;margin-top: 20rpx;">
  77. <u-cell-group :border="false">
  78. <u-cell :border="false" center>
  79. <view slot="icon" style="width: 10rpx;height: 35rpx;
  80. background-color: #fd4b09;"></view>
  81. <view slot="title">
  82. <view style="display: flex;">
  83. <view>出库明细({{ form.shipItemsList.length }})</view>
  84. </view>
  85. </view>
  86. </u-cell>
  87. </u-cell-group>
  88. <view style="font-size: 30rpx;">
  89. <view v-for="(item, index) in form.shipItemsList" :key="index" @click="tanchufun(item, index)"
  90. style="padding: 20rpx; background-color: #fff;margin-bottom: 20rpx;
  91. border-radius: 12rpx;">
  92. <view style="display: flex;align-items: center;justify-content: space-between;
  93. margin-bottom: 20rpx;">
  94. <text style="color: #FD4B09;font-size: 32rpx">序号{{ index + 1 }}</text>
  95. <view style="color: #fff;font-size: 30rpx;
  96. background: #FD4B09;padding: 10rpx;border-radius: 10rpx;" @click.stop="shipItemsDelfun(index, item.id)">
  97. 删除
  98. </view>
  99. </view>
  100. <view>
  101. <view>{{ item.goodsName }}</view>
  102. <!-- <view>轮胎编码:{{item.goodsNo}}</view> -->
  103. <view style="display: flex;align-items: center;justify-content: space-between;">
  104. <view>品牌:{{ item.brandName }}</view>
  105. <view>规格:{{ item.propertyName }}</view>
  106. </view>
  107. <view>花纹:{{ item.pattern }}</view>
  108. <!-- <view>轮胎描述:{{item.goodsDescription}}</view> -->
  109. <view style="display: flex;align-items: center;justify-content: space-between;">
  110. <view>批次号:{{ item.dot }}</view>
  111. <view>单位:{{ item.units }}</view>
  112. </view>
  113. <view style="display: flex;align-items: center;justify-content: space-between;">
  114. <view>出库数量:{{ item.goodsNum }}</view>
  115. <view>实际数量:{{ item.sendNum }}</view>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <view style="width: calc(96%);margin: 0 auto;background-color: #fff;
  122. border-radius: 20rpx;margin-top: 20rpx;">
  123. <u-cell-group :border="false">
  124. <u-cell :border="false" center title="图片信息" arrow-direction="down">
  125. <view slot="icon" style="width: 10rpx;height: 35rpx;
  126. background-color: #fd4b09;"></view>
  127. </u-cell>
  128. </u-cell-group>
  129. <view style="padding: 0 10rpx;">
  130. <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
  131. :maxCount="10"></u-upload>
  132. </view>
  133. </view>
  134. </u--form>
  135. <view style="width: 100%;position: fixed;
  136. bottom: 0;background-color: #fff;display: flex;">
  137. <view style="width: 48%;;margin: 20rpx auto;">
  138. <u-button v-if="form.statusName == '待出库' || form.statusName == '撤销出库'" @click="shipSubmitfun(true)"
  139. type="success" color="#67C23A" shape="circle" text="出库完成"></u-button>
  140. <u-button v-if="form.statusName == '已出库'" @click="shipRevokeOutboundCompletedfun()" type="success"
  141. color="#E6A23C" shape="circle" text="撤销出库"></u-button>
  142. </view>
  143. <view style="width: 48%;;margin: 20rpx auto;">
  144. <u-button @click="shipSubmitfun(false)" type="success" color="#fd4b09" shape="circle"
  145. text="保存数据"></u-button>
  146. </view>
  147. </view>
  148. <!-- 弹窗数据 -->
  149. <u-popup :show="popupShow" @close="popupShow = false" :closeable="true" mode="center"
  150. customStyle="width: 90%;margin: 0 auto;">
  151. <view style="padding: 40rpx 25rpx;box-sizing: border-box;">
  152. <view style="text-align: center;margin: 10rpx 0;">
  153. <view style="font-size: 36rpx;word-break:break-all;">
  154. {{ popupForm.cname }}
  155. </view>
  156. </view>
  157. <view style="width: 96%;margin: 0 auto;clear: both;">
  158. <u-cell-group>
  159. <u-cell title="商品名称">
  160. <view slot="value">
  161. {{ popupForm.goodsName ? popupForm.goodsName : '--' }}
  162. </view>
  163. </u-cell>
  164. <!-- <u-cell title="轮胎编码">
  165. <view slot="value">
  166. {{popupForm.goodsNo?popupForm.goodsNo:'--'}}
  167. </view>
  168. </u-cell> -->
  169. <u-cell title="花纹">
  170. <view slot="value">
  171. {{ popupForm.pattern ? popupForm.pattern : '--' }}
  172. </view>
  173. </u-cell>
  174. <!-- <u-cell title="轮胎描述">
  175. <view slot="value">
  176. {{popupForm.goodsDescription?popupForm.goodsDescription:'--'}}
  177. </view>
  178. </u-cell> -->
  179. <u-cell title="品牌">
  180. <view slot="value">
  181. {{ popupForm.brandName ? popupForm.brandName : '--' }}
  182. </view>
  183. </u-cell>
  184. <u-cell title="规格">
  185. <view slot="value">
  186. {{ popupForm.propertyName ? popupForm.propertyName : '--' }}
  187. </view>
  188. </u-cell>
  189. <u-cell title="批次号(DOT)" @click="getDot(popupForm)" :disabled="form.statusName == '已出库'">
  190. <view slot="value">
  191. {{ popupForm.dot ? popupForm.dot : '--' }}
  192. </view>
  193. </u-cell>
  194. <u-cell title="单位">
  195. <view slot="value">
  196. {{ popupForm.units ? popupForm.units : '--' }}
  197. </view>
  198. </u-cell>
  199. <u-cell title="出库数量">
  200. <view slot="value">
  201. {{ popupForm.goodsNum ? popupForm.goodsNum : 0 }}
  202. </view>
  203. </u-cell>
  204. <u-cell title="实际数量">
  205. <view slot="value">
  206. <u-number-box v-model="popupForm.sendNum" :min="0" :disabled="form.statusName == '已出库'">
  207. </u-number-box>
  208. </view>
  209. </u-cell>
  210. <u-cell title="备注">
  211. <view slot="value">
  212. <u--textarea style="width: 400rpx;" height="40" v-model="popupForm.remarks"
  213. :disabled="form.statusName == '已出库'" border="none"
  214. placeholder="请输入备注"></u--textarea>
  215. </view>
  216. </u-cell>
  217. </u-cell-group>
  218. </view>
  219. <view style="margin-top: 40rpx;text-align: center;
  220. font-size: 32rpx;">
  221. <view style="display: flex; color: #fff;justify-content: space-around;">
  222. <view style="color: #FD4B09; border: 1rpx solid #FD4B09;
  223. width: 200rpx; height: 80rpx;
  224. line-height: 80rpx; border-radius: 12rpx;" @click="popupShow = false">取消</view>
  225. <view
  226. style="background-color: #FF6F3B; width: 200rpx; height: 80rpx; line-height: 80rpx; border-radius: 12rpx;"
  227. @click="popupConserve()">保存</view>
  228. </view>
  229. </view>
  230. </view>
  231. </u-popup>
  232. <u-picker :show="showOpen" :columns="columns" :keyName="keyName" @cancel="showOpen = false"
  233. @confirm="showPicker"></u-picker>
  234. <u-picker :show="dotShow" :columns="dotist" keyName="dot" @cancel="dotShow = false;dotist=[]"
  235. @confirm="dotPicker"></u-picker>
  236. <u-toast ref="uToast"></u-toast>
  237. </view>
  238. </template>
  239. <script>
  240. import {
  241. quickBilling
  242. } from '@/api/views/sale/index.js'
  243. import {
  244. queryBrand,
  245. dotList
  246. } from '@/api/views/stock/index.js'
  247. import {
  248. storageDescListAll,
  249. stockClerkList
  250. } from '@/api/OutboundTask/index.js'
  251. import {
  252. shipDetail,
  253. removeFile,
  254. confirm,
  255. confirmReceipt,
  256. shipSubmit,
  257. shipItemsUpdate,
  258. shipOutboundCompleted,
  259. shipRevokeOutboundCompleted
  260. } from '@/api/views/sale/salesOrderDetails.js'
  261. import http from '@/http/api.js'
  262. import {
  263. clientId,
  264. clientSecret
  265. } from '@/common/setting'
  266. import {
  267. dateFormat
  268. } from '@/common/dateFormat'
  269. export default {
  270. data() {
  271. return {
  272. dotShow: false,
  273. dotist: [],
  274. form: {
  275. shipItemsList: []
  276. },
  277. // 附件
  278. fileList1: [],
  279. // 集合传的数据
  280. screen: [],
  281. // 单列的弹窗
  282. showOpen: false,
  283. columns: [],
  284. keyName: '',
  285. // 库管请求到的数据
  286. stockClerkData: [],
  287. // 发货仓库请求到的数据
  288. storageDescData: [],
  289. // 物流配送方式请求到的数据
  290. selectData: [],
  291. // 物流公司请求的数据
  292. logisticsCorpData: [],
  293. // 明细弹窗暂存的数据
  294. popupForm: {},
  295. popupIndex: 0,
  296. popupShow: false,
  297. }
  298. },
  299. onLoad(data) {
  300. this.stockClerkListfun()
  301. this.storageDescListAllfun()
  302. // 获取物流配送方式数据
  303. this.queryBrandfun()
  304. this.HYqueryBrandfun()
  305. this.shipDetailfun(data.id)
  306. },
  307. methods: {
  308. getDot(row) {
  309. this.dotShow = true
  310. dotList({
  311. storageId: this.form.storageId,
  312. goodsId: row.goodsId
  313. }).then(res => {
  314. this.dotist = [res.data]
  315. })
  316. },
  317. dotPicker(e) {
  318. console.log(e)
  319. this.dotShow=false
  320. this.dotist=[]
  321. this.popupForm.dot=e.value[0].dot
  322. },
  323. // 出库明细删除
  324. shipItemsDelfun(index, id) {
  325. if (this.form.statusName == '已出库') return
  326. uni.showModal({
  327. title: '提示',
  328. content: '是否确认删除',
  329. success: (rest) => {
  330. if (rest.confirm == true) {
  331. if (id) {
  332. shipItemsUpdate({
  333. id: id
  334. }).then(res => {
  335. this.form.shipItemsList.splice(index, 1)
  336. uni.showToast({
  337. icon: "none",
  338. title: '删除成功',
  339. mask: true
  340. });
  341. })
  342. } else {
  343. this.form.shipItemsList.splice(index, 1)
  344. }
  345. }
  346. }
  347. })
  348. },
  349. // 保存数据 false 普通保存 true 出库任务和保存
  350. shipSubmitfun(type) {
  351. if (!this.form.storageId) {
  352. return uni.showToast({
  353. title: '仓库不能为空',
  354. icon: 'none',
  355. mask: true
  356. });
  357. }
  358. if (!this.form.stockClerkId) {
  359. return uni.showToast({
  360. title: '库管不能为空',
  361. icon: 'none',
  362. mask: true
  363. });
  364. }
  365. uni.showLoading({
  366. title: '加载中',
  367. mask: true
  368. });
  369. shipSubmit({
  370. ...this.form,
  371. bizTypeName: "FHGD",
  372. filesList: this.fileList1
  373. }).then(res => {
  374. if (type) {
  375. this.shipOutboundCompletedfun()
  376. } else {
  377. uni.hideLoading();
  378. uni.showToast({
  379. icon: "none",
  380. title: '保存成功',
  381. mask: true
  382. });
  383. this.shipDetailfun(res.data.id)
  384. }
  385. })
  386. },
  387. // 出库完成接口
  388. shipOutboundCompletedfun() {
  389. shipOutboundCompleted({
  390. ...this.form,
  391. bizTypeName: "FHGD",
  392. filesList: this.fileList1
  393. }).then(res => {
  394. uni.hideLoading();
  395. // uni.showToast({
  396. // icon: "none",
  397. // title: '出库成功',
  398. // mask: true
  399. // });
  400. this.$refs.uToast.show({
  401. type: 'success',
  402. message: "出库成功",
  403. })
  404. this.shipDetailfun(res.data.id, true)
  405. })
  406. },
  407. // 撤销出库接口
  408. shipRevokeOutboundCompletedfun() {
  409. uni.showLoading({
  410. title: '加载中',
  411. mask: true
  412. });
  413. shipRevokeOutboundCompleted({
  414. ...this.form,
  415. bizTypeName: "FHGD",
  416. filesList: this.fileList1
  417. }).then(res => {
  418. // uni.showToast({
  419. // icon: "none",
  420. // title: '撤销出库成功',
  421. // mask: true
  422. // });
  423. uni.hideLoading();
  424. this.$refs.uToast.show({
  425. type: 'success',
  426. message: "撤销出库成功",
  427. })
  428. this.shipDetailfun(res.data.id, true)
  429. })
  430. },
  431. // 修改弹窗打开
  432. tanchufun(item, index) {
  433. this.popupForm = item
  434. this.popupIndex = index
  435. this.popupShow = true
  436. },
  437. //修改弹窗点击保存事件
  438. popupConserve() {
  439. if (this.popupForm.sendNum <= 0 || this.popupForm.sendNum > this.popupForm.goodsNum) {
  440. return uni.showToast({
  441. title: '实际数量不能为零或大于出库数量',
  442. icon: 'none',
  443. mask: true
  444. });
  445. }
  446. this.form.shipItemsList[this.popupIndex] = this.popupForm
  447. this.popupShow = false
  448. },
  449. // 获取业务员数据
  450. stockClerkListfun() {
  451. stockClerkList().then(res => {
  452. this.stockClerkData = res.data
  453. })
  454. },
  455. // 获取发货仓库数据
  456. storageDescListAllfun() {
  457. storageDescListAll().then(res => {
  458. this.storageDescData = res.data
  459. })
  460. },
  461. // 获取物流配送方式数据
  462. queryBrandfun() {
  463. queryBrand({
  464. code: 'deliveryMethod'
  465. }).then(res => {
  466. this.selectData = res.data
  467. })
  468. },
  469. // 获取货运公司数据
  470. HYqueryBrandfun() {
  471. queryBrand({
  472. code: 'tyre_express_company'
  473. }).then(res => {
  474. this.logisticsCorpData = res.data
  475. })
  476. },
  477. deleteProduct(index) {
  478. let this_ = this
  479. this_.form.shipItemsList.splice(index, 1)
  480. },
  481. // 下拉选择
  482. showPicker(e) {
  483. if (this.screen[1] == "storageId") {
  484. this.form.storageId = e.value[0].id
  485. this.form.storageName = e.value[0].cname
  486. this.showOpen = false
  487. } else if (this.screen[1] == "stockClerkId") {
  488. this.form.stockClerkId = e.value[0].id
  489. this.form.stockClerkName = e.value[0].name
  490. this.showOpen = false
  491. } else if (this.screen[1] == "shipType") {
  492. this.form.shipType = e.value[0].dictValue
  493. this.showOpen = false
  494. } else if (this.screen[1] == "logisticsCorpId") {
  495. this.form.logisticsCorpName = e.value[0].dictValue
  496. this.form.logisticsCorpId = e.value[0].dictKey
  497. this.showOpen = false
  498. }
  499. },
  500. //集合筛选条件
  501. filterAll(screen) {
  502. if (this.form.statusName == '已出库') return
  503. this.screen = screen
  504. switch (screen[1]) {
  505. case "storageId":
  506. this.columns = [this.storageDescData]
  507. this.keyName = 'cname'
  508. this.showOpen = true
  509. break;
  510. case "stockClerkId":
  511. this.columns = [this.stockClerkData]
  512. this.keyName = 'name'
  513. this.showOpen = true
  514. break;
  515. case "shipType":
  516. this.columns = [this.selectData]
  517. this.keyName = 'dictValue'
  518. this.showOpen = true
  519. break;
  520. case "logisticsCorpId":
  521. this.columns = [this.logisticsCorpData]
  522. this.keyName = 'dictValue'
  523. this.showOpen = true
  524. break;
  525. }
  526. },
  527. // 详情接口
  528. shipDetailfun(id, type) {
  529. if (!type) {
  530. uni.showLoading({
  531. title: '加载中',
  532. mask: true
  533. });
  534. }
  535. shipDetail({
  536. id: id
  537. }).then(res => {
  538. this.form = res.data
  539. this.fileList1 = res.data.filesList
  540. uni.hideLoading();
  541. })
  542. },
  543. // 新增图片
  544. async afterRead(event) {
  545. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  546. let lists = [].concat(event.file)
  547. let fileListLen = this[`fileList${event.name}`].length
  548. lists.map((item) => {
  549. this[`fileList${event.name}`].push({
  550. ...item,
  551. })
  552. })
  553. for (let i = 0; i < lists.length; i++) {
  554. const result = await this.uploadFilePromise(lists[i].url)
  555. let item = this[`fileList${event.name}`][fileListLen]
  556. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  557. fileName: JSON.parse(result).data.originalName,
  558. url: JSON.parse(result).data.link
  559. }))
  560. console.log(this[`fileList${event.name}`], 416);
  561. fileListLen++
  562. }
  563. },
  564. uploadFilePromise(url) {
  565. return new Promise((resolve, reject) => {
  566. let a = uni.uploadFile({
  567. url: http.config.baseURL +
  568. '/blade-resource/oss/endpoint/put-file', // 仅为示例,非真实的接口地址
  569. filePath: url,
  570. name: 'file',
  571. formData: {
  572. user: 'test'
  573. },
  574. header: {
  575. // 客户端认证参数
  576. 'Authorization': 'Basic ' + Base64.encode(clientId + ':' +
  577. clientSecret),
  578. 'Blade-Auth': 'bearer ' + uni.getStorageSync('accessToken')
  579. },
  580. success: (res) => {
  581. setTimeout(() => {
  582. resolve(res.data)
  583. }, 1000)
  584. }
  585. });
  586. })
  587. },
  588. // 删除图片
  589. deletePic(event) {
  590. let this_ = this
  591. uni.showModal({
  592. title: '提示',
  593. content: '是否确认删除',
  594. success: function(rest) {
  595. if (rest.confirm == true) {
  596. if (this_[`fileList${event.name}`][event.index].id) {
  597. removeFile({
  598. ids: this_[`fileList${event.name}`][event.index].id
  599. }).then(res => {
  600. this_[`fileList${event.name}`].splice(event.index, 1)
  601. })
  602. } else {
  603. this_[`fileList${event.name}`].splice(event.index, 1)
  604. }
  605. }
  606. }
  607. })
  608. },
  609. }
  610. }
  611. </script>
  612. <style lang="scss" scoped>
  613. ::v-deep .u-cell__body {
  614. padding: 20rpx 10rpx;
  615. }
  616. </style>