details.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995
  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">
  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="c" 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">
  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" 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. buttonGroup: [{
  293. text: '通过',
  294. backgroundColor: '#18bc37',
  295. color: '#fff'
  296. },
  297. {
  298. text: '驳回',
  299. backgroundColor: '#e64340',
  300. color: '#fff'
  301. }
  302. ],
  303. buttonGroup2: [{
  304. text: '保存',
  305. backgroundColor: '#03803B',
  306. color: '#fff'
  307. }],
  308. corpsTypeShow: false,
  309. storeAttributesShow: false,
  310. chainAttributeShow: false,
  311. signingLevelShow: false,
  312. salesmanShow: false,
  313. deliveryWarehouseShow: false,
  314. priceSystemShow: false,
  315. form: {
  316. corpsTypeId: null,
  317. corpsTypeName: null,
  318. storeAttributes: null,
  319. chainAttribute: null,
  320. signingLevel: null,
  321. dimension: null,
  322. longitude: null,
  323. address: null,
  324. detailedAddress: null,
  325. label: [],
  326. brandName: [],
  327. corpsFilesList: [],
  328. businessLicense: {}
  329. },
  330. imageStyles: {
  331. width: 46,
  332. height: 46
  333. },
  334. mapObject: {
  335. text: 'name',
  336. value: 'code',
  337. children: 'children'
  338. },
  339. labelObject: {
  340. text: 'label',
  341. value: 'label',
  342. },
  343. brandObject: {
  344. text: 'cname',
  345. value: 'cname',
  346. },
  347. addressData: [],
  348. labelList: [],
  349. corpsTypeList: [],
  350. storeAttributesList: [],
  351. chainAttributeList: [],
  352. signingLevelList: [],
  353. salesmanList: [],
  354. brandList: [],
  355. deliveryWarehouseList: [],
  356. priceSystemList: [],
  357. mapData: {},
  358. errData: {},
  359. }
  360. },
  361. onLoad(option) {
  362. uni.$on('commitCheck', (data) => {
  363. this.form.address = (data.province ? data.province : '') + (data.city ? "," + data.city :
  364. '') + (data.district ? "," + data.district : '')
  365. this.form.detailedAddress = data.name
  366. this.form.longitude = data.location ? data.location.split(',')[0] : null
  367. this.form.dimension = data.location ? data.location.split(',')[1] : null
  368. });
  369. this.getSelectType()
  370. this.getLabel()
  371. this.getSalerList()
  372. this.getStorageList()
  373. this.getDictionary()
  374. this.getBrandlist()
  375. if (option && option.id) {
  376. this.getDetail(option.id)
  377. }
  378. },
  379. onUnload() {
  380. uni.$off();
  381. },
  382. methods: {
  383. buttonClick(e) {
  384. if (e.index == 0) {
  385. this.approval(1)
  386. }
  387. if (e.index == 1) {
  388. this.approval(2)
  389. }
  390. },
  391. buttonClick2(e) {
  392. if (e.index == 0) {
  393. this.submit()
  394. }
  395. },
  396. openMap() {
  397. if (this.form.enableOrNot != 1) {
  398. if (this.form.longitude && this.form.dimension) {
  399. uni.navigateTo({
  400. url: `/pages/home/store/map/index?longitude=${this.form.longitude}&latitude=${this.form.dimension}`
  401. });
  402. } else {
  403. uni.navigateTo({
  404. url: `/pages/home/store/map/index`
  405. });
  406. }
  407. }
  408. },
  409. photoChange(val) {
  410. if (val) {
  411. if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(val)) {
  412. uni.showToast({
  413. title: '请输入正确电话',
  414. icon: 'none'
  415. });
  416. return;
  417. }
  418. }
  419. },
  420. intBlur(name, value) {
  421. if (!this.form[name]) return
  422. // 使用toFixed处理小数位
  423. try {
  424. const num = parseFloat(this.form[name])
  425. if (!isNaN(num)) {
  426. this.form[name] = Math.floor(num).toFixed(0)
  427. }
  428. } catch (e) {
  429. console.error('格式化错误', e)
  430. }
  431. },
  432. openPopup() {
  433. if (this.form.enableOrNot != 1) {
  434. this.getLabel()
  435. this.$refs.popup.open()
  436. }
  437. },
  438. brandPopup() {
  439. if (this.form.enableOrNot != 1) {
  440. this.getBrandlist()
  441. this.$refs.brand.open()
  442. }
  443. },
  444. onChange(e) {
  445. console.log('当前选中:', e.detail.value)
  446. },
  447. brandChange(e) {
  448. console.log('当前选中:', e.detail)
  449. let ids = []
  450. e.detail.data.forEach(item => {
  451. ids.push(item.id)
  452. })
  453. this.form.brandId = ids.join(',')
  454. },
  455. labelConfirm() {
  456. this.$refs.popup.close()
  457. // 提交选中值逻辑...
  458. },
  459. brandConfirm() {
  460. this.$refs.brand.close()
  461. // 提交选中值逻辑...
  462. },
  463. clear(name) {
  464. if (name == 'corpsTypeName') {
  465. this.form.corpsTypeId = null
  466. this.form.corpsTypeName = null
  467. }
  468. if (name == 'salesmanName') {
  469. this.form.salesmanId = null
  470. this.form.salesmanName = null
  471. }
  472. if (name == 'deliveryWarehouseName') {
  473. this.form.deliveryWarehouseId = null
  474. this.form.deliveryWarehouseName = null
  475. }
  476. },
  477. salesmanConfirm(row) {
  478. this.form.salesmanId = row.value[0].id
  479. this.form.salesmanName = row.value[0].name
  480. this.salesmanShow = false
  481. },
  482. deliveryWarehouseConfirm(row) {
  483. this.form.deliveryWarehouseId = row.value[0].id
  484. this.form.deliveryWarehouseName = row.value[0].cname
  485. this.deliveryWarehouseShow = false
  486. },
  487. priceSystemConfirm(row) {
  488. this.form.priceSystem = row.value[0].dictValue
  489. this.priceSystemShow = false
  490. },
  491. corpsTypeConfirm(row) {
  492. this.form.corpsTypeId = row.value[0].id
  493. this.form.corpsTypeName = row.value[0].cname
  494. this.corpsTypeShow = false
  495. },
  496. storeAttributesConfirm(row) {
  497. this.form.storeAttributes = row.value[0].dictValue
  498. this.storeAttributesShow = false
  499. },
  500. chainAttributeConfirm(row) {
  501. this.form.chainAttribute = row.value[0].dictValue
  502. this.chainAttributeShow = false
  503. },
  504. signingLevelConfirm(row) {
  505. this.form.signingLevel = row.value[0].dictValue
  506. this.signingLevelShow = false
  507. },
  508. getDictionary() {
  509. this.$u.api.dictionary('storeAttributes').then(res => {
  510. this.storeAttributesList = [res.data]
  511. })
  512. this.$u.api.dictionary('chainAttribute').then(res => {
  513. this.chainAttributeList = [res.data]
  514. })
  515. this.$u.api.dictionary('signingLevel').then(res => {
  516. this.signingLevelList = [res.data]
  517. })
  518. this.$u.api.dictionary('mall_price').then(res => {
  519. this.priceSystemList = [res.data]
  520. })
  521. },
  522. sliceArray(ls) {
  523. if (Array.isArray(ls)) {
  524. return ls.slice(0, 2)
  525. }
  526. return ls
  527. },
  528. getSelectType() {
  529. selectType().then(res => {
  530. this.corpsTypeList = [res.data]
  531. })
  532. },
  533. getLabel() {
  534. selectLabel().then(res => {
  535. this.labelList = res.data
  536. })
  537. },
  538. getSalerList() {
  539. salerList().then(res => {
  540. this.salesmanList = [res.data]
  541. })
  542. },
  543. getStorageList() {
  544. storageList().then(res => {
  545. this.deliveryWarehouseList = [res.data]
  546. })
  547. },
  548. getBrandlist() {
  549. brandDesc().then(res => {
  550. this.brandList = res.data
  551. })
  552. },
  553. getFileExtension(filename) {
  554. return filename.slice(((filename.lastIndexOf(".") - 1) >>> 0) + 2);
  555. },
  556. businessLicenseSelect(files) {
  557. files.tempFiles.forEach(file => {
  558. uni.showLoading({
  559. title: '加载中',
  560. mask: true
  561. });
  562. uni.uploadFile({
  563. url: http.config.baseURL +
  564. '/blade-resource/oss/endpoint/put-file', // 仅为示例,非真实的接口地址
  565. filePath: file.path,
  566. header: {
  567. // 客户端认证参数
  568. 'Authorization': 'Basic ' + Base64.encode(clientId + ':' + clientSecret),
  569. 'Blade-Auth': 'bearer ' + uni.getStorageSync('accessToken')
  570. },
  571. name: 'file',
  572. success: (res) => {
  573. const data = JSON.parse(res.data).data
  574. this.form.businessLicense = {
  575. url: data.link,
  576. name: data.originalName,
  577. extname: this.getFileExtension(data.originalName)
  578. }
  579. this.form.businessLicenseUrl = data.link
  580. uni.showToast({
  581. title: '上传成功',
  582. icon: 'none'
  583. });
  584. },
  585. fail: (err) => {
  586. uni.showToast({
  587. title: '上传失败',
  588. icon: 'none'
  589. });
  590. },
  591. complete: () => {
  592. uni.hideLoading()
  593. }
  594. })
  595. })
  596. },
  597. fileDelete(row) {
  598. uni.showToast({
  599. title: '删除成功',
  600. icon: 'none'
  601. });
  602. this.form.corpsFilesList.filter(item => item.isDeleted == 0)[row.index].isDeleted = 1
  603. },
  604. corpsfileSelect(files) {
  605. uni.showLoading({
  606. title: '加载中',
  607. mask: true
  608. });
  609. files.tempFiles.forEach(file => {
  610. uni.uploadFile({
  611. url: http.config.baseURL +
  612. '/blade-resource/oss/endpoint/put-file', // 仅为示例,非真实的接口地址
  613. filePath: file.path,
  614. header: {
  615. // 客户端认证参数
  616. 'Authorization': 'Basic ' + Base64.encode(clientId + ':' + clientSecret),
  617. 'Blade-Auth': 'bearer ' + uni.getStorageSync('accessToken')
  618. },
  619. name: 'file',
  620. success: (res) => {
  621. const data = JSON.parse(res.data).data
  622. this.form.corpsFilesList.push({
  623. url: data.link,
  624. name: data.originalName,
  625. extname: this.getFileExtension(data.originalName),
  626. isDeleted: 0
  627. })
  628. uni.showToast({
  629. title: '上传成功',
  630. icon: 'none'
  631. });
  632. },
  633. fail: (err) => {
  634. uni.showToast({
  635. title: '上传失败',
  636. icon: 'none'
  637. });
  638. },
  639. complete: () => {
  640. uni.hideLoading()
  641. }
  642. })
  643. })
  644. },
  645. async submit() {
  646. if (!this.form.cname) {
  647. uni.showToast({
  648. title: '请输入店铺名称',
  649. icon: 'none'
  650. });
  651. return
  652. }
  653. if (this.form.corpsFilesList.filter(item => item.isDeleted == 0).length == 0) {
  654. uni.showToast({
  655. title: '请上传店面照片',
  656. icon: 'none'
  657. });
  658. return
  659. }
  660. if (!this.form.contacts) {
  661. uni.showToast({
  662. title: '请输入联系人',
  663. icon: 'none'
  664. });
  665. return
  666. }
  667. if (!this.form.contactsPhone) {
  668. uni.showToast({
  669. title: '请输入电话',
  670. icon: 'none'
  671. });
  672. return
  673. }
  674. if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.contactsPhone)) {
  675. uni.showToast({
  676. title: '请输入正确电话',
  677. icon: 'none'
  678. });
  679. return;
  680. }
  681. if (!this.form.salesmanName) {
  682. uni.showToast({
  683. title: '请选择业务员',
  684. icon: 'none'
  685. });
  686. return
  687. }
  688. if (!this.form.deliveryWarehouseName) {
  689. uni.showToast({
  690. title: '请选择发货仓库',
  691. icon: 'none'
  692. });
  693. return
  694. }
  695. if (!this.form.priceSystem) {
  696. uni.showToast({
  697. title: '请选择商城价格',
  698. icon: 'none'
  699. });
  700. return
  701. }
  702. if (!this.form.address) {
  703. uni.showToast({
  704. title: '请选择所属区域',
  705. icon: 'none'
  706. });
  707. return
  708. }
  709. if (!this.form.detailedAddress) {
  710. uni.showToast({
  711. title: '请输入详细地址',
  712. icon: 'none'
  713. });
  714. return
  715. }
  716. if (!this.form.corpsTypeId) {
  717. uni.showToast({
  718. title: '请选择店面分类',
  719. icon: 'none'
  720. });
  721. return
  722. }
  723. let obj = await this.convertData(this.$deepClone(this.form))
  724. uni.showLoading({
  725. title: '加载中',
  726. mask: true
  727. });
  728. submit(obj).then(res => {
  729. setTimeout(() => {
  730. uni.showToast({
  731. title: '保存成功',
  732. icon: 'none',
  733. });
  734. }, 10);
  735. uni.setStorageSync('isUpdate', true)
  736. this.getDetail(res.data.id)
  737. })
  738. .catch(() => {
  739. uni.hideLoading()
  740. });
  741. },
  742. getDetail(id) {
  743. let obj = {
  744. id: id
  745. }
  746. uni.showLoading({
  747. title: '加载中',
  748. mask: true
  749. });
  750. getDetail(obj).then(res => {
  751. if (res.data.corpsFilesList.length) {
  752. res.data.corpsFilesList.forEach(item => {
  753. item.name = item.fileName
  754. })
  755. }
  756. if (res.data.businessLicense) {
  757. res.data.businessLicense = JSON.parse(res.data.businessLicense)
  758. }
  759. res.data.label = res.data.label ? res.data.label.split(",") : []
  760. res.data.brandName = res.data.brandName ? res.data.brandName.split(",") : []
  761. this.form = res.data
  762. })
  763. .finally(() => {
  764. uni.hideLoading()
  765. });
  766. },
  767. async approval(type) {
  768. if (!this.form.cname) {
  769. uni.showToast({
  770. title: '请输入店铺名称',
  771. icon: 'none'
  772. });
  773. return
  774. }
  775. if (this.form.corpsFilesList.filter(item => item.isDeleted == 0).length == 0) {
  776. uni.showToast({
  777. title: '请上传店面照片',
  778. icon: 'none'
  779. });
  780. return
  781. }
  782. if (!this.form.contacts) {
  783. uni.showToast({
  784. title: '请输入联系人',
  785. icon: 'none'
  786. });
  787. return
  788. }
  789. if (!this.form.contactsPhone) {
  790. uni.showToast({
  791. title: '请输入电话',
  792. icon: 'none'
  793. });
  794. return
  795. }
  796. if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(this.form.contactsPhone)) {
  797. uni.showToast({
  798. title: '请输入正确电话',
  799. icon: 'none'
  800. });
  801. return;
  802. }
  803. if (!this.form.salesmanName) {
  804. uni.showToast({
  805. title: '请选择业务员',
  806. icon: 'none'
  807. });
  808. return
  809. }
  810. if (!this.form.deliveryWarehouseName) {
  811. uni.showToast({
  812. title: '请选择发货仓库',
  813. icon: 'none'
  814. });
  815. return
  816. }
  817. if (!this.form.priceSystem) {
  818. uni.showToast({
  819. title: '请选择商城价格',
  820. icon: 'none'
  821. });
  822. return
  823. }
  824. if (!this.form.address) {
  825. uni.showToast({
  826. title: '请选择所属区域',
  827. icon: 'none'
  828. });
  829. return
  830. }
  831. if (!this.form.detailedAddress) {
  832. uni.showToast({
  833. title: '请输入详细地址',
  834. icon: 'none'
  835. });
  836. return
  837. }
  838. if (!this.form.corpsTypeId) {
  839. uni.showToast({
  840. title: '请选择店面分类',
  841. icon: 'none'
  842. });
  843. return
  844. }
  845. let obj = await this.convertData(this.$deepClone(this.form))
  846. console.log(obj)
  847. let _this = this
  848. uni.showModal({
  849. title: '提示',
  850. content: type == 1 ? '是否通过审核?' : '是否驳回审核?',
  851. success: function(res) {
  852. if (res.confirm) {
  853. obj.type = type
  854. uni.showLoading({
  855. title: '加载中',
  856. mask: true
  857. });
  858. submit(obj).then(res => {
  859. review(obj).then(res => {
  860. uni.showToast({
  861. title: '操作成功',
  862. icon: 'none',
  863. duration: 2000
  864. });
  865. _this.getDetail(res.data.id)
  866. })
  867. .catch(() => {
  868. uni.hideLoading()
  869. });
  870. }).catch(() => {
  871. uni.hideLoading()
  872. })
  873. }
  874. }
  875. });
  876. },
  877. async convertData(obj) {
  878. if (obj.corpsFilesList.length) {
  879. obj.corpsFilesList.filter(item => item.isDeleted == 0).forEach((item, index) => {
  880. if (index == 0) {
  881. item.mainImage = 1
  882. }
  883. item.fileName = item.name
  884. })
  885. }
  886. if (obj.businessLicense) {
  887. obj.businessLicense = JSON.stringify(obj.businessLicense)
  888. }
  889. obj.label = obj.label ? obj.label.join(",") : null
  890. obj.brandName = obj.brandName ? obj.brandName.join(",") : null
  891. if (obj.signingPeriodEnd) {
  892. obj.signingPeriodEnd = obj.signingPeriodEnd.slice(0, 10) + ' 00:00:00'
  893. }
  894. return obj
  895. }
  896. }
  897. }
  898. </script>
  899. <style lang="scss" scoped>
  900. .right-align {
  901. text-align: right;
  902. }
  903. .photo {
  904. margin-left: 20rpx;
  905. width: 38rpx;
  906. height: 32rpx;
  907. }
  908. ::v-deep .uni-section .uni-section-header {
  909. font-weight: bold !important;
  910. padding: 12px 0px !important;
  911. border-bottom: 2px solid #F6F6F6;
  912. }
  913. ::v-deep .uni-file-picker__container {
  914. justify-content: flex-end !important;
  915. }
  916. ::v-deep .uni-file-picker .file-picker__box-content {
  917. overflow: revert;
  918. z-index: 9;
  919. }
  920. ::v-deep .icon-del-box {
  921. height: 26rpx;
  922. width: 26rpx;
  923. top: -2rpx;
  924. right: -8rpx;
  925. z-index: 999;
  926. }
  927. ::v-deep .icon-del {
  928. width: 14rpx;
  929. height: 2rpx;
  930. }
  931. .slot-content-item {
  932. border-radius: 13rpx;
  933. border: 2rpx solid #03803B;
  934. padding: 1rpx 5rpx;
  935. color: #03803B;
  936. }
  937. .slot-content-item-placeholder {
  938. font-weight: 400 !important;
  939. font-size: 28rpx !important;
  940. height: 38rpx !important;
  941. color: #B5B4B4 !important;
  942. }
  943. .slot-box {
  944. gap: 5px;
  945. display: flex;
  946. flex-wrap: wrap;
  947. justify-content: flex-end;
  948. width: 100%;
  949. }
  950. .popup-content {
  951. background: #fff;
  952. padding: 40rpx 20rpx;
  953. border-radius: 24rpx 24rpx 0 0;
  954. }
  955. .popup-content-checkbox {
  956. height: 600rpx;
  957. }
  958. .confirm-btn {
  959. margin-top: 30rpx;
  960. color: #ffffff;
  961. background: #03803B;
  962. width: 400rpx;
  963. }
  964. ::v-deep .icon-add {
  965. width: 36px !important;
  966. }
  967. ::v-deep .uni-date-x .uni-icons {
  968. color: #03803B !important;
  969. }
  970. </style>