details.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. <template>
  2. <view class="">
  3. <uni-section title="基本信息" style="padding: 0 62rpx;" titleColor="5F5F5F" titleFontSize="28rpx">
  4. <uni-forms ref="form1" :modelValue="form" :border="true" label-width="80">
  5. <uni-forms-item name="cname" label="店铺名称" required>
  6. <uni-easyinput v-model="form.cname" class="right-align" placeholder-class="placeholder-right"
  7. placeholder="请输入内容" :inputBorder="false" :clearable="false" :disabled="form.enableOrNot==1">
  8. </uni-easyinput>
  9. </uni-forms-item>
  10. <uni-forms-item name="corpsFilesList" label="店面照片" required>
  11. <view style="display: flex;align-items: center;">
  12. <uni-file-picker :value="form.corpsFilesList.filter(item=>item.isDeleted==0)"
  13. return-type="array" limit="9" :imageStyles="imageStyles" :auto-upload="false"
  14. @select="corpsfileSelect" @delete="fileDelete" :del-icon="!(form.enableOrNot==1)"
  15. :disabled="form.enableOrNot==1"></uni-file-picker>
  16. </view>
  17. </uni-forms-item>
  18. <uni-forms-item name="businessLicense" label="营业执照">
  19. <view style="display: flex;align-items: center;">
  20. <uni-file-picker v-model="form.businessLicense" return-type="object" limit="1"
  21. :imageStyles="imageStyles" file-mediatype="image" @select="businessLicenseSelect"
  22. :del-icon="!(form.enableOrNot==1)" :disabled="form.enableOrNot==1">
  23. </uni-file-picker>
  24. </view>
  25. </uni-forms-item>
  26. <uni-forms-item name="contacts" label="联系人" required>
  27. <uni-easyinput v-model="form.contacts" class="right-align" placeholder-class="placeholder-right"
  28. placeholder="请输入内容" :inputBorder="false" :clearable="false"
  29. :disabled="form.enableOrNot==1"></uni-easyinput>
  30. </uni-forms-item>
  31. <uni-forms-item name="contactsPhone" label="电话" required>
  32. <uni-easyinput v-model="form.contactsPhone" class="right-align" type="number"
  33. placeholder-class="placeholder-right" placeholder="请输入内容" :inputBorder="false"
  34. :clearable="false" :disabled="form.enableOrNot==1" maxlength="11"
  35. @change="photoChange"></uni-easyinput>
  36. </uni-forms-item>
  37. <uni-forms-item name="salesmanName" label="业务员" required>
  38. <view style="display: flex;align-items: center;height: 36px;">
  39. <view @click="getSalerList();form.enableOrNot!=1?salesmanShow=true:null"
  40. style="width: 100%;text-align: right;"
  41. :style="form.salesmanName?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
  42. {{form.salesmanName||'请选择'}}
  43. </view>
  44. <uni-icons v-if="!form.salesmanName" type="down" size="14" color='#BCBCBC'
  45. @click="getSalerList();form.enableOrNot!=1?salesmanShow=true:null"></uni-icons>
  46. </view>
  47. <u-picker :show="salesmanShow" :columns="salesmanList" keyName="name" @confirm="salesmanConfirm"
  48. @cancel="salesmanShow=false" @close="salesmanShow=false" closeOnClickOverlay></u-picker>
  49. </uni-forms-item>
  50. <uni-forms-item name="deliveryWarehouseName" label="发货仓库" required>
  51. <view style="display: flex;align-items: center;height: 36px;">
  52. <view @click="getStorageList();form.enableOrNot!=1?deliveryWarehouseShow=true:null"
  53. style="width: 100%;text-align: right;"
  54. :style="form.deliveryWarehouseName?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
  55. {{form.deliveryWarehouseName||'请选择'}}
  56. </view>
  57. <uni-icons v-if="!form.deliveryWarehouseName" type="down" size="14" color='#BCBCBC'
  58. @click="getStorageList();form.enableOrNot!=1?deliveryWarehouseShow=true:null"></uni-icons>
  59. </view>
  60. <u-picker :show="deliveryWarehouseShow" :columns="deliveryWarehouseList" keyName="cname"
  61. @confirm="deliveryWarehouseConfirm" @cancel="deliveryWarehouseShow=false"
  62. @close="deliveryWarehouseShow=false" closeOnClickOverlay></u-picker>
  63. </uni-forms-item>
  64. <uni-forms-item name="priceSystem" label="商城价格" required>
  65. <view style="display: flex;align-items: center;height: 36px;">
  66. <view @click="form.enableOrNot!=1?priceSystemShow=true:null"
  67. style="width: 100%;text-align: right;"
  68. :style="form.priceSystem?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
  69. {{form.priceSystem||'请选择'}}
  70. </view>
  71. <uni-icons v-if="!form.priceSystem" type="down" size="14" color='#BCBCBC'
  72. @click="form.enableOrNot!=1?priceSystemShow=true:null"></uni-icons>
  73. </view>
  74. <u-picker :show="priceSystemShow" :columns="priceSystemList" keyName="dictValue"
  75. @confirm="priceSystemConfirm" @cancel="priceSystemShow=false" @close="priceSystemShow=false"
  76. closeOnClickOverlay></u-picker>
  77. </uni-forms-item>
  78. <uni-forms-item name="brandName" label="品牌">
  79. <view>
  80. <view style="display: flex;align-items: center;height: 36px;">
  81. <view class="slot-box" @click="brandPopup">
  82. <view v-for="(item,index) in sliceArray(form.brandName)" :key="index"
  83. class="slot-content-item">
  84. {{item}}
  85. </view>
  86. <view v-if="form.brandName.length > 2" class="slot-content-item">
  87. +{{form.brandName.length - 2}}</view>
  88. <view v-if="form.brandName.length == 0" style="color:#B5B4B4;font-size: 24rpx;">
  89. 请选择
  90. </view>
  91. </view>
  92. <uni-icons v-if="!form.brandName.length" type="down" size="14" color='#BCBCBC'
  93. @click="brandPopup"></uni-icons>
  94. </view>
  95. <uni-popup ref="brand" type="bottom" @change="popupChange">
  96. <view class="popup-content">
  97. <view class="popup-content-checkbox">
  98. <scroll-view scroll-y="true" style="height: 600rpx;" :show-scrollbar="false">
  99. <uni-data-checkbox mode="tag" multiple v-model="form.brandName"
  100. :localdata="brandList" @change="brandChange" selectedColor='#03803B'
  101. :map="brandObject" />
  102. </scroll-view>
  103. </view>
  104. <debounce-button class="confirm-btn" @click="brandConfirm">确认</debounce-button>
  105. </view>
  106. </uni-popup>
  107. </view>
  108. </uni-forms-item>
  109. <uni-forms-item name="address" label="所属区域" required>
  110. <!-- <uni-data-picker v-model="form.address" :localdata="addressData" popup-title="请选择所属区域"
  111. :map="mapObject" :inputBorder="false" :clear-icon="false"
  112. :readonly="form.enableOrNot==1"></uni-data-picker> -->
  113. <view style="display: flex;align-items: center;height: 36px;">
  114. <view @click="openMap" style="width: 100%;text-align: right;"
  115. :style="form.address?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
  116. {{form.address||'请选择'}}
  117. </view>
  118. <uni-icons v-if="!form.address" type="location" size="24" color='#03803B'
  119. @click="openMap"></uni-icons>
  120. </view>
  121. </uni-forms-item>
  122. <uni-forms-item name="detailedAddress" label="详细地址" required>
  123. <uni-easyinput v-model="form.detailedAddress" type="textarea" autoHeight class="right-align"
  124. placeholder-class="placeholder-right" placeholder="请输入内容" :inputBorder="false"
  125. :clearable="false" :disabled="form.enableOrNot==1"></uni-easyinput>
  126. </uni-forms-item>
  127. </uni-forms>
  128. </uni-section>
  129. <uni-section title="店面分类" style="padding: 0 62rpx;margin-top: 30rpx;" titleColor="5F5F5F" titleFontSize="28rpx">
  130. <uni-forms ref="form2" :modelValue="form" :border="true" label-width="80">
  131. <uni-forms-item name="corpsTypeName" label="店面分类" required>
  132. <view style="display: flex;align-items: center;height: 36px;">
  133. <view @click="getSelectType();form.enableOrNot!=1?corpsTypeShow=true:null"
  134. style="width: 100%;text-align: right;"
  135. :style="form.corpsTypeName?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
  136. {{form.corpsTypeName||'请选择'}}
  137. </view>
  138. <uni-icons v-if="!form.corpsTypeName" type="down" size="14" color='#BCBCBC'
  139. @click="getSelectType();form.enableOrNot!=1?corpsTypeShow=true:null"></uni-icons>
  140. </view>
  141. <u-picker :show="corpsTypeShow" :columns="corpsTypeList" keyName="cname" @confirm="corpsTypeConfirm"
  142. @cancel="corpsTypeShow=false" @close="corpsTypeShow=false" closeOnClickOverlay></u-picker>
  143. </uni-forms-item>
  144. <uni-forms-item name="storeAttributes" label="店面属性">
  145. <view>
  146. <view style="display: flex;align-items: center;height: 36px;">
  147. <view @click="form.enableOrNot!=1?storeAttributesShow=true:null"
  148. style="width: 100%;text-align: right;"
  149. :style="form.storeAttributes?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
  150. {{form.storeAttributes||'请选择'}}
  151. </view>
  152. <uni-icons v-if="!form.storeAttributes" type="down" size="14" color='#BCBCBC'
  153. @click="form.enableOrNot!=1?storeAttributesShow=true:null"></uni-icons>
  154. </view>
  155. <u-picker :show="storeAttributesShow" :columns="storeAttributesList" keyName="dictValue"
  156. @confirm="storeAttributesConfirm" @cancel="storeAttributesShow=false"
  157. @close="storeAttributesShow=false" closeOnClickOverlay></u-picker>
  158. </view>
  159. </uni-forms-item>
  160. <uni-forms-item name="chainAttribute" label="连锁属性">
  161. <view>
  162. <view style="display: flex;align-items: center;height: 36px;">
  163. <view @click="form.enableOrNot!=1?chainAttributeShow=true:null"
  164. style="width: 100%;text-align: right;"
  165. :style="form.chainAttribute?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
  166. {{form.chainAttribute||'请选择'}}
  167. </view>
  168. <uni-icons v-if="!form.chainAttribute" type="down" size="14" color='#BCBCBC'
  169. @click="form.enableOrNot!=1?chainAttributeShow=true:null"></uni-icons>
  170. </view>
  171. <u-picker :show="chainAttributeShow" :columns="chainAttributeList" keyName="dictValue"
  172. @confirm="chainAttributeConfirm" @cancel="chainAttributeShow=false"
  173. @close="chainAttributeShow=false" closeOnClickOverlay></u-picker>
  174. </view>
  175. </uni-forms-item>
  176. <uni-forms-item name="label" label="店面标签">
  177. <view>
  178. <view style="display: flex;align-items: center;height: 36px;">
  179. <view class="slot-box" @click="openPopup">
  180. <view v-for="(item,index) in sliceArray(form.label)" :key="index"
  181. class="slot-content-item">
  182. {{item}}
  183. </view>
  184. <view v-if="form.label.length > 2" class="slot-content-item">
  185. +{{form.label.length - 2}}</view>
  186. <view v-if="form.label.length == 0" style="color:#B5B4B4;font-size: 24rpx;">
  187. 请选择
  188. </view>
  189. </view>
  190. <uni-icons v-if="!form.label.length" type="down" size="14" color='#BCBCBC'
  191. @click="openPopup"></uni-icons>
  192. </view>
  193. <uni-popup ref="popup" type="bottom" @change="popupChange">
  194. <view class="popup-content">
  195. <view class="popup-content-checkbox">
  196. <scroll-view scroll-y="true" style="height: 600rpx;" :show-scrollbar="false">
  197. <uni-data-checkbox mode="tag" multiple v-model="form.label"
  198. :localdata="labelList" @change="onChange" selectedColor='#03803B'
  199. :map="labelObject" />
  200. </scroll-view>
  201. </view>
  202. <debounce-button class="confirm-btn" @click="labelConfirm">确认</debounce-button>
  203. </view>
  204. </uni-popup>
  205. </view>
  206. </uni-forms-item>
  207. </uni-forms>
  208. </uni-section>
  209. <uni-section title="商务政策" style="padding: 0 62rpx;margin-top: 30rpx;" titleColor="5F5F5F" titleFontSize="28rpx">
  210. <uni-forms ref="form3" :modelValue="form" :border="true" label-width="80">
  211. <uni-forms-item name="signingLevel" label="签约级别">
  212. <!-- <uni-data-select v-model="form.signingLevel" :localdata="signingLevelList">
  213. </uni-data-select> -->
  214. <view>
  215. <view style="display: flex;align-items: center;height: 36px;">
  216. <view @click="form.enableOrNot!=1?signingLevelShow=true:null"
  217. style="width: 100%;text-align: right;"
  218. :style="form.signingLevel?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
  219. {{form.signingLevel||'请选择'}}
  220. </view>
  221. <uni-icons v-if="!form.signingLevel" type="down" size="14" color='#BCBCBC'
  222. @click="form.enableOrNot!=1?signingLevelShow=true:null"></uni-icons>
  223. </view>
  224. <u-picker :show="signingLevelShow" :columns="signingLevelList" keyName="dictValue"
  225. @confirm="signingLevelConfirm" @cancel="signingLevelShow=false"
  226. @close="signingLevelShow=false" closeOnClickOverlay></u-picker>
  227. </view>
  228. </uni-forms-item>
  229. <uni-forms-item name="signingNumber" label="签约条数">
  230. <uni-easyinput v-model="form.signingNumber" class="right-align"
  231. placeholder-class="placeholder-right" placeholder="请输入内容" :inputBorder="false"
  232. :clearable="false" :disabled="form.enableOrNot==1" type="number"
  233. @blur="intBlur('signingNumber',form.signingNumber)"></uni-easyinput>
  234. </uni-forms-item>
  235. <uni-forms-item name="signingPeriodEnd" label="签约期限">
  236. <uni-datetime-picker v-model="form.signingPeriodEnd" type="date" :clear-icon="false" :border="false"
  237. placeholder="请选择签约期限" :disabled="form.enableOrNot==1"></uni-datetime-picker>
  238. </uni-forms-item>
  239. <uni-forms-item name="checkStatus" label="门店状态">
  240. <view style="display: flex;justify-content: flex-end;align-items: center;height: 70rpx;">
  241. <text v-if="form.checkStatus=='录入'" style="color:#e6a23c">
  242. 录入
  243. </text>
  244. <text v-if="form.checkStatus=='提交'" style="color:#409EFF">
  245. 提交
  246. </text>
  247. <text v-if="form.checkStatus=='审核通过'" style="color:#67c23a">
  248. 审核通过
  249. </text>
  250. <text v-if="form.checkStatus=='审核驳回'" style="color:#f56c6c">
  251. 审核驳回
  252. </text>
  253. </view>
  254. </uni-forms-item>
  255. </uni-forms>
  256. </uni-section>
  257. <!--<view v-if="form.enableOrNot!=1" style="padding:30rpx 20rpx;">
  258. <view>
  259. <debounce-button bgColor="#03803B" @click="submit">保存</debounce-button>
  260. </view>
  261. </view> -->
  262. <view v-if="form.enableOrNot!=1" class="nav-bottom-height">
  263. </view>
  264. <view v-if="form.enableOrNot!=1&&!popupShow" class="goods-nav-bottom">
  265. <uni-goods-nav v-if="form.checkStatus=='录入'||form.checkStatus=='审核驳回'" :fill="true" :options="[]" :buttonGroup="buttonGroup"
  266. @buttonClick="buttonClick" />
  267. <uni-goods-nav v-if="!(form.checkStatus=='录入'||form.checkStatus=='审核驳回')" :fill="true" :options="[]" :buttonGroup="buttonGroup2"
  268. @buttonClick="buttonClick2" />
  269. </view>
  270. </view>
  271. </template>
  272. <script>
  273. import http from '@/http/api.js'
  274. import {
  275. clientId,
  276. clientSecret
  277. } from '@/common/setting'
  278. import {
  279. submit,
  280. getDetail,
  281. review,
  282. selectType,
  283. selectLabel,
  284. fileRemove,
  285. salerList,
  286. storageList,
  287. brandDesc
  288. } from '@/api/home/store.js'
  289. export default {
  290. data() {
  291. return {
  292. popupShow:false,
  293. buttonGroup: [{
  294. text: '通过',
  295. backgroundColor: '#18bc37',
  296. color: '#fff'
  297. },
  298. {
  299. text: '驳回',
  300. backgroundColor: '#e64340',
  301. color: '#fff'
  302. }
  303. ],
  304. buttonGroup2: [{
  305. text: '保存',
  306. backgroundColor: '#03803B',
  307. color: '#fff'
  308. }],
  309. corpsTypeShow: false,
  310. storeAttributesShow: false,
  311. chainAttributeShow: false,
  312. signingLevelShow: false,
  313. salesmanShow: false,
  314. deliveryWarehouseShow: false,
  315. priceSystemShow: false,
  316. form: {
  317. corpsTypeId: null,
  318. corpsTypeName: null,
  319. storeAttributes: null,
  320. chainAttribute: null,
  321. signingLevel: null,
  322. dimension: null,
  323. longitude: null,
  324. address: null,
  325. detailedAddress: null,
  326. label: [],
  327. brandName: [],
  328. corpsFilesList: [],
  329. businessLicense: {}
  330. },
  331. imageStyles: {
  332. width: 46,
  333. height: 46
  334. },
  335. mapObject: {
  336. text: 'name',
  337. value: 'code',
  338. children: 'children'
  339. },
  340. labelObject: {
  341. text: 'label',
  342. value: 'label',
  343. },
  344. brandObject: {
  345. text: 'cname',
  346. value: 'cname',
  347. },
  348. addressData: [],
  349. labelList: [],
  350. corpsTypeList: [],
  351. storeAttributesList: [],
  352. chainAttributeList: [],
  353. signingLevelList: [],
  354. salesmanList: [],
  355. brandList: [],
  356. deliveryWarehouseList: [],
  357. priceSystemList: [],
  358. mapData: {},
  359. errData: {},
  360. }
  361. },
  362. onLoad(option) {
  363. uni.$on('commitCheck', (data) => {
  364. this.form.address = (data.province ? data.province : '') + (data.city ? "," + data.city :
  365. '') + (data.district ? "," + data.district : '')
  366. this.form.detailedAddress = data.name
  367. this.form.longitude = data.location ? data.location.split(',')[0] : null
  368. this.form.dimension = data.location ? data.location.split(',')[1] : null
  369. });
  370. this.getSelectType()
  371. this.getLabel()
  372. this.getSalerList()
  373. this.getStorageList()
  374. this.getDictionary()
  375. this.getBrandlist()
  376. if (option && option.id) {
  377. this.getDetail(option.id)
  378. }
  379. },
  380. onUnload() {
  381. uni.$off();
  382. },
  383. methods: {
  384. popupChange(e){
  385. console.log(e)
  386. this.popupShow=e.show
  387. },
  388. buttonClick(e) {
  389. if (e.index == 0) {
  390. this.approval(1)
  391. }
  392. if (e.index == 1) {
  393. this.approval(2)
  394. }
  395. },
  396. buttonClick2(e) {
  397. if (e.index == 0) {
  398. this.submit()
  399. }
  400. },
  401. openMap() {
  402. if (this.form.enableOrNot != 1) {
  403. if (this.form.longitude && this.form.dimension) {
  404. uni.navigateTo({
  405. url: `/pages/home/store/map/index?longitude=${this.form.longitude}&latitude=${this.form.dimension}`
  406. });
  407. } else {
  408. uni.navigateTo({
  409. url: `/pages/home/store/map/index`
  410. });
  411. }
  412. }
  413. },
  414. photoChange(val) {
  415. if (val) {
  416. if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(val)) {
  417. uni.showToast({
  418. title: '请输入正确电话',
  419. icon: 'none'
  420. });
  421. return;
  422. }
  423. }
  424. },
  425. intBlur(name, value) {
  426. if (!this.form[name]) return
  427. // 使用toFixed处理小数位
  428. try {
  429. const num = parseFloat(this.form[name])
  430. if (!isNaN(num)) {
  431. this.form[name] = Math.floor(num).toFixed(0)
  432. }
  433. } catch (e) {
  434. console.error('格式化错误', e)
  435. }
  436. },
  437. openPopup() {
  438. if (this.form.enableOrNot != 1) {
  439. this.getLabel()
  440. this.$refs.popup.open()
  441. }
  442. },
  443. brandPopup() {
  444. if (this.form.enableOrNot != 1) {
  445. this.getBrandlist()
  446. this.$refs.brand.open()
  447. }
  448. },
  449. onChange(e) {
  450. console.log('当前选中:', e.detail.value)
  451. },
  452. brandChange(e) {
  453. console.log('当前选中:', e.detail)
  454. let ids = []
  455. e.detail.data.forEach(item => {
  456. ids.push(item.id)
  457. })
  458. this.form.brandId = ids.join(',')
  459. },
  460. labelConfirm() {
  461. this.$refs.popup.close()
  462. // 提交选中值逻辑...
  463. },
  464. brandConfirm() {
  465. this.$refs.brand.close()
  466. // 提交选中值逻辑...
  467. },
  468. clear(name) {
  469. if (name == 'corpsTypeName') {
  470. this.form.corpsTypeId = null
  471. this.form.corpsTypeName = null
  472. }
  473. if (name == 'salesmanName') {
  474. this.form.salesmanId = null
  475. this.form.salesmanName = null
  476. }
  477. if (name == 'deliveryWarehouseName') {
  478. this.form.deliveryWarehouseId = null
  479. this.form.deliveryWarehouseName = null
  480. }
  481. },
  482. salesmanConfirm(row) {
  483. this.form.salesmanId = row.value[0].id
  484. this.form.salesmanName = row.value[0].name
  485. this.salesmanShow = false
  486. },
  487. deliveryWarehouseConfirm(row) {
  488. this.form.deliveryWarehouseId = row.value[0].id
  489. this.form.deliveryWarehouseName = row.value[0].cname
  490. this.deliveryWarehouseShow = false
  491. },
  492. priceSystemConfirm(row) {
  493. this.form.priceSystem = row.value[0].dictValue
  494. this.priceSystemShow = false
  495. },
  496. corpsTypeConfirm(row) {
  497. this.form.corpsTypeId = row.value[0].id
  498. this.form.corpsTypeName = row.value[0].cname
  499. this.corpsTypeShow = false
  500. },
  501. storeAttributesConfirm(row) {
  502. this.form.storeAttributes = row.value[0].dictValue
  503. this.storeAttributesShow = false
  504. },
  505. chainAttributeConfirm(row) {
  506. this.form.chainAttribute = row.value[0].dictValue
  507. this.chainAttributeShow = false
  508. },
  509. signingLevelConfirm(row) {
  510. this.form.signingLevel = row.value[0].dictValue
  511. this.signingLevelShow = false
  512. },
  513. getDictionary() {
  514. this.$u.api.dictionary('storeAttributes').then(res => {
  515. this.storeAttributesList = [res.data]
  516. })
  517. this.$u.api.dictionary('chainAttribute').then(res => {
  518. this.chainAttributeList = [res.data]
  519. })
  520. this.$u.api.dictionary('signingLevel').then(res => {
  521. this.signingLevelList = [res.data]
  522. })
  523. this.$u.api.dictionary('mall_price').then(res => {
  524. this.priceSystemList = [res.data]
  525. })
  526. },
  527. sliceArray(ls) {
  528. if (Array.isArray(ls)) {
  529. return ls.slice(0, 2)
  530. }
  531. return ls
  532. },
  533. getSelectType() {
  534. selectType().then(res => {
  535. this.corpsTypeList = [res.data]
  536. })
  537. },
  538. getLabel() {
  539. selectLabel().then(res => {
  540. this.labelList = res.data
  541. })
  542. },
  543. getSalerList() {
  544. salerList().then(res => {
  545. this.salesmanList = [res.data]
  546. })
  547. },
  548. getStorageList() {
  549. storageList().then(res => {
  550. this.deliveryWarehouseList = [res.data]
  551. })
  552. },
  553. getBrandlist() {
  554. brandDesc().then(res => {
  555. this.brandList = res.data
  556. })
  557. },
  558. getFileExtension(filename) {
  559. return filename.slice(((filename.lastIndexOf(".") - 1) >>> 0) + 2);
  560. },
  561. businessLicenseSelect(files) {
  562. files.tempFiles.forEach(file => {
  563. uni.showLoading({
  564. title: '加载中',
  565. mask: true
  566. });
  567. uni.uploadFile({
  568. url: http.config.baseURL +
  569. '/blade-resource/oss/endpoint/put-file', // 仅为示例,非真实的接口地址
  570. filePath: file.path,
  571. header: {
  572. // 客户端认证参数
  573. 'Authorization': 'Basic ' + Base64.encode(clientId + ':' + clientSecret),
  574. 'Blade-Auth': 'bearer ' + uni.getStorageSync('accessToken')
  575. },
  576. name: 'file',
  577. success: (res) => {
  578. const data = JSON.parse(res.data).data
  579. this.form.businessLicense = {
  580. url: data.link,
  581. name: data.originalName,
  582. extname: this.getFileExtension(data.originalName)
  583. }
  584. this.form.businessLicenseUrl = data.link
  585. uni.showToast({
  586. title: '上传成功',
  587. icon: 'none'
  588. });
  589. },
  590. fail: (err) => {
  591. uni.showToast({
  592. title: '上传失败',
  593. icon: 'none'
  594. });
  595. },
  596. complete: () => {
  597. uni.hideLoading()
  598. }
  599. })
  600. })
  601. },
  602. fileDelete(row) {
  603. uni.showToast({
  604. title: '删除成功',
  605. icon: 'none'
  606. });
  607. this.form.corpsFilesList.filter(item => item.isDeleted == 0)[row.index].isDeleted = 1
  608. },
  609. corpsfileSelect(files) {
  610. uni.showLoading({
  611. title: '加载中',
  612. mask: true
  613. });
  614. files.tempFiles.forEach(file => {
  615. uni.uploadFile({
  616. url: http.config.baseURL +
  617. '/blade-resource/oss/endpoint/put-file', // 仅为示例,非真实的接口地址
  618. filePath: file.path,
  619. header: {
  620. // 客户端认证参数
  621. 'Authorization': 'Basic ' + Base64.encode(clientId + ':' + clientSecret),
  622. 'Blade-Auth': 'bearer ' + uni.getStorageSync('accessToken')
  623. },
  624. name: 'file',
  625. success: (res) => {
  626. const data = JSON.parse(res.data).data
  627. this.form.corpsFilesList.push({
  628. url: data.link,
  629. name: data.originalName,
  630. extname: this.getFileExtension(data.originalName),
  631. isDeleted: 0
  632. })
  633. uni.showToast({
  634. title: '上传成功',
  635. icon: 'none'
  636. });
  637. },
  638. fail: (err) => {
  639. uni.showToast({
  640. title: '上传失败',
  641. icon: 'none'
  642. });
  643. },
  644. complete: () => {
  645. uni.hideLoading()
  646. }
  647. })
  648. })
  649. },
  650. async submit() {
  651. if (!this.form.cname) {
  652. uni.showToast({
  653. title: '请输入店铺名称',
  654. icon: 'none'
  655. });
  656. return
  657. }
  658. if (this.form.corpsFilesList.filter(item => item.isDeleted == 0).length == 0) {
  659. uni.showToast({
  660. title: '请上传店面照片',
  661. icon: 'none'
  662. });
  663. return
  664. }
  665. if (!this.form.contacts) {
  666. uni.showToast({
  667. title: '请输入联系人',
  668. icon: 'none'
  669. });
  670. return
  671. }
  672. if (!this.form.contactsPhone) {
  673. uni.showToast({
  674. title: '请输入电话',
  675. icon: 'none'
  676. });
  677. return
  678. }
  679. if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.contactsPhone)) {
  680. uni.showToast({
  681. title: '请输入正确电话',
  682. icon: 'none'
  683. });
  684. return;
  685. }
  686. if (!this.form.salesmanName) {
  687. uni.showToast({
  688. title: '请选择业务员',
  689. icon: 'none'
  690. });
  691. return
  692. }
  693. if (!this.form.deliveryWarehouseName) {
  694. uni.showToast({
  695. title: '请选择发货仓库',
  696. icon: 'none'
  697. });
  698. return
  699. }
  700. if (!this.form.priceSystem) {
  701. uni.showToast({
  702. title: '请选择商城价格',
  703. icon: 'none'
  704. });
  705. return
  706. }
  707. if (!this.form.address) {
  708. uni.showToast({
  709. title: '请选择所属区域',
  710. icon: 'none'
  711. });
  712. return
  713. }
  714. if (!this.form.detailedAddress) {
  715. uni.showToast({
  716. title: '请输入详细地址',
  717. icon: 'none'
  718. });
  719. return
  720. }
  721. if (!this.form.corpsTypeId) {
  722. uni.showToast({
  723. title: '请选择店面分类',
  724. icon: 'none'
  725. });
  726. return
  727. }
  728. let obj = await this.convertData(this.$deepClone(this.form))
  729. uni.showLoading({
  730. title: '加载中',
  731. mask: true
  732. });
  733. submit(obj).then(res => {
  734. setTimeout(() => {
  735. uni.showToast({
  736. title: '保存成功',
  737. icon: 'none',
  738. });
  739. }, 10);
  740. uni.setStorageSync('isUpdate', true)
  741. this.getDetail(res.data.id)
  742. })
  743. .catch(() => {
  744. uni.hideLoading()
  745. });
  746. },
  747. getDetail(id) {
  748. let obj = {
  749. id: id
  750. }
  751. uni.showLoading({
  752. title: '加载中',
  753. mask: true
  754. });
  755. getDetail(obj).then(res => {
  756. if (res.data.corpsFilesList.length) {
  757. res.data.corpsFilesList.forEach(item => {
  758. item.name = item.fileName
  759. })
  760. }
  761. if (res.data.businessLicense) {
  762. res.data.businessLicense = JSON.parse(res.data.businessLicense)
  763. }
  764. res.data.label = res.data.label ? res.data.label.split(",") : []
  765. res.data.brandName = res.data.brandName ? res.data.brandName.split(",") : []
  766. this.form = res.data
  767. })
  768. .finally(() => {
  769. uni.hideLoading()
  770. });
  771. },
  772. async approval(type) {
  773. if (!this.form.cname) {
  774. uni.showToast({
  775. title: '请输入店铺名称',
  776. icon: 'none'
  777. });
  778. return
  779. }
  780. if (this.form.corpsFilesList.filter(item => item.isDeleted == 0).length == 0) {
  781. uni.showToast({
  782. title: '请上传店面照片',
  783. icon: 'none'
  784. });
  785. return
  786. }
  787. if (!this.form.contacts) {
  788. uni.showToast({
  789. title: '请输入联系人',
  790. icon: 'none'
  791. });
  792. return
  793. }
  794. if (!this.form.contactsPhone) {
  795. uni.showToast({
  796. title: '请输入电话',
  797. icon: 'none'
  798. });
  799. return
  800. }
  801. if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.contactsPhone)) {
  802. uni.showToast({
  803. title: '请输入正确电话',
  804. icon: 'none'
  805. });
  806. return;
  807. }
  808. if (!this.form.salesmanName) {
  809. uni.showToast({
  810. title: '请选择业务员',
  811. icon: 'none'
  812. });
  813. return
  814. }
  815. if (!this.form.deliveryWarehouseName) {
  816. uni.showToast({
  817. title: '请选择发货仓库',
  818. icon: 'none'
  819. });
  820. return
  821. }
  822. if (!this.form.priceSystem) {
  823. uni.showToast({
  824. title: '请选择商城价格',
  825. icon: 'none'
  826. });
  827. return
  828. }
  829. if (!this.form.address) {
  830. uni.showToast({
  831. title: '请选择所属区域',
  832. icon: 'none'
  833. });
  834. return
  835. }
  836. if (!this.form.detailedAddress) {
  837. uni.showToast({
  838. title: '请输入详细地址',
  839. icon: 'none'
  840. });
  841. return
  842. }
  843. if (!this.form.corpsTypeId) {
  844. uni.showToast({
  845. title: '请选择店面分类',
  846. icon: 'none'
  847. });
  848. return
  849. }
  850. let obj = await this.convertData(this.$deepClone(this.form))
  851. console.log(obj)
  852. let _this = this
  853. uni.showModal({
  854. title: '提示',
  855. content: type == 1 ? '是否通过审核?' : '是否驳回审核?',
  856. success: function(res) {
  857. if (res.confirm) {
  858. obj.type = type
  859. uni.showLoading({
  860. title: '加载中',
  861. mask: true
  862. });
  863. submit(obj).then(res => {
  864. review(obj).then(res => {
  865. uni.showToast({
  866. title: '操作成功',
  867. icon: 'none',
  868. duration: 2000
  869. });
  870. _this.getDetail(res.data.id)
  871. })
  872. .catch(() => {
  873. uni.hideLoading()
  874. });
  875. }).catch(() => {
  876. uni.hideLoading()
  877. })
  878. }
  879. }
  880. });
  881. },
  882. async convertData(obj) {
  883. if (obj.corpsFilesList.length) {
  884. obj.corpsFilesList.filter(item => item.isDeleted == 0).forEach((item, index) => {
  885. if (index == 0) {
  886. item.mainImage = 1
  887. }
  888. item.fileName = item.name
  889. })
  890. }
  891. if (obj.businessLicense) {
  892. obj.businessLicense = JSON.stringify(obj.businessLicense)
  893. }
  894. obj.label = obj.label ? obj.label.join(",") : null
  895. obj.brandName = obj.brandName ? obj.brandName.join(",") : null
  896. if (obj.signingPeriodEnd) {
  897. obj.signingPeriodEnd = obj.signingPeriodEnd.slice(0, 10) + ' 00:00:00'
  898. }
  899. return obj
  900. }
  901. }
  902. }
  903. </script>
  904. <style lang="scss" scoped>
  905. .right-align {
  906. text-align: right;
  907. }
  908. .photo {
  909. margin-left: 20rpx;
  910. width: 38rpx;
  911. height: 32rpx;
  912. }
  913. ::v-deep .uni-section .uni-section-header {
  914. font-weight: bold !important;
  915. padding: 12px 0px !important;
  916. border-bottom: 2px solid #F6F6F6;
  917. }
  918. ::v-deep .uni-file-picker__container {
  919. justify-content: flex-end !important;
  920. }
  921. ::v-deep .uni-file-picker .file-picker__box-content {
  922. overflow: revert;
  923. z-index: 9;
  924. }
  925. ::v-deep .icon-del-box {
  926. height: 26rpx;
  927. width: 26rpx;
  928. top: -2rpx;
  929. right: -8rpx;
  930. z-index: 999;
  931. }
  932. ::v-deep .icon-del {
  933. width: 14rpx;
  934. height: 2rpx;
  935. }
  936. .slot-content-item {
  937. border-radius: 13rpx;
  938. border: 2rpx solid #03803B;
  939. padding: 1rpx 5rpx;
  940. color: #03803B;
  941. }
  942. .slot-content-item-placeholder {
  943. font-weight: 400 !important;
  944. font-size: 28rpx !important;
  945. height: 38rpx !important;
  946. color: #B5B4B4 !important;
  947. }
  948. .slot-box {
  949. gap: 5px;
  950. display: flex;
  951. flex-wrap: wrap;
  952. justify-content: flex-end;
  953. width: 100%;
  954. }
  955. .popup-content {
  956. background: #fff;
  957. padding: 40rpx 20rpx;
  958. border-radius: 24rpx 24rpx 0 0;
  959. }
  960. .popup-content-checkbox {
  961. height: 600rpx;
  962. }
  963. .confirm-btn {
  964. margin-top: 30rpx;
  965. color: #ffffff;
  966. background: #03803B;
  967. width: 400rpx;
  968. }
  969. ::v-deep .icon-add {
  970. width: 36px !important;
  971. }
  972. ::v-deep .uni-date-x .uni-icons {
  973. color: #03803B !important;
  974. }
  975. </style>