newStoreApprovalDetail.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975
  1. <template>
  2. <div class="newStoreApprovalDetail">
  3. <div class="navBarTOP">
  4. <!-- 顶部条 -->
  5. <van-nav-bar class="navBar" title="门店详情" left-arrow @click-left="onClickLeft" />
  6. </div>
  7. <!--主体内容-->
  8. <div style="margin-top: 44px; padding-bottom: 50px" v-if="list.storeId">
  9. <!-- <van-dialog title="门店位置">
  10. <mapmarker :info="list"></mapmarker>
  11. </van-dialog> -->
  12. <van-tabs class="myTab" v-model="tabVal" color="#0057ba" @change="tabChange">
  13. <van-tab title="基础信息" name="insidePlan" ref="dispsps">
  14. <!-- 提交审批后被驳回 -->
  15. <div class="rejectMsg" v-if="rejectMsg[0]">
  16. <span class="label">退回原因</span>
  17. <span class="value">{{ rejectMsg[0].approvalDesc }}</span>
  18. <span class="examineDetail" @click="examineDetail">查看详情</span>
  19. </div>
  20. <van-field readonly v-model="list.storeCode" label="编号" />
  21. <van-field readonly v-if="DIYshow" v-model="list.attribute1" label="DIY编号" />
  22. <van-field readonly v-model="list.storeName" :label="storeName" />
  23. <van-field readonly v-model="list.storeCategoryName" label="类型" />
  24. <van-field
  25. readonly
  26. rows="1"
  27. autosize
  28. type="textarea"
  29. v-model="list.addressLine"
  30. :label="address" />
  31. <van-field v-model="list.lat" readonly label="经度" placeholder="经度" />
  32. <van-field readonly v-model="list.lon" label="维度" />
  33. <van-field readonly v-model="list.orgName" label="销售部" />
  34. <van-field readonly v-model="list.provinceName" label="省(州)"> </van-field>
  35. <van-field readonly v-model="list.cityName" label="城市"> </van-field>
  36. <van-field readonly v-model="list.districtName" label="区(县)"> </van-field>
  37. <van-field readonly v-model="list.townName" label="街道"> </van-field>
  38. <van-field readonly v-model="list.cityLevel" label="城市等级" />
  39. <van-field
  40. readonly
  41. v-if="list.ifJzStoreType != 1 && list.storeCategory != 'C917'"
  42. v-model="list.contactName"
  43. label="联系人" />
  44. <van-field
  45. readonly
  46. v-if="list.ifJzStoreType == 1 && list.storeCategory != 'C917'"
  47. v-model="list.contactName"
  48. label="老板" />
  49. <van-field
  50. readonly
  51. v-model="list.telephone"
  52. label="联系电话"
  53. v-if="list.storeCategory != 'C917'" />
  54. <template v-if="list.storeCategory != 'C917'">
  55. <!-- 分销店 -->
  56. <template
  57. v-if="
  58. verifyStoreType(list.storeCategory) &&
  59. verifyStoreType(list.storeCategory).type == 'fxd'
  60. ">
  61. <van-field label="经销商" readonly class="TCFXList">
  62. <template #input>
  63. <template v-if="list.sfaStoreChainsContactList">
  64. <div
  65. class="sfaStoreChainsContactList"
  66. v-for="(item, index) in list.sfaStoreChainsContactList"
  67. :key="index">
  68. {{ item.categoryDescribe }}
  69. {{ item.chainCode }}
  70. {{ item.chainName }}
  71. </div>
  72. </template>
  73. </template>
  74. </van-field>
  75. </template>
  76. <template v-else>
  77. <van-field
  78. readonly
  79. v-model="list.chainCode"
  80. label="经销商编号"
  81. v-if="list.storeCategory != 'C917'" />
  82. <van-field
  83. readonly
  84. v-model="list.chainName"
  85. label="经销商名称"
  86. v-if="list.storeCategory != 'C917'" />
  87. </template>
  88. </template>
  89. <van-field readonly v-model="list.salesmanName" label="销售员" />
  90. <div v-if="list.storeCategory != 'C917'">
  91. <van-field
  92. readonly
  93. v-model="list.area"
  94. v-if="list.ifJzStoreType != 1"
  95. label="面积(m²)" />
  96. <van-field
  97. readonly
  98. v-model="list.area"
  99. v-if="list.ifJzStoreType == 1"
  100. label="家装展厅面积(m²)" />
  101. </div>
  102. <van-field
  103. readonly
  104. v-if="GZAttributeFormShow"
  105. label="潜在客户类型"
  106. v-model="list.potentialCustomerType" />
  107. <van-field readonly v-if="list.carShop" label="是否车铺开店">
  108. <template #input>
  109. <span v-if="list.carShop == 1">是</span>
  110. <span v-if="list.carShop == 0">否</span>
  111. </template>
  112. </van-field>
  113. <div v-if="list.carShopImgList != null && list.carShop == 1">
  114. <p style="padding: 0 16px">车铺照片(店招及车铺产品拍在一张照片里)</p>
  115. <viewUploadImg :imgs="list.carShopImgList"></viewUploadImg>
  116. </div>
  117. <template v-if="list.img != null && list.storeCategory != 'C917'">
  118. <div class="displayImg" style="padding: 16px">
  119. <div class="displayImgBox">
  120. <div v-if="storeTypePOP">
  121. <van-image
  122. width="100%"
  123. height="160"
  124. :src="setImgSrc(list.img)"
  125. @click="deleteImgs(list.img)" />
  126. <p style="text-align: center">
  127. {{ list.ifJzStoreType != 1 ? '建店时门店照' : '家装前台照片' }}
  128. </p>
  129. </div>
  130. <div v-else>
  131. <van-image
  132. width="100%"
  133. height="160"
  134. :src="setImgSrc(list.img)"
  135. @click="deleteImgs(list.img)" />
  136. <p style="text-align: center">
  137. {{ list.storeCategory == 'C912' ? '工地铭牌照片' : '公司照片' }}
  138. </p>
  139. </div>
  140. </div>
  141. <template v-if="list.ifJzStoreType != 1"></template>
  142. <template v-else>
  143. <div class="displayImgBox">
  144. <div v-if="storeTypePOP">
  145. <van-image
  146. width="100%"
  147. height="160"
  148. :src="setImgSrc(list.imgSed)"
  149. @click="deleteImgs(list.imgSed)" />
  150. <p style="text-align: center">
  151. {{ '立邦展厅照片' }}
  152. </p>
  153. </div>
  154. </div>
  155. </template>
  156. <template v-if="list.ifJzStoreType != 1 && storeTypePOP && displayImg.length">
  157. <div class="displayImgBox" v-for="(urls, index) in displayImg" :key="index">
  158. <div>
  159. <van-image width="100%" height="160" :src="urls" @click="previewsImg(index)" />
  160. <p style="text-align: center">建店时陈列照</p>
  161. </div>
  162. </div>
  163. </template>
  164. </div>
  165. </template>
  166. <van-row gutter="20" style="padding: 16px">
  167. <van-col span="12" v-if="list.standardStorePhoto">
  168. <div v-if="storeTypePOP">
  169. <van-image
  170. width="100%"
  171. height="160"
  172. :src="setImgSrc(list.standardStorePhoto)"
  173. @click="deleteImgs(list.standardStorePhoto)" />
  174. <p style="text-align: center">标准店招(最新)</p>
  175. </div>
  176. </van-col>
  177. </van-row>
  178. <van-row gutter="20" style="padding: 16px">
  179. <van-col span="12" v-if="list.newStoreSignPhoto">
  180. <div v-if="storeTypePOP">
  181. <van-image
  182. width="100%"
  183. height="160"
  184. :src="setImgSrc(list.newStoreSignPhoto)"
  185. @click="deleteImgs(list.newStoreSignPhoto)" />
  186. <p style="text-align: center">最近一次拜访店招</p>
  187. </div>
  188. </van-col>
  189. </van-row>
  190. <van-collapse v-model="activeNames" class="orderList">
  191. <van-collapse-item title="门店下单记录" name="1">
  192. <div class="orderItem" v-for="(item, index) in orderList" :key="index">
  193. <div class="orderTitle">
  194. {{ item.ORDERID }} | {{ item.ORDERDATE }} | {{ item.STATUS_DESCR }}
  195. </div>
  196. <el-table
  197. :data="item.productDetail"
  198. border
  199. class="table-headermd table-headermdhome"
  200. show-summary
  201. :summary-method="getSummaries"
  202. style="width: 100%">
  203. <el-table-column label="产品名称" prop="DESCR" />
  204. <el-table-column label="数量" prop="QTY" width="80px" />
  205. <el-table-column label="金额" prop="productTotalPrice" width="80px">
  206. <!-- <template slot-scope="scope">
  207. {{ scope.row.UNITPRICE * scope.row.QTY }}
  208. </template> -->
  209. </el-table-column>
  210. </el-table>
  211. </div>
  212. </van-collapse-item>
  213. </van-collapse>
  214. <div
  215. style="font-size: 16px; font-weight: 600; padding: 10px 16px 0 16px; line-height: 25px">
  216. 同城分销店首批铺货要求
  217. <span style="color: red">1000元</span>
  218. ,该店已达
  219. <span style="color: red">{{ orderPrice }}元</span>,
  220. <span style="background: #07c160; padding: 3px">满足要求</span>
  221. </div>
  222. </van-tab>
  223. <van-tab title="属性信息" name="outsidePlan">
  224. <template v-for="(item, index) in TCFXList" v-if="dictTypeFormShow">
  225. <van-field
  226. readonly
  227. label="属性"
  228. v-if="item.dictValue == list.tcfxName"
  229. v-model="item.text" />
  230. </template>
  231. </van-tab>
  232. </van-tabs>
  233. <br />
  234. <br />
  235. <br />
  236. <br />
  237. <br />
  238. <br />
  239. <!-- 未结案 未提交状态下可关闭门店、提交审核 -->
  240. <div class="bottomBtn" v-if="list.approvalStatus == 0 && list.processApprovalStatus == 1">
  241. <van-button color="red" round @click="rejectReasonShow = true">退回</van-button>
  242. <van-button type="primary" round @click="approvalStoreFun('success')">通过</van-button>
  243. </div>
  244. </div>
  245. <!-- 退回原因填写 -->
  246. <van-popup v-model="rejectReasonShow" class="rejectMsgBox" closeable round position="bottom">
  247. <div class="title">退回原因</div>
  248. <div class="content">
  249. <van-field
  250. v-model="rejectMessage"
  251. rows="2"
  252. autosize
  253. type="textarea"
  254. maxlength="300"
  255. placeholder="请输入退回原因" />
  256. </div>
  257. <div class="btnBox">
  258. <van-button type="primary" round @click="rejectReasonSubmit">提交</van-button>
  259. </div>
  260. </van-popup>
  261. <!-- 提交审核后退回原因 只有同城分销店显示 -->
  262. <van-popup v-model="rejectMsgShow" class="rejectMsgBox" closeable round position="bottom">
  263. <div class="title">退回详情</div>
  264. <div class="content">
  265. <div class="rejectMsgItem" v-for="(item, index) in rejectMsg" :key="index">
  266. <div class="item approver">
  267. <span class="label">审批人:</span>
  268. <span class="value">{{ item.approvalUserName }}</span>
  269. </div>
  270. <div class="item approvalTime">
  271. <span class="label">审批时间:</span>
  272. <span class="value">{{ item.approvalTime }}</span>
  273. </div>
  274. <div class="item rejectCause">
  275. <span class="label">退回原因:</span>
  276. <span class="value">{{ item.approvalDesc }}</span>
  277. </div>
  278. </div>
  279. </div>
  280. </van-popup>
  281. </div>
  282. </template>
  283. <script>
  284. import { ImagePreview } from 'vant';
  285. import {
  286. getById,
  287. getStoreTypeList,
  288. getStoreyslTypeList,
  289. getTCFXList,
  290. getSJSList,
  291. getQGJZist,
  292. getCustomerInfoList,
  293. getCustomerNatureList,
  294. getMainProjectList,
  295. getMainRelationList,
  296. getManagementModelList,
  297. getpotentialCustomerTypeList,
  298. getOrderByStoreCode,
  299. approvalStore,
  300. storeApprovaHistory,
  301. } from '@/api/index';
  302. import mapmarker from '@/components/mapMarker';
  303. import viewUploadImg from '@/components/viewUploadImg';
  304. import txmapimg1 from '@/assets/txmap1.svg';
  305. import txmapimg2 from '@/assets/txmap2.svg';
  306. import txmapimg3 from '@/assets/marker_blue.png';
  307. import uploadImg from '@/components/viewaddreddUploadImg.vue';
  308. export default {
  309. components: { uploadImg, mapmarker, viewUploadImg },
  310. data() {
  311. return {
  312. tabVal: 'insidePlan',
  313. list: {},
  314. txmapimg1: txmapimg1,
  315. txmapimg2: txmapimg2,
  316. txmapimg3: txmapimg3,
  317. storeId: '',
  318. vaue: '',
  319. show: false,
  320. storeTypeList: [],
  321. ManagementModelList: [],
  322. MainRelationList: [],
  323. MainProjectList: [],
  324. CustomerNatureList: [],
  325. CustomerInfoList: [],
  326. potentialCustomerTypeList: [],
  327. dictTypeFormShow: false,
  328. DIYshow: false,
  329. visitListList: [],
  330. TCFXList: [],
  331. QGJZist: [],
  332. SJSList: [],
  333. storeName: '名称',
  334. address: '地址',
  335. storeTypePOP: false,
  336. GZAttributeFormShow: false,
  337. pageShow: false,
  338. rejectMsgShow: false,
  339. //退回原因详情列表
  340. rejectMsg: [],
  341. activeNames: [],
  342. orderList: [],
  343. rejectReasonShow: false, //退回提交原因
  344. rejectMessage: '',
  345. displayImg: [],
  346. orderPrice: 0, //订单总金额
  347. };
  348. },
  349. activated() {
  350. this.getCustomerInfoList();
  351. this.getManagementModelList();
  352. this.getMainRelationList();
  353. this.getMainProjectList();
  354. this.getCustomerNatureList();
  355. this.getTCFXList();
  356. this.getSJSList();
  357. this.getQGJZist();
  358. this.getStoreType();
  359. this.getpotentialCustomerTypeList();
  360. this.visitListList = [];
  361. window.scrollTo(0, 0);
  362. this.storeApprovaHistoryFun();
  363. },
  364. methods: {
  365. storeApprovaHistoryFun() {
  366. storeApprovaHistory({ storeId: this.$route.query.id }).then((res) => {
  367. this.rejectMsg = res.data || [];
  368. });
  369. },
  370. getCustomerInfoList() {
  371. getCustomerInfoList().then((res) => {
  372. var CustomerInfoList = [];
  373. for (var t = 0; t < res.data.length; t++) {
  374. CustomerInfoList.push({
  375. text: res.data[t].dictLabel,
  376. dictCode: res.data[t].dictValue,
  377. });
  378. }
  379. this.CustomerInfoList = CustomerInfoList;
  380. });
  381. },
  382. getCustomerNatureList() {
  383. getCustomerNatureList().then((res) => {
  384. var CustomerNatureList = [];
  385. for (var t = 0; t < res.data.length; t++) {
  386. CustomerNatureList.push({
  387. text: res.data[t].dictLabel,
  388. dictCode: res.data[t].dictValue,
  389. });
  390. }
  391. this.CustomerNatureList = CustomerNatureList;
  392. });
  393. },
  394. getpotentialCustomerTypeList() {
  395. getpotentialCustomerTypeList().then((res) => {
  396. var potentialCustomerTypeList = [];
  397. for (var t = 0; t < res.data.length; t++) {
  398. potentialCustomerTypeList.push({
  399. text: res.data[t].dictLabel,
  400. dictCode: res.data[t].dictValue,
  401. });
  402. }
  403. this.potentialCustomerTypeList = potentialCustomerTypeList;
  404. });
  405. },
  406. getMainProjectList() {
  407. getMainProjectList().then((res) => {
  408. var MainProjectList = [];
  409. for (var t = 0; t < res.data.length; t++) {
  410. MainProjectList.push({
  411. text: res.data[t].dictLabel,
  412. dictCode: res.data[t].dictValue,
  413. });
  414. }
  415. this.MainProjectList = MainProjectList;
  416. });
  417. },
  418. getMainRelationList() {
  419. getMainRelationList().then((res) => {
  420. var MainRelationList = [];
  421. for (var t = 0; t < res.data.length; t++) {
  422. MainRelationList.push({
  423. text: res.data[t].dictLabel,
  424. dictCode: res.data[t].dictValue,
  425. });
  426. }
  427. this.MainRelationList = MainRelationList;
  428. });
  429. },
  430. getManagementModelList() {
  431. getManagementModelList().then((res) => {
  432. var ManagementModelList = [];
  433. for (var t = 0; t < res.data.length; t++) {
  434. ManagementModelList.push({
  435. text: res.data[t].dictLabel,
  436. dictCode: res.data[t].dictValue,
  437. });
  438. }
  439. this.ManagementModelList = ManagementModelList;
  440. });
  441. },
  442. getSJSList() {
  443. getSJSList({}).then((res) => {
  444. var SJSList = [];
  445. for (var t = 0; t < res.data.length; t++) {
  446. SJSList.push({
  447. text: res.data[t].dictLabel,
  448. dictCode: res.data[t].dictValue,
  449. });
  450. }
  451. this.SJSList = SJSList;
  452. });
  453. },
  454. getQGJZist() {
  455. getQGJZist({}).then((res) => {
  456. var QGJZist = [];
  457. for (var t = 0; t < res.data.length; t++) {
  458. QGJZist.push({
  459. text: res.data[t].dictLabel,
  460. dictCode: res.data[t].dictValue,
  461. });
  462. }
  463. this.QGJZist = QGJZist;
  464. });
  465. },
  466. getTCFXList() {
  467. getTCFXList({}).then((res) => {
  468. var TCFXList = [];
  469. for (var t = 0; t < res.data.length; t++) {
  470. TCFXList.push({
  471. text: res.data[t].dictLabel,
  472. dictCode: res.data[t].dictCode,
  473. dictValue: res.data[t].dictValue,
  474. remark: res.data[t].remark,
  475. });
  476. }
  477. this.TCFXList = TCFXList;
  478. });
  479. },
  480. visitsFn(row) {
  481. this.$router.push({
  482. path: '/historicalDetails',
  483. query: {
  484. visitId: row.id,
  485. storeCode: row.storeCode,
  486. storeId: row.storeId,
  487. },
  488. });
  489. },
  490. setImgSrc(imgUrl) {
  491. let imgArr = imgUrl.split(',');
  492. return imgArr[0];
  493. },
  494. deleteImgs(val) {
  495. ImagePreview(val.split(','));
  496. },
  497. getStoreType() {
  498. if (localStorage.getItem('storeType') == '2') {
  499. this.DIYshow = true;
  500. getStoreyslTypeList({}).then((res) => {
  501. this.storeTypeList = res.data;
  502. this.getDetail();
  503. });
  504. } else {
  505. this.DIYshow = false;
  506. getStoreTypeList({}).then((res) => {
  507. this.storeTypeList = res.data;
  508. this.getDetail();
  509. });
  510. }
  511. },
  512. getDetail() {
  513. this.pageShow = false;
  514. let loading1 = this.$toast.loading({
  515. duration: 0,
  516. message: '加载中...',
  517. forbidClick: true,
  518. });
  519. getById({ storeId: this.$route.query.id }).then((res) => {
  520. loading1.clear();
  521. this.pageShow = true;
  522. localStorage.setItem('locationRemark', res.data.addressLine);
  523. localStorage.setItem('orgName', res.data.orgName);
  524. localStorage.setItem('chainName', res.data.storeName);
  525. if (res.code == 200) {
  526. this.list = res.data;
  527. if (this.list.imgSed && this.list.imgSed != '') {
  528. this.displayImg = this.list.imgSed.split(',');
  529. } else {
  530. this.displayImg = [];
  531. }
  532. if (this.list.carShopImgList != null) {
  533. } else {
  534. this.list.carShopImgList = [];
  535. }
  536. if (this.list.storeCategory == 'C917') {
  537. this.GZAttributeFormShow = true;
  538. this.dictTypeSJSFormShow = false;
  539. this.dictTypeQGJZFormShow = false;
  540. this.dictTypeFormShow = false;
  541. this.dictTypeAFormShow = false;
  542. for (let k = 0; k < this.potentialCustomerTypeList.length; k++) {
  543. if (this.potentialCustomerTypeList[k].dictCode == this.list.potentialCustomerType) {
  544. this.list.potentialCustomerType = this.potentialCustomerTypeList[k].text;
  545. }
  546. }
  547. } else {
  548. this.GZAttributeFormShow = false;
  549. }
  550. // if (this.list.storeCategory == '129081') {
  551. // this.dictTypeFormShow = true;
  552. // if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
  553. // this.list.tcfxName = this.list.attribute3;
  554. // } else {
  555. // this.list.tcfxName = this.list.attribute5;
  556. // }
  557. // }
  558. if (
  559. this.verifyStoreType(this.list.storeCategory) &&
  560. this.verifyStoreType(this.list.storeCategory).type == 'fxd'
  561. ) {
  562. this.dictTypeFormShow = true;
  563. for (var k = 0; k < this.TCFXList.length; k++) {
  564. if (this.TCFXList[k].dictCode == this.list.tcfxName) {
  565. this.list.tcfxName = this.TCFXList[k].text;
  566. }
  567. }
  568. }
  569. if (this.list.storeCategory == 'sjs61') {
  570. this.dictTypeFormShow = true;
  571. for (var k = 0; k < this.SJSList.length; k++) {
  572. if (this.SJSList[k].dictCode == this.list.tcfxName) {
  573. this.list.tcfxName = this.SJSList[k].text;
  574. }
  575. }
  576. }
  577. if (this.list.storeCategory == 'zyjz63') {
  578. this.dictTypeFormShow = true;
  579. for (var k = 0; k < this.QGJZist.length; k++) {
  580. if (this.QGJZist[k].dictCode == this.list.tcfxName) {
  581. this.list.tcfxName = this.QGJZist[k].text;
  582. }
  583. }
  584. }
  585. if (this.list.storeCategory == 'C912') {
  586. this.storeTypePOP = false;
  587. this.storeName = '铭牌上项目名称';
  588. this.address = '地址';
  589. } else if (this.list.storeCategory == 'C917') {
  590. this.storeTypePOP = false;
  591. this.storeName = '名称';
  592. this.address = '地址';
  593. } else {
  594. this.storeTypePOP = true;
  595. this.storeName = '名称';
  596. this.address = '地址';
  597. }
  598. // 获取门店订单
  599. this.getStoreOrderList(this.list.storeCode);
  600. } else {
  601. this.$toast.fail(res.msg);
  602. }
  603. });
  604. },
  605. // 获取门店订单
  606. getStoreOrderList(storeCode) {
  607. getOrderByStoreCode({ storeCode: storeCode }).then((res) => {
  608. if (res.code == 200 && res.data) {
  609. let orderList = res.data.ORDERS || [];
  610. if (orderList.length) {
  611. let orderMap = new Map();
  612. for (let i = 0; i < orderList.length; i++) {
  613. if (orderMap.has(orderList[i].ORDERID)) {
  614. orderMap.get(orderList[i].ORDERID).productDetail.push(orderList[i]);
  615. } else {
  616. let orderObj = {
  617. ORDERID: orderList[i].ORDERID, // 订单id
  618. ORDERDATE: orderList[i].ORDERDATE, //下单时间
  619. STATUS_DESCR: orderList[i].STATUS_DESCR, // 订单状态
  620. productDetail: [orderList[i]], // 订单详情
  621. };
  622. orderMap.set(orderList[i].ORDERID, orderObj);
  623. }
  624. }
  625. // totalPrice:
  626. let orderListArr = [];
  627. this.orderPrice = 0;
  628. for (let value of orderMap.values()) {
  629. let productTotalPrice = 0; //当前订单总金额
  630. for (let i = 0; i < value.productDetail.length; i++) {
  631. value.productDetail[i].productTotalPrice =
  632. value.productDetail[i].UNITPRICE * value.productDetail[i].QTY; // 单个商品总金额
  633. productTotalPrice = productTotalPrice + value.productDetail[i].productTotalPrice;
  634. }
  635. value.totalPrice = productTotalPrice;
  636. this.orderPrice = this.orderPrice + productTotalPrice;
  637. orderListArr.push(value);
  638. }
  639. this.orderList = orderListArr;
  640. } else {
  641. this.orderList = [];
  642. }
  643. this.activeNames = ['1'];
  644. }
  645. });
  646. },
  647. getSummaries(param) {
  648. const { columns, data } = param;
  649. const sums = [];
  650. columns.forEach((column, index) => {
  651. if (index === 0) {
  652. sums[index] = '总金额';
  653. return;
  654. }
  655. if (index === 2) {
  656. const values = data.map((item) => Number(item[column.property]));
  657. sums[index] = values.reduce((prev, curr) => {
  658. const value = Number(curr);
  659. if (!isNaN(value)) {
  660. return prev + curr;
  661. } else {
  662. return prev;
  663. }
  664. }, 0);
  665. // sums[index] += ' 元';
  666. }
  667. // const values = data.map((item) => Number(item[column.property]));
  668. // if (!values.every((value) => isNaN(value))) {
  669. // sums[index] = values.reduce((prev, curr) => {
  670. // const value = Number(curr);
  671. // if (!isNaN(value)) {
  672. // return prev + curr;
  673. // } else {
  674. // return prev;
  675. // }
  676. // }, 0);
  677. // sums[index] += ' 元';
  678. // } else {
  679. // sums[index] = 'N/A';
  680. // }
  681. });
  682. return sums;
  683. },
  684. formLink() {
  685. this.$router.push('/storeVisit/questions');
  686. },
  687. onClickLeft() {
  688. this.$router.go(-1);
  689. },
  690. tabChange(name, title) {
  691. console.log(name, title);
  692. },
  693. // 退回原因查看详情
  694. examineDetail() {
  695. this.rejectMsgShow = true;
  696. },
  697. // 退回提交
  698. rejectReasonSubmit() {
  699. if (this.rejectMessage != '') {
  700. this.approvalStoreFun('reject');
  701. } else {
  702. this.$notify({ type: 'warning', message: '请输入退回原因' });
  703. }
  704. },
  705. approvalStoreFun(type) {
  706. this.toastLoading(0, '正在提交...', true);
  707. // processApprovalStatus(2=通过,3=拒绝)
  708. let processApprovalStatus = type == 'reject' ? 3 : 2;
  709. let approvalDesc = type == 'reject' ? this.rejectMessage : '';
  710. let params = {
  711. approvalId: this.$route.query.approvalId, // 店铺id
  712. processApprovalStatus: processApprovalStatus, // 审批类型
  713. };
  714. if (type == 'reject') {
  715. params.approvalDesc = approvalDesc;
  716. }
  717. approvalStore(params).then((res) => {
  718. this.toastLoading().clear();
  719. if (res.code == 200) {
  720. this.$toast.success('提交成功');
  721. this.rejectReasonShow = false;
  722. // 从审批列表过来的原路返回
  723. if (this.$route.query.source && this.$route.query.source == 'newStoreApprovalList') {
  724. this.onClickLeft();
  725. } else {
  726. // 从提醒系统过来的直接关闭当前窗口
  727. this.getDetail();
  728. this.$dialog
  729. .confirm({
  730. title: '系统提示',
  731. message: '提交成功',
  732. showCancelButton: false,
  733. })
  734. .then(() => {
  735. this.wx.closeWindow();
  736. });
  737. }
  738. } else {
  739. this.$toast.fail(res.msg);
  740. }
  741. });
  742. },
  743. // 预览
  744. previewsImg(index) {
  745. var arrimg = [];
  746. for (var imgi = 0; imgi < this.displayImg.length; imgi++) {
  747. arrimg.push(this.displayImg[imgi]);
  748. }
  749. ImagePreview({
  750. images: arrimg,
  751. startPosition: index,
  752. });
  753. },
  754. },
  755. };
  756. </script>
  757. <style scoped lang="scss">
  758. .container {
  759. padding-bottom: 50px;
  760. }
  761. .myTab .van-tabs__nav--card {
  762. margin: 0 !important;
  763. border-left: 0;
  764. border-right: 0;
  765. }
  766. .myTab .van-tabs__wrap,
  767. .van-tabs__nav--card {
  768. height: 40px;
  769. }
  770. .myTab .van-tab {
  771. line-height: 40px;
  772. }
  773. .helpPageMask {
  774. width: 100%;
  775. height: 100%;
  776. background: rgba(116, 116, 116, 0.8);
  777. position: fixed;
  778. z-index: 100000;
  779. top: 0;
  780. right: 0;
  781. left: 0;
  782. bottom: 0;
  783. display: flex;
  784. align-items: center;
  785. justify-content: center;
  786. }
  787. .bottomBtn {
  788. position: fixed;
  789. bottom: 0;
  790. z-index: 10;
  791. height: 50px;
  792. width: 100%;
  793. display: flex;
  794. flex-direction: row;
  795. justify-content: space-around;
  796. .van-button {
  797. /* flex: 1; */
  798. width: 40%;
  799. }
  800. }
  801. .rejectMsg {
  802. position: sticky;
  803. top: 46px;
  804. z-index: 10;
  805. display: flex;
  806. box-sizing: border-box;
  807. width: 100%;
  808. padding: 10px 16px;
  809. overflow: hidden;
  810. color: #323233;
  811. font-size: 14px;
  812. line-height: 24px;
  813. background-color: #f5daac;
  814. font-weight: 600;
  815. .label {
  816. width: 6.2em;
  817. margin-right: 12px;
  818. }
  819. .value {
  820. flex: 1;
  821. overflow: hidden;
  822. text-overflow: ellipsis;
  823. display: -webkit-box;
  824. -webkit-line-clamp: 2;
  825. -webkit-box-orient: vertical;
  826. padding-right: 20px;
  827. }
  828. .examineDetail {
  829. width: 70px;
  830. color: #0057ba;
  831. }
  832. }
  833. .rejectMsgBox {
  834. min-height: 30%;
  835. max-height: 50%;
  836. padding: 10px 20px;
  837. display: flex;
  838. flex-direction: column;
  839. overflow: hidden;
  840. .title {
  841. padding: 10px 0;
  842. text-align: center;
  843. font-size: 16px;
  844. font-weight: 600px;
  845. }
  846. .content {
  847. flex: 1;
  848. overflow-y: auto;
  849. .rejectMsgItem {
  850. margin-bottom: 20px;
  851. .item {
  852. padding: 5px 0;
  853. span {
  854. display: inline-block;
  855. }
  856. }
  857. .label {
  858. width: 80px;
  859. font-size: 14px;
  860. font-weight: 600;
  861. }
  862. .value {
  863. font-size: 14px;
  864. }
  865. }
  866. }
  867. .btnBox {
  868. height: 44px;
  869. button {
  870. width: 100%;
  871. }
  872. }
  873. }
  874. .orderList {
  875. .orderItem {
  876. .orderTitle {
  877. padding: 5px 0;
  878. font-size: 16px;
  879. font-weight: 600;
  880. color: #000;
  881. display: flex;
  882. align-items: center;
  883. &::before {
  884. content: '';
  885. width: 8px;
  886. height: 8px;
  887. background: red;
  888. border-radius: 50%;
  889. display: inline-block;
  890. margin-right: 5px;
  891. }
  892. }
  893. }
  894. }
  895. .displayImg {
  896. .displayImgBox {
  897. position: relative;
  898. width: 48%;
  899. padding: 20px 0;
  900. height: 210px;
  901. float: left;
  902. margin-right: 4%;
  903. .title {
  904. text-align: center;
  905. padding: 5px 0;
  906. }
  907. }
  908. .displayImgBox:nth-child(even) {
  909. margin-right: 0;
  910. }
  911. i {
  912. position: absolute;
  913. right: 4px;
  914. color: white;
  915. background: red;
  916. overflow: hidden;
  917. border-radius: 50%;
  918. }
  919. }
  920. </style>
  921. <style lang="scss">
  922. .searchDiv {
  923. .van-search {
  924. /* // background: #fff; */
  925. }
  926. .van-search__action {
  927. font-size: 14px;
  928. color: #0057ba;
  929. font-weight: bold;
  930. background: #f1f1f1;
  931. border-bottom-right-radius: 60px;
  932. border-top-right-radius: 60px;
  933. border: 1px solid #ccc;
  934. padding: 0 20px;
  935. }
  936. .van-search--show-action {
  937. padding-right: 12px;
  938. }
  939. .van-search__content {
  940. border: 1px solid #ccc;
  941. border-bottom-left-radius: 60px;
  942. border-top-left-radius: 60px;
  943. background: #f1f1f1;
  944. border-right: 0;
  945. }
  946. }
  947. .helpAlert {
  948. .van-dialog__cancel {
  949. .van-button__text {
  950. &::before {
  951. content: '?';
  952. background: #f79200;
  953. width: 20px;
  954. display: inline-block;
  955. border-radius: 50%;
  956. color: #fff;
  957. }
  958. }
  959. }
  960. }
  961. .newStoreApprovalDetail {
  962. .TCFXList {
  963. .van-field__control--custom {
  964. flex-direction: column;
  965. align-items: self-start;
  966. .TCFXListTreeSelec {
  967. padding: 3px;
  968. }
  969. }
  970. }
  971. }
  972. </style>