newStoreApprovalDetail.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  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. <template>
  232. <van-field
  233. v-if="storeCompetitorList"
  234. readonly
  235. label="主营竞品品牌"
  236. autosize
  237. type="textarea"
  238. v-model="storeCompetitorList" />
  239. <van-field
  240. v-if="list.otherCompetitor"
  241. readonly
  242. label="其他"
  243. autosize
  244. type="textarea"
  245. v-model="list.otherCompetitor" />
  246. </template>
  247. </van-tab>
  248. </van-tabs>
  249. <br />
  250. <br />
  251. <br />
  252. <br />
  253. <br />
  254. <br />
  255. <!-- 未结案 未提交状态下可关闭门店、提交审核 -->
  256. <div class="bottomBtn" v-if="list.approvalStatus == 0 && list.processApprovalStatus == 1">
  257. <van-button color="red" round @click="rejectReasonShow = true">退回</van-button>
  258. <van-button type="primary" round @click="approvalStoreFun('success')">通过</van-button>
  259. </div>
  260. </div>
  261. <!-- 退回原因填写 -->
  262. <van-popup v-model="rejectReasonShow" class="rejectMsgBox" closeable round position="bottom">
  263. <div class="title">退回原因</div>
  264. <div class="content">
  265. <van-field
  266. v-model="rejectMessage"
  267. rows="2"
  268. autosize
  269. type="textarea"
  270. maxlength="300"
  271. placeholder="请输入退回原因" />
  272. </div>
  273. <div class="btnBox">
  274. <van-button type="primary" round @click="rejectReasonSubmit">提交</van-button>
  275. </div>
  276. </van-popup>
  277. <!-- 提交审核后退回原因 只有同城分销店显示 -->
  278. <van-popup v-model="rejectMsgShow" class="rejectMsgBox" closeable round position="bottom">
  279. <div class="title">退回详情</div>
  280. <div class="content">
  281. <div class="rejectMsgItem" v-for="(item, index) in rejectMsg" :key="index">
  282. <div class="item approver">
  283. <span class="label">审批人:</span>
  284. <span class="value">{{ item.approvalUserName }}</span>
  285. </div>
  286. <div class="item approvalTime">
  287. <span class="label">审批时间:</span>
  288. <span class="value">{{ item.approvalTime }}</span>
  289. </div>
  290. <div class="item rejectCause">
  291. <span class="label">退回原因:</span>
  292. <span class="value">{{ item.approvalDesc }}</span>
  293. </div>
  294. </div>
  295. </div>
  296. </van-popup>
  297. </div>
  298. </template>
  299. <script>
  300. import { ImagePreview } from 'vant';
  301. import {
  302. getById,
  303. getStoreTypeList,
  304. getStoreyslTypeList,
  305. getTCFXList,
  306. getSJSList,
  307. getQGJZist,
  308. getCustomerInfoList,
  309. getCustomerNatureList,
  310. getMainProjectList,
  311. getMainRelationList,
  312. getManagementModelList,
  313. getpotentialCustomerTypeList,
  314. getOrderByStoreCode,
  315. approvalStore,
  316. storeApprovaHistory,
  317. } from '@/api/index';
  318. import mapmarker from '@/components/mapMarker';
  319. import viewUploadImg from '@/components/viewUploadImg';
  320. import txmapimg1 from '@/assets/txmap1.svg';
  321. import txmapimg2 from '@/assets/txmap2.svg';
  322. import txmapimg3 from '@/assets/marker_blue.png';
  323. import uploadImg from '@/components/viewaddreddUploadImg.vue';
  324. export default {
  325. components: { uploadImg, mapmarker, viewUploadImg },
  326. data() {
  327. return {
  328. tabVal: 'insidePlan',
  329. list: {},
  330. txmapimg1: txmapimg1,
  331. txmapimg2: txmapimg2,
  332. txmapimg3: txmapimg3,
  333. storeId: '',
  334. vaue: '',
  335. show: false,
  336. storeTypeList: [],
  337. ManagementModelList: [],
  338. MainRelationList: [],
  339. MainProjectList: [],
  340. CustomerNatureList: [],
  341. CustomerInfoList: [],
  342. potentialCustomerTypeList: [],
  343. dictTypeFormShow: false,
  344. DIYshow: false,
  345. visitListList: [],
  346. TCFXList: [],
  347. QGJZist: [],
  348. SJSList: [],
  349. storeName: '名称',
  350. address: '地址',
  351. storeTypePOP: false,
  352. GZAttributeFormShow: false,
  353. pageShow: false,
  354. rejectMsgShow: false,
  355. //退回原因详情列表
  356. rejectMsg: [],
  357. activeNames: [],
  358. orderList: [],
  359. rejectReasonShow: false, //退回提交原因
  360. rejectMessage: '',
  361. displayImg: [],
  362. orderPrice: 0, //订单总金额
  363. storeCompetitorList: '',
  364. };
  365. },
  366. activated() {
  367. this.getCustomerInfoList();
  368. this.getManagementModelList();
  369. this.getMainRelationList();
  370. this.getMainProjectList();
  371. this.getCustomerNatureList();
  372. this.getTCFXList();
  373. this.getSJSList();
  374. this.getQGJZist();
  375. this.getStoreType();
  376. this.getpotentialCustomerTypeList();
  377. this.visitListList = [];
  378. window.scrollTo(0, 0);
  379. this.storeApprovaHistoryFun();
  380. },
  381. methods: {
  382. storeApprovaHistoryFun() {
  383. storeApprovaHistory({ storeId: this.$route.query.id }).then((res) => {
  384. this.rejectMsg = res.data || [];
  385. });
  386. },
  387. getCustomerInfoList() {
  388. getCustomerInfoList().then((res) => {
  389. var CustomerInfoList = [];
  390. for (var t = 0; t < res.data.length; t++) {
  391. CustomerInfoList.push({
  392. text: res.data[t].dictLabel,
  393. dictCode: res.data[t].dictValue,
  394. });
  395. }
  396. this.CustomerInfoList = CustomerInfoList;
  397. });
  398. },
  399. getCustomerNatureList() {
  400. getCustomerNatureList().then((res) => {
  401. var CustomerNatureList = [];
  402. for (var t = 0; t < res.data.length; t++) {
  403. CustomerNatureList.push({
  404. text: res.data[t].dictLabel,
  405. dictCode: res.data[t].dictValue,
  406. });
  407. }
  408. this.CustomerNatureList = CustomerNatureList;
  409. });
  410. },
  411. getpotentialCustomerTypeList() {
  412. getpotentialCustomerTypeList().then((res) => {
  413. var potentialCustomerTypeList = [];
  414. for (var t = 0; t < res.data.length; t++) {
  415. potentialCustomerTypeList.push({
  416. text: res.data[t].dictLabel,
  417. dictCode: res.data[t].dictValue,
  418. });
  419. }
  420. this.potentialCustomerTypeList = potentialCustomerTypeList;
  421. });
  422. },
  423. getMainProjectList() {
  424. getMainProjectList().then((res) => {
  425. var MainProjectList = [];
  426. for (var t = 0; t < res.data.length; t++) {
  427. MainProjectList.push({
  428. text: res.data[t].dictLabel,
  429. dictCode: res.data[t].dictValue,
  430. });
  431. }
  432. this.MainProjectList = MainProjectList;
  433. });
  434. },
  435. getMainRelationList() {
  436. getMainRelationList().then((res) => {
  437. var MainRelationList = [];
  438. for (var t = 0; t < res.data.length; t++) {
  439. MainRelationList.push({
  440. text: res.data[t].dictLabel,
  441. dictCode: res.data[t].dictValue,
  442. });
  443. }
  444. this.MainRelationList = MainRelationList;
  445. });
  446. },
  447. getManagementModelList() {
  448. getManagementModelList().then((res) => {
  449. var ManagementModelList = [];
  450. for (var t = 0; t < res.data.length; t++) {
  451. ManagementModelList.push({
  452. text: res.data[t].dictLabel,
  453. dictCode: res.data[t].dictValue,
  454. });
  455. }
  456. this.ManagementModelList = ManagementModelList;
  457. });
  458. },
  459. getSJSList() {
  460. getSJSList({}).then((res) => {
  461. var SJSList = [];
  462. for (var t = 0; t < res.data.length; t++) {
  463. SJSList.push({
  464. text: res.data[t].dictLabel,
  465. dictCode: res.data[t].dictValue,
  466. });
  467. }
  468. this.SJSList = SJSList;
  469. });
  470. },
  471. getQGJZist() {
  472. getQGJZist({}).then((res) => {
  473. var QGJZist = [];
  474. for (var t = 0; t < res.data.length; t++) {
  475. QGJZist.push({
  476. text: res.data[t].dictLabel,
  477. dictCode: res.data[t].dictValue,
  478. });
  479. }
  480. this.QGJZist = QGJZist;
  481. });
  482. },
  483. getTCFXList() {
  484. getTCFXList({}).then((res) => {
  485. var TCFXList = [];
  486. for (var t = 0; t < res.data.length; t++) {
  487. TCFXList.push({
  488. text: res.data[t].dictLabel,
  489. dictCode: res.data[t].dictCode,
  490. dictValue: res.data[t].dictValue,
  491. remark: res.data[t].remark,
  492. });
  493. }
  494. this.TCFXList = TCFXList;
  495. });
  496. },
  497. visitsFn(row) {
  498. this.$router.push({
  499. path: '/historicalDetails',
  500. query: {
  501. visitId: row.id,
  502. storeCode: row.storeCode,
  503. storeId: row.storeId,
  504. },
  505. });
  506. },
  507. setImgSrc(imgUrl) {
  508. let imgArr = imgUrl.split(',');
  509. return imgArr[0];
  510. },
  511. deleteImgs(val) {
  512. ImagePreview(val.split(','));
  513. },
  514. getStoreType() {
  515. if (localStorage.getItem('storeType') == '2') {
  516. this.DIYshow = true;
  517. getStoreyslTypeList({}).then((res) => {
  518. this.storeTypeList = res.data;
  519. this.getDetail();
  520. });
  521. } else {
  522. this.DIYshow = false;
  523. getStoreTypeList({}).then((res) => {
  524. this.storeTypeList = res.data;
  525. this.getDetail();
  526. });
  527. }
  528. },
  529. getDetail() {
  530. this.pageShow = false;
  531. let loading1 = this.$toast.loading({
  532. duration: 0,
  533. message: '加载中...',
  534. forbidClick: true,
  535. });
  536. getById({ storeId: this.$route.query.id }).then((res) => {
  537. loading1.clear();
  538. this.pageShow = true;
  539. localStorage.setItem('locationRemark', res.data.addressLine);
  540. localStorage.setItem('orgName', res.data.orgName);
  541. localStorage.setItem('chainName', res.data.storeName);
  542. if (res.code == 200) {
  543. this.list = res.data;
  544. if (this.list.storeCompetitorList) {
  545. this.storeCompetitorList = this.list.storeCompetitorList.join(',');
  546. } else {
  547. this.list.storeCompetitorList = [];
  548. }
  549. if (this.list.imgSed && this.list.imgSed != '') {
  550. this.displayImg = this.list.imgSed.split(',');
  551. } else {
  552. this.displayImg = [];
  553. }
  554. if (this.list.carShopImgList != null) {
  555. } else {
  556. this.list.carShopImgList = [];
  557. }
  558. if (this.list.storeCategory == 'C917') {
  559. this.GZAttributeFormShow = true;
  560. this.dictTypeSJSFormShow = false;
  561. this.dictTypeQGJZFormShow = false;
  562. this.dictTypeFormShow = false;
  563. this.dictTypeAFormShow = false;
  564. for (let k = 0; k < this.potentialCustomerTypeList.length; k++) {
  565. if (this.potentialCustomerTypeList[k].dictCode == this.list.potentialCustomerType) {
  566. this.list.potentialCustomerType = this.potentialCustomerTypeList[k].text;
  567. }
  568. }
  569. } else {
  570. this.GZAttributeFormShow = false;
  571. }
  572. // if (this.list.storeCategory == '129081') {
  573. // this.dictTypeFormShow = true;
  574. // if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
  575. // this.list.tcfxName = this.list.attribute3;
  576. // } else {
  577. // this.list.tcfxName = this.list.attribute5;
  578. // }
  579. // }
  580. if (
  581. this.verifyStoreType(this.list.storeCategory) &&
  582. this.verifyStoreType(this.list.storeCategory).type == 'fxd'
  583. ) {
  584. this.dictTypeFormShow = true;
  585. for (var k = 0; k < this.TCFXList.length; k++) {
  586. if (this.TCFXList[k].dictCode == this.list.tcfxName) {
  587. this.list.tcfxName = this.TCFXList[k].text;
  588. }
  589. }
  590. }
  591. if (this.list.storeCategory == 'sjs61') {
  592. this.dictTypeFormShow = true;
  593. for (var k = 0; k < this.SJSList.length; k++) {
  594. if (this.SJSList[k].dictCode == this.list.tcfxName) {
  595. this.list.tcfxName = this.SJSList[k].text;
  596. }
  597. }
  598. }
  599. if (this.list.storeCategory == 'zyjz63') {
  600. this.dictTypeFormShow = true;
  601. for (var k = 0; k < this.QGJZist.length; k++) {
  602. if (this.QGJZist[k].dictCode == this.list.tcfxName) {
  603. this.list.tcfxName = this.QGJZist[k].text;
  604. }
  605. }
  606. }
  607. if (this.list.storeCategory == 'C912') {
  608. this.storeTypePOP = false;
  609. this.storeName = '铭牌上项目名称';
  610. this.address = '地址';
  611. } else if (this.list.storeCategory == 'C917') {
  612. this.storeTypePOP = false;
  613. this.storeName = '名称';
  614. this.address = '地址';
  615. } else {
  616. this.storeTypePOP = true;
  617. this.storeName = '名称';
  618. this.address = '地址';
  619. }
  620. // 获取门店订单
  621. this.getStoreOrderList(this.list.storeCode);
  622. } else {
  623. this.$toast.fail(res.msg);
  624. }
  625. });
  626. },
  627. // 获取门店订单
  628. getStoreOrderList(storeCode) {
  629. getOrderByStoreCode({ storeCode: storeCode }).then((res) => {
  630. if (res.code == 200 && res.data) {
  631. let orderList = res.data.ORDERS || [];
  632. if (orderList.length) {
  633. let orderMap = new Map();
  634. for (let i = 0; i < orderList.length; i++) {
  635. if (orderMap.has(orderList[i].ORDERID)) {
  636. orderMap.get(orderList[i].ORDERID).productDetail.push(orderList[i]);
  637. } else {
  638. let orderObj = {
  639. ORDERID: orderList[i].ORDERID, // 订单id
  640. ORDERDATE: orderList[i].ORDERDATE, //下单时间
  641. STATUS_DESCR: orderList[i].STATUS_DESCR, // 订单状态
  642. productDetail: [orderList[i]], // 订单详情
  643. };
  644. orderMap.set(orderList[i].ORDERID, orderObj);
  645. }
  646. }
  647. // totalPrice:
  648. let orderListArr = [];
  649. this.orderPrice = 0;
  650. for (let value of orderMap.values()) {
  651. let productTotalPrice = 0; //当前订单总金额
  652. for (let i = 0; i < value.productDetail.length; i++) {
  653. value.productDetail[i].productTotalPrice =
  654. value.productDetail[i].UNITPRICE * value.productDetail[i].QTY; // 单个商品总金额
  655. productTotalPrice = productTotalPrice + value.productDetail[i].productTotalPrice;
  656. }
  657. value.totalPrice = productTotalPrice;
  658. this.orderPrice = this.orderPrice + productTotalPrice;
  659. orderListArr.push(value);
  660. }
  661. this.orderList = orderListArr;
  662. } else {
  663. this.orderList = [];
  664. }
  665. this.activeNames = ['1'];
  666. }
  667. });
  668. },
  669. getSummaries(param) {
  670. const { columns, data } = param;
  671. const sums = [];
  672. columns.forEach((column, index) => {
  673. if (index === 0) {
  674. sums[index] = '总金额';
  675. return;
  676. }
  677. if (index === 2) {
  678. const values = data.map((item) => Number(item[column.property]));
  679. sums[index] = values.reduce((prev, curr) => {
  680. const value = Number(curr);
  681. if (!isNaN(value)) {
  682. return prev + curr;
  683. } else {
  684. return prev;
  685. }
  686. }, 0);
  687. // sums[index] += ' 元';
  688. }
  689. // const values = data.map((item) => Number(item[column.property]));
  690. // if (!values.every((value) => isNaN(value))) {
  691. // sums[index] = values.reduce((prev, curr) => {
  692. // const value = Number(curr);
  693. // if (!isNaN(value)) {
  694. // return prev + curr;
  695. // } else {
  696. // return prev;
  697. // }
  698. // }, 0);
  699. // sums[index] += ' 元';
  700. // } else {
  701. // sums[index] = 'N/A';
  702. // }
  703. });
  704. return sums;
  705. },
  706. formLink() {
  707. this.$router.push('/storeVisit/questions');
  708. },
  709. onClickLeft() {
  710. this.$router.go(-1);
  711. },
  712. tabChange(name, title) {
  713. console.log(name, title);
  714. },
  715. // 退回原因查看详情
  716. examineDetail() {
  717. this.rejectMsgShow = true;
  718. },
  719. // 退回提交
  720. rejectReasonSubmit() {
  721. if (this.rejectMessage != '') {
  722. this.approvalStoreFun('reject');
  723. } else {
  724. this.$notify({ type: 'warning', message: '请输入退回原因' });
  725. }
  726. },
  727. approvalStoreFun(type) {
  728. this.toastLoading(0, '正在提交...', true);
  729. // processApprovalStatus(2=通过,3=拒绝)
  730. let processApprovalStatus = type == 'reject' ? 3 : 2;
  731. let approvalDesc = type == 'reject' ? this.rejectMessage : '';
  732. let params = {
  733. approvalId: this.$route.query.approvalId, // 店铺id
  734. processApprovalStatus: processApprovalStatus, // 审批类型
  735. };
  736. if (type == 'reject') {
  737. params.approvalDesc = approvalDesc;
  738. }
  739. approvalStore(params).then((res) => {
  740. this.toastLoading().clear();
  741. if (res.code == 200) {
  742. this.$toast.success('提交成功');
  743. this.rejectReasonShow = false;
  744. // 从审批列表过来的原路返回
  745. if (this.$route.query.source && this.$route.query.source == 'newStoreApprovalList') {
  746. this.onClickLeft();
  747. } else {
  748. // 从提醒系统过来的直接关闭当前窗口
  749. this.getDetail();
  750. this.$dialog
  751. .confirm({
  752. title: '系统提示',
  753. message: '提交成功',
  754. showCancelButton: false,
  755. })
  756. .then(() => {
  757. this.wx.closeWindow();
  758. });
  759. }
  760. } else {
  761. this.$toast.fail(res.msg);
  762. }
  763. });
  764. },
  765. // 预览
  766. previewsImg(index) {
  767. var arrimg = [];
  768. for (var imgi = 0; imgi < this.displayImg.length; imgi++) {
  769. arrimg.push(this.displayImg[imgi]);
  770. }
  771. ImagePreview({
  772. images: arrimg,
  773. startPosition: index,
  774. });
  775. },
  776. },
  777. };
  778. </script>
  779. <style scoped lang="scss">
  780. .container {
  781. padding-bottom: 50px;
  782. }
  783. .myTab .van-tabs__nav--card {
  784. margin: 0 !important;
  785. border-left: 0;
  786. border-right: 0;
  787. }
  788. .myTab .van-tabs__wrap,
  789. .van-tabs__nav--card {
  790. height: 40px;
  791. }
  792. .myTab .van-tab {
  793. line-height: 40px;
  794. }
  795. .helpPageMask {
  796. width: 100%;
  797. height: 100%;
  798. background: rgba(116, 116, 116, 0.8);
  799. position: fixed;
  800. z-index: 100000;
  801. top: 0;
  802. right: 0;
  803. left: 0;
  804. bottom: 0;
  805. display: flex;
  806. align-items: center;
  807. justify-content: center;
  808. }
  809. .bottomBtn {
  810. position: fixed;
  811. bottom: 0;
  812. z-index: 10;
  813. height: 50px;
  814. width: 100%;
  815. display: flex;
  816. flex-direction: row;
  817. justify-content: space-around;
  818. .van-button {
  819. /* flex: 1; */
  820. width: 40%;
  821. }
  822. }
  823. .rejectMsg {
  824. position: sticky;
  825. top: 46px;
  826. z-index: 10;
  827. display: flex;
  828. box-sizing: border-box;
  829. width: 100%;
  830. padding: 10px 16px;
  831. overflow: hidden;
  832. color: #323233;
  833. font-size: 14px;
  834. line-height: 24px;
  835. background-color: #f5daac;
  836. font-weight: 600;
  837. .label {
  838. width: 6.2em;
  839. margin-right: 12px;
  840. }
  841. .value {
  842. flex: 1;
  843. overflow: hidden;
  844. text-overflow: ellipsis;
  845. display: -webkit-box;
  846. -webkit-line-clamp: 2;
  847. -webkit-box-orient: vertical;
  848. padding-right: 20px;
  849. }
  850. .examineDetail {
  851. width: 70px;
  852. color: #0057ba;
  853. }
  854. }
  855. .rejectMsgBox {
  856. min-height: 30%;
  857. max-height: 50%;
  858. padding: 10px 20px;
  859. display: flex;
  860. flex-direction: column;
  861. overflow: hidden;
  862. .title {
  863. padding: 10px 0;
  864. text-align: center;
  865. font-size: 16px;
  866. font-weight: 600px;
  867. }
  868. .content {
  869. flex: 1;
  870. overflow-y: auto;
  871. .rejectMsgItem {
  872. margin-bottom: 20px;
  873. .item {
  874. padding: 5px 0;
  875. span {
  876. display: inline-block;
  877. }
  878. }
  879. .label {
  880. width: 80px;
  881. font-size: 14px;
  882. font-weight: 600;
  883. }
  884. .value {
  885. font-size: 14px;
  886. }
  887. }
  888. }
  889. .btnBox {
  890. height: 44px;
  891. button {
  892. width: 100%;
  893. }
  894. }
  895. }
  896. .orderList {
  897. .orderItem {
  898. .orderTitle {
  899. padding: 5px 0;
  900. font-size: 16px;
  901. font-weight: 600;
  902. color: #000;
  903. display: flex;
  904. align-items: center;
  905. &::before {
  906. content: '';
  907. width: 8px;
  908. height: 8px;
  909. background: red;
  910. border-radius: 50%;
  911. display: inline-block;
  912. margin-right: 5px;
  913. }
  914. }
  915. }
  916. }
  917. .displayImg {
  918. .displayImgBox {
  919. position: relative;
  920. width: 48%;
  921. padding: 20px 0;
  922. height: 210px;
  923. float: left;
  924. margin-right: 4%;
  925. .title {
  926. text-align: center;
  927. padding: 5px 0;
  928. }
  929. }
  930. .displayImgBox:nth-child(even) {
  931. margin-right: 0;
  932. }
  933. i {
  934. position: absolute;
  935. right: 4px;
  936. color: white;
  937. background: red;
  938. overflow: hidden;
  939. border-radius: 50%;
  940. }
  941. }
  942. </style>
  943. <style lang="scss">
  944. .searchDiv {
  945. .van-search {
  946. /* // background: #fff; */
  947. }
  948. .van-search__action {
  949. font-size: 14px;
  950. color: #0057ba;
  951. font-weight: bold;
  952. background: #f1f1f1;
  953. border-bottom-right-radius: 60px;
  954. border-top-right-radius: 60px;
  955. border: 1px solid #ccc;
  956. padding: 0 20px;
  957. }
  958. .van-search--show-action {
  959. padding-right: 12px;
  960. }
  961. .van-search__content {
  962. border: 1px solid #ccc;
  963. border-bottom-left-radius: 60px;
  964. border-top-left-radius: 60px;
  965. background: #f1f1f1;
  966. border-right: 0;
  967. }
  968. }
  969. .helpAlert {
  970. .van-dialog__cancel {
  971. .van-button__text {
  972. &::before {
  973. content: '?';
  974. background: #f79200;
  975. width: 20px;
  976. display: inline-block;
  977. border-radius: 50%;
  978. color: #fff;
  979. }
  980. }
  981. }
  982. }
  983. .newStoreApprovalDetail {
  984. .TCFXList {
  985. .van-field__control--custom {
  986. flex-direction: column;
  987. align-items: self-start;
  988. .TCFXListTreeSelec {
  989. padding: 3px;
  990. }
  991. }
  992. }
  993. }
  994. </style>