index.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  1. <template>
  2. <div class="orderConfirm pagePadding">
  3. <div
  4. style="width: 100%"
  5. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  6. >
  7. <show-data-table
  8. style="margin: 0 0 10px 0; padding: 0"
  9. :sitem="sitem"
  10. v-if="sitem && status"
  11. :columns="showColumns"
  12. border
  13. >
  14. <template #status>
  15. <el-tag
  16. :size="'mini'"
  17. :type="sitem.status_type"
  18. style="margin: auto"
  19. >{{ sitem.status_name }}</el-tag
  20. >
  21. </template>
  22. <template #error_msg>
  23. <span :style="{ color: sitem.error_msg ? 'red' : '' }">{{
  24. sitem.error_msg ? sitem.error_msg : "--"
  25. }}</span>
  26. </template>
  27. </show-data-table>
  28. <el-form
  29. ref="ruleForm"
  30. :model="ruleForm"
  31. status-icon
  32. :size="'mini'"
  33. :rules="rulesThis"
  34. label-width="0px"
  35. >
  36. <div class="tab-row">
  37. <div class="tab-item-label">
  38. <label style="color: transparent">*</label>字段
  39. </div>
  40. <div class="tab-item-main">
  41. <el-row class="tab-title">
  42. <el-col :span="4">文件导入数据</el-col>
  43. <el-col :span="9">系统解析数据</el-col>
  44. <el-col :span="11">确认后的数据</el-col>
  45. </el-row>
  46. </div>
  47. </div>
  48. <div
  49. v-if="
  50. importSitem &&
  51. importSitem.platform_code &&
  52. confirmSitem &&
  53. confirmSitem.platform_code
  54. "
  55. >
  56. <div class="tab-row">
  57. <div class="tab-item-label">
  58. <div><label style="color: red">*</label>平台订单号</div>
  59. <div><label style="color: transparent">*</label>其他单号</div>
  60. </div>
  61. <div class="tab-item-main">
  62. <el-row class="tab-title">
  63. <el-col :span="4">
  64. <div style="min-height: 26px">
  65. {{ importSitem.platform_code }}
  66. </div>
  67. <div style="min-height: 26px">{{ importSitem.po_code }}</div>
  68. </el-col>
  69. <el-col :span="9">
  70. <div style="min-height: 26px">
  71. {{ confirmSitem.platform_code }}
  72. </div>
  73. <div style="min-height: 26px">{{ confirmSitem.po_code }}</div>
  74. </el-col>
  75. <el-col :span="11" class="nop">
  76. <el-row>
  77. <el-col :span="12" class="border">
  78. <el-form-item prop="platform_code">
  79. <el-input
  80. v-model="ruleForm.platform_code"
  81. maxlength="100"
  82. :disabled="
  83. !(
  84. status === '2' &&
  85. powers.some((item) => item == '008')
  86. )
  87. "
  88. placeholder="平台订单号"
  89. /> </el-form-item
  90. ></el-col>
  91. <el-col :span="12" class="border">
  92. <el-form-item prop="po_code">
  93. <el-input
  94. v-model="ruleForm.po_code"
  95. maxlength="100"
  96. :disabled="
  97. !(
  98. status === '2' &&
  99. powers.some((item) => item == '008')
  100. )
  101. "
  102. placeholder="其他单号"
  103. />
  104. </el-form-item>
  105. </el-col>
  106. </el-row>
  107. </el-col>
  108. </el-row>
  109. </div>
  110. </div>
  111. <div class="tab-row">
  112. <div class="tab-item-label">
  113. <div><label style="color: red">*</label>平台订单下单时间</div>
  114. <div><label style="color: red">*</label>平台商品编号</div>
  115. </div>
  116. <div class="tab-item-main">
  117. <el-row class="tab-title">
  118. <el-col :span="4">
  119. <div style="min-height: 26px">
  120. {{ importSitem.platform_time }}
  121. </div>
  122. <div style="min-height: 26px">
  123. {{ importSitem.plat_code }}
  124. </div>
  125. </el-col>
  126. <el-col :span="9"
  127. ><div style="min-height: 26px">
  128. {{ confirmSitem.platform_time }}
  129. </div>
  130. <div style="min-height: 26px">
  131. {{ confirmSitem.plat_code }}
  132. </div>
  133. <div v-if="conGoodData && conGoodData.good_thumb_img">
  134. <show-data-table
  135. :sitem="conGoodData"
  136. :columns="onlineColumns"
  137. :border="true"
  138. >
  139. <template slot="good_name">
  140. <img
  141. v-viewer
  142. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  143. class="fl hover"
  144. v-if="conGoodData.good_thumb_img"
  145. :src="conGoodData.good_thumb_img"
  146. alt=""
  147. />
  148. <span>{{ conGoodData.good_name }}</span>
  149. <span
  150. v-for="(si, i) in conGoodData.speclist"
  151. :key="si.spec_id + i"
  152. >
  153. <span v-if="i !== 0">-</span>
  154. <span v-else>_</span>
  155. <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
  156. </span>
  157. <el-popover placement="top" width="300" trigger="hover">
  158. <ul>
  159. <li>
  160. <span>上线商品编号:</span
  161. ><span>{{ conGoodData.skuCode }}</span>
  162. </li>
  163. <li
  164. v-if="
  165. newTime !== '' &&
  166. private_field &&
  167. private_field.length > 0 &&
  168. private_field.some((item) => item == '1')
  169. "
  170. >
  171. <span>商品成本编号:</span
  172. ><span>{{ conGoodData.spuCode }}</span>
  173. </li>
  174. <!-- <li>
  175. <span>平台商品编码:</span
  176. ><span>{{ conGoodData.platform_code_en }}</span>
  177. </li> -->
  178. </ul>
  179. <i
  180. class="el-icon-warning-outline fr"
  181. slot="reference"
  182. ></i>
  183. </el-popover>
  184. </template>
  185. <template slot="company">
  186. <span>{{ conGoodData.company }}</span>
  187. <el-popover placement="top" width="300" trigger="hover">
  188. <ul>
  189. <li>
  190. <span>业务企业编号:</span
  191. ><span>{{ conGoodData.companyNo }}</span>
  192. </li>
  193. </ul>
  194. <i
  195. class="el-icon-warning-outline fr"
  196. slot="reference"
  197. ></i>
  198. </el-popover>
  199. </template>
  200. <template slot="cat_info">
  201. <span
  202. v-for="(si, sii) in conGoodData.cat_info"
  203. :key="si + sii"
  204. >{{ sii === 0 ? "" : "_" }}{{ si.name }}</span
  205. >
  206. </template>
  207. <template slot="exclusive">
  208. <span
  209. v-for="(si, sii) in conGoodData.exclusive"
  210. :key="si.id"
  211. >
  212. <span v-if="sii !== 0">/</span>
  213. <span>{{ si.name }}</span>
  214. </span>
  215. </template>
  216. <template slot="is_stock">
  217. <el-tag
  218. :size="'mini'"
  219. v-text="
  220. (
  221. options4.find(
  222. (item) => item.id == conGoodData.is_stock
  223. ) || {}
  224. ).name || '--'
  225. "
  226. />
  227. </template>
  228. </show-data-table>
  229. </div>
  230. </el-col>
  231. <el-col :span="11" class="nop">
  232. <el-row>
  233. <el-col :span="12" class="border">
  234. <el-form-item prop="platform_time">
  235. <el-date-picker
  236. type="datetime"
  237. placeholder="平台订单下单时间"
  238. v-model="ruleForm.platform_time"
  239. style="width: 100%"
  240. value-format="yyyy-MM-dd HH:mm:ss"
  241. :disabled="
  242. !(
  243. status === '2' &&
  244. powers.some((item) => item == '008')
  245. )
  246. "
  247. :picker-options="pickerOptions"
  248. @change="selectTime"
  249. >
  250. </el-date-picker> </el-form-item
  251. ></el-col>
  252. <el-col :span="12" class="border">
  253. <el-form-item prop="plat_code">
  254. <el-input
  255. v-model="ruleForm.plat_code"
  256. maxlength="100"
  257. readonly
  258. :disabled="
  259. !(
  260. status === '2' &&
  261. powers.some((item) => item == '008')
  262. )
  263. "
  264. @focus="showModel = true"
  265. placeholder="平台商品编号"
  266. /></el-form-item>
  267. </el-col>
  268. <el-col
  269. :span="24"
  270. v-if="subGoodData && subGoodData.good_thumb_img"
  271. >
  272. <show-data-table
  273. :sitem="subGoodData"
  274. :columns="onlineColumns"
  275. :border="true"
  276. >
  277. <template slot="good_name">
  278. <img
  279. v-viewer
  280. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  281. class="fl"
  282. v-if="subGoodData.good_thumb_img"
  283. :src="subGoodData.good_thumb_img"
  284. alt=""
  285. />
  286. <span>{{ subGoodData.good_name }}</span>
  287. <span
  288. v-for="(si, i) in subGoodData.speclist"
  289. :key="si.spec_id + i"
  290. >
  291. <span v-if="i !== 0">-</span>
  292. <span v-else>_</span>
  293. <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
  294. </span>
  295. <el-popover
  296. placement="top"
  297. width="300"
  298. trigger="hover"
  299. >
  300. <ul>
  301. <li>
  302. <span>上线商品编号:</span
  303. ><span>{{ subGoodData.skuCode }}</span>
  304. </li>
  305. <li
  306. v-if="
  307. newTime !== '' &&
  308. private_field &&
  309. private_field.length > 0 &&
  310. private_field.some((item) => item == '1')
  311. "
  312. >
  313. <span>商品成本编号:</span
  314. ><span>{{ subGoodData.spuCode }}</span>
  315. </li>
  316. <!-- <li>
  317. <span>平台商品编码:</span
  318. ><span>{{ subGoodData.platform_code_en }}</span>
  319. </li> -->
  320. </ul>
  321. <i
  322. class="el-icon-warning-outline fr"
  323. slot="reference"
  324. ></i>
  325. </el-popover>
  326. </template>
  327. <template slot="company">
  328. <span>{{ subGoodData.company }}</span>
  329. <el-popover
  330. placement="top"
  331. width="300"
  332. trigger="hover"
  333. >
  334. <ul>
  335. <li>
  336. <span>业务企业编号:</span
  337. ><span>{{ subGoodData.companyNo }}</span>
  338. </li>
  339. </ul>
  340. <i
  341. class="el-icon-warning-outline fr"
  342. slot="reference"
  343. ></i>
  344. </el-popover>
  345. </template>
  346. <template slot="cat_info">
  347. <span
  348. v-for="(si, sii) in subGoodData.cat_info"
  349. :key="si + sii"
  350. >{{ sii === 0 ? "" : "_" }}{{ si.name }}</span
  351. >
  352. </template>
  353. <template slot="exclusive">
  354. <span
  355. v-for="(si, sii) in subGoodData.exclusive"
  356. :key="si.id"
  357. >
  358. <span v-if="sii !== 0">/</span>
  359. <span>{{ si.name }}</span>
  360. </span>
  361. </template>
  362. <template slot="is_stock">
  363. <el-tag
  364. :size="'mini'"
  365. v-text="
  366. (
  367. options4.find(
  368. (item) => item.id == subGoodData.is_stock
  369. ) || {}
  370. ).name || '--'
  371. "
  372. />
  373. </template>
  374. </show-data-table>
  375. </el-col>
  376. </el-row>
  377. </el-col>
  378. </el-row>
  379. </div>
  380. </div>
  381. <div class="tab-row">
  382. <div class="tab-item-label">
  383. <div><label style="color: red">*</label>收费模式</div>
  384. <div><label style="color: red">*</label>销售渠道</div>
  385. </div>
  386. <div class="tab-item-main">
  387. <el-row class="tab-title">
  388. <el-col :span="4">
  389. <div style="min-height: 26px">{{ importSitem.mode }}</div>
  390. <div style="min-height: 26px">
  391. {{ importSitem.sale_source }}
  392. </div>
  393. </el-col>
  394. <el-col :span="9">
  395. <div style="min-height: 26px">{{ confirmSitem.mode }}</div>
  396. <div style="min-height: 26px">
  397. {{ confirmSitem.sale_source }}
  398. </div></el-col
  399. >
  400. <el-col :span="11" class="nop">
  401. <el-row>
  402. <el-col :span="12" class="border">
  403. <el-form-item prop="mode">
  404. <el-select
  405. v-model="ruleForm.mode"
  406. style="width: 100%"
  407. clearable
  408. :disabled="
  409. !(
  410. status === '2' &&
  411. powers.some((item) => item == '008')
  412. )
  413. "
  414. placeholder="收费模式"
  415. >
  416. <el-option
  417. v-for="item in options"
  418. :key="item.label"
  419. :label="item.label"
  420. :value="item.label"
  421. >
  422. </el-option> </el-select
  423. ></el-form-item>
  424. </el-col>
  425. <el-col :span="12" class="border">
  426. <el-form-item prop="sale_source">
  427. <el-select
  428. v-model="ruleForm.sale_source"
  429. style="width: 100%"
  430. clearable
  431. :disabled="
  432. !(
  433. status === '2' &&
  434. powers.some((item) => item == '008')
  435. )
  436. "
  437. placeholder="销售渠道"
  438. >
  439. <el-option
  440. v-for="(item, i) in coptions"
  441. :key="item.source + i"
  442. :label="item.source"
  443. :value="item.source"
  444. >
  445. </el-option> </el-select></el-form-item></el-col
  446. ></el-row>
  447. </el-col>
  448. </el-row>
  449. </div>
  450. </div>
  451. <div class="tab-row">
  452. <div class="tab-item-label">
  453. <div><label style="color: red">*</label>收货人</div>
  454. <div><label style="color: red">*</label>收货电话</div>
  455. </div>
  456. <div class="tab-item-main">
  457. <el-row class="tab-title">
  458. <el-col :span="4">
  459. <div style="min-height: 26px">
  460. {{ importSitem.contactor }}
  461. </div>
  462. <div style="min-height: 26px">
  463. {{ importSitem.mobile }}
  464. </div>
  465. </el-col>
  466. <el-col :span="9">
  467. <div style="min-height: 26px">
  468. {{ confirmSitem.contactor }}
  469. </div>
  470. <div style="min-height: 26px">
  471. {{ confirmSitem.mobile }}
  472. </div></el-col
  473. >
  474. <el-col :span="11" class="nop">
  475. <el-row>
  476. <el-col :span="12" class="border">
  477. <el-form-item prop="contactor">
  478. <el-input
  479. v-model="ruleForm.contactor"
  480. maxlength="100"
  481. :disabled="
  482. !(
  483. status === '2' &&
  484. powers.some((item) => item == '008')
  485. )
  486. "
  487. placeholder="收货人"
  488. />
  489. </el-form-item>
  490. </el-col>
  491. <el-col :span="12" class="border">
  492. <el-form-item prop="mobile">
  493. <el-input
  494. v-model="ruleForm.mobile"
  495. maxlength="100"
  496. :disabled="
  497. !(
  498. status === '2' &&
  499. powers.some((item) => item == '008')
  500. )
  501. "
  502. placeholder="收货电话"
  503. />
  504. </el-form-item>
  505. </el-col>
  506. </el-row>
  507. </el-col>
  508. </el-row>
  509. </div>
  510. </div>
  511. <div class="tab-row">
  512. <div class="tab-item-label">
  513. <div><label style="color: red">*</label>省市区</div>
  514. <div><label style="color: red">*</label>详细地址</div>
  515. </div>
  516. <div class="tab-item-main">
  517. <el-row class="tab-title">
  518. <el-col :span="4">
  519. <div style="min-height: 26px">&nbsp;</div>
  520. <div style="min-height: 26px">
  521. {{ importSitem.addr }}
  522. </div></el-col
  523. >
  524. <el-col :span="9">
  525. <div style="min-height: 26px">
  526. {{ confirmSitem.addr_name }}&nbsp;
  527. </div>
  528. <div style="min-height: 26px">{{ confirmSitem.addr }}</div>
  529. </el-col>
  530. <el-col :span="11" class="nop">
  531. <el-row>
  532. <el-col :span="12" class="border">
  533. <el-form-item prop="addr_code">
  534. <select-area
  535. :value="ruleForm.addr_code"
  536. :size="'mini'"
  537. :disabled="
  538. !(
  539. status === '2' &&
  540. powers.some((item) => item == '008')
  541. )
  542. "
  543. placeholder="收货省市区"
  544. @selectChange="select_area_change($event)"
  545. />
  546. </el-form-item>
  547. </el-col>
  548. <el-col :span="12" class="border">
  549. <el-form-item prop="addr">
  550. <el-input
  551. v-model="ruleForm.addr"
  552. maxlength="100"
  553. :disabled="
  554. !(
  555. status === '2' &&
  556. powers.some((item) => item == '008')
  557. )
  558. "
  559. placeholder="详细地址"
  560. />
  561. </el-form-item>
  562. </el-col>
  563. </el-row>
  564. </el-col>
  565. </el-row>
  566. </div>
  567. </div>
  568. <div class="tab-row">
  569. <div class="tab-item-label">
  570. <label style="color: red">*</label>订单备注
  571. </div>
  572. <div class="tab-item-main">
  573. <el-row class="tab-title">
  574. <el-col :span="4" style="min-height: 26px">{{
  575. importSitem.order_remark
  576. }}</el-col>
  577. <el-col :span="9" style="min-height: 26px">{{
  578. confirmSitem.order_remark
  579. }}</el-col>
  580. <el-col :span="11">
  581. <el-form-item prop="order_remark">
  582. <el-input
  583. v-model="ruleForm.order_remark"
  584. maxlength="100"
  585. :disabled="
  586. !(
  587. status === '2' && powers.some((item) => item == '008')
  588. )
  589. "
  590. placeholder="订单备注" /></el-form-item
  591. ></el-col>
  592. </el-row>
  593. </div>
  594. </div>
  595. <div class="tab-row">
  596. <div class="tab-item-label">
  597. <div><label style="color: red">*</label>数量</div>
  598. <div><label style="color: red">*</label>单价</div>
  599. </div>
  600. <div class="tab-item-main">
  601. <el-row class="tab-title">
  602. <el-col :span="4">
  603. <div style="min-height: 26px">{{ importSitem.num }}</div>
  604. <div style="min-height: 26px">{{ importSitem.price }}</div>
  605. </el-col>
  606. <el-col :span="9">
  607. <div style="min-height: 26px">{{ confirmSitem.num }}</div>
  608. <div style="min-height: 26px">{{ confirmSitem.price }}</div>
  609. </el-col>
  610. <el-col :span="11" class="nop">
  611. <el-row>
  612. <el-col :span="12" class="border">
  613. <el-form-item prop="num">
  614. <digital-input
  615. :values="ruleForm.num"
  616. :placeholder="'数量'"
  617. :min="0"
  618. :max="100000000000"
  619. :position="'right'"
  620. :precision="0"
  621. :size="'mini'"
  622. :controls="false"
  623. :append="''"
  624. :disabled="
  625. !(
  626. status === '2' &&
  627. powers.some((item) => item == '008')
  628. )
  629. "
  630. @reschange="number_change($event, 'num')"
  631. />
  632. </el-form-item>
  633. </el-col>
  634. <el-col :span="12" class="border">
  635. <el-form-item prop="price">
  636. <digital-input
  637. :values="ruleForm.price"
  638. :placeholder="'单价'"
  639. :min="price_min"
  640. :disabled="
  641. !(
  642. status === '2' &&
  643. powers.some((item) => item == '008')
  644. )
  645. "
  646. :max="100000000000"
  647. :position="'right'"
  648. :precision="2"
  649. :size="'mini'"
  650. :controls="false"
  651. :append="'元'"
  652. @reschange="number_change($event, 'price')"
  653. />
  654. </el-form-item>
  655. </el-col>
  656. </el-row>
  657. </el-col>
  658. </el-row>
  659. </div>
  660. </div>
  661. <div class="tab-row">
  662. <div class="tab-item-label">
  663. <label style="color: transparent">*</label>活动名称
  664. </div>
  665. <div class="tab-item-main">
  666. <el-row class="tab-title">
  667. <el-col :span="4" style="min-height: 26px">{{
  668. importSitem.activity_name
  669. }}</el-col>
  670. <el-col :span="9" style="min-height: 26px">{{
  671. confirmSitem.activity_name
  672. }}</el-col>
  673. <el-col :span="11">
  674. <el-form-item prop="activity_code">
  675. <el-select
  676. v-model="ruleForm.activity_code"
  677. style="width: 100%"
  678. clearable
  679. :disabled="
  680. !(
  681. status === '2' && powers.some((item) => item == '008')
  682. )
  683. "
  684. @change="get_new_price"
  685. placeholder="活动名称"
  686. >
  687. <el-option
  688. v-for="(item, i) in actOptions"
  689. :key="item.activity_code + i"
  690. :label="item.activity_name"
  691. :value="item.activity_code"
  692. >
  693. </el-option>
  694. </el-select>
  695. </el-form-item>
  696. </el-col>
  697. </el-row>
  698. </div>
  699. </div>
  700. <div class="tab-row">
  701. <div class="tab-item-label">
  702. <label style="color: transparent">*</label>订单总金额
  703. </div>
  704. <div class="tab-item-main">
  705. <el-row class="tab-title">
  706. <el-col :span="4" style="min-height: 26px">{{
  707. importSitem.before_discount_all_price
  708. }}</el-col>
  709. <el-col :span="9" style="min-height: 26px">{{
  710. confirmSitem.before_discount_all_price
  711. }}</el-col>
  712. <el-col :span="11" style="min-height: 26px">
  713. {{ ruleForm.before_discount_all_price }}</el-col
  714. >
  715. </el-row>
  716. </div>
  717. </div>
  718. <div
  719. class="tab-row"
  720. v-if="status === '2' && powers.some((item) => item == '008')"
  721. >
  722. <div class="tab-item-label">
  723. <label style="color: transparent">*</label>
  724. </div>
  725. <div class="tab-item-main tr">
  726. <el-button type="primary" @click="submitForm" :size="'mini'"
  727. >保 存
  728. </el-button>
  729. <!-- <el-button @click="showModelThis = false" :size="'mini'">{{
  730. isDetail ? "关 闭" : "取 消"
  731. }}</el-button> -->
  732. </div>
  733. </div>
  734. </div>
  735. </el-form>
  736. <search-good-online-modal
  737. :once="true"
  738. :sitem="{}"
  739. :active="true"
  740. :show-model="showModel"
  741. @resultList="resultList"
  742. @cancel="showModel = false"
  743. />
  744. </div>
  745. <div v-else>
  746. <no-auth></no-auth>
  747. </div>
  748. </div>
  749. </template>
  750. <script>
  751. import mixinPage from "@/mixins/elPaginationHandle";
  752. import resToken from "@/mixins/resToken";
  753. import asyncRequest from "@/apis/service/orderEntry/orderConfirm";
  754. import {
  755. options,
  756. ruleForm,
  757. rules,
  758. options1,
  759. options2,
  760. options3,
  761. options4,
  762. options5,
  763. options6,
  764. options7,
  765. options8,
  766. options9,
  767. onlineColumns,
  768. } from "./columns";
  769. import searchGoodOnlineModal from "@/components/search-good-online-modal";
  770. export default {
  771. name: "orderConfirm",
  772. mixins: [mixinPage, resToken],
  773. components: {
  774. searchGoodOnlineModal,
  775. },
  776. computed: {
  777. powers() {
  778. let tran =
  779. this.$store.getters.btnList.find(
  780. (item) => item.menu_route == "orderConfirm"
  781. ) || {};
  782. if (tran && tran.action && tran.action.length > 0) {
  783. return tran.action;
  784. } else {
  785. return [];
  786. }
  787. },
  788. },
  789. data() {
  790. return {
  791. statusOptions: [],
  792. platform_id: "",
  793. showColumns: [
  794. {
  795. prop: "creater",
  796. label: "导入人",
  797. span: 6,
  798. },
  799. {
  800. prop: "addtime",
  801. label: "导入时间",
  802. span: 6,
  803. },
  804. {
  805. prop: "status",
  806. label: "状态",
  807. _slot_: "status",
  808. span: 6,
  809. },
  810. {
  811. prop: "orderCode",
  812. label: "订单编号",
  813. span: 6,
  814. },
  815. {
  816. prop: "updater",
  817. label: "确认人",
  818. span: 6,
  819. },
  820. {
  821. prop: "success_date",
  822. label: "录入成功时间",
  823. span: 6,
  824. },
  825. {
  826. prop: "platform_name",
  827. label: "客户名称",
  828. span: 12,
  829. },
  830. {
  831. prop: "platform_title",
  832. label: "导入目标平台",
  833. span: 6,
  834. },
  835. {
  836. prop: "error_msg",
  837. label: "解析失败原因",
  838. _slot_: "error_msg",
  839. span: 18,
  840. },
  841. ],
  842. showModel: false,
  843. hasdiff: false,
  844. activeTabs: "1",
  845. sitem: null,
  846. isMetal: false,
  847. finishStatus: "finish",
  848. pickerOptions: {
  849. disabledDate: (time) => {
  850. return time.getTime() > new Date().valueOf();
  851. },
  852. },
  853. activeNames: ["0", "1", "2", "3", "4", "5", "10"],
  854. importSitem: null,
  855. confirmSitem: null,
  856. price_min: "0",
  857. subSitem: null,
  858. conGoodData: null,
  859. subGoodData: null,
  860. status: "",
  861. newTime: "",
  862. loading: false,
  863. queryId: "",
  864. rulesThis: {},
  865. coptions: [],
  866. options,
  867. actOptions: [],
  868. ruleForm: {},
  869. rules,
  870. options1,
  871. options2,
  872. options3,
  873. options4,
  874. options5,
  875. options6,
  876. options7,
  877. options8,
  878. options9,
  879. onlineColumns,
  880. priceLoding: false,
  881. };
  882. },
  883. mounted() {
  884. this.queryId = this.$route.query.id;
  885. this.initForm();
  886. },
  887. methods: {
  888. change_good() {},
  889. statusActive(status) {
  890. let active = "";
  891. switch (status) {
  892. case "1":
  893. active = "系统验证数据中";
  894. break;
  895. case "2":
  896. active = "待确认订单信息";
  897. break;
  898. case "3":
  899. active = "待处理(待扣减库存)";
  900. break;
  901. case "4":
  902. active = "库存不足";
  903. break;
  904. case "5":
  905. active = "订单录入成功";
  906. break;
  907. }
  908. return active;
  909. },
  910. statusActiveTag(status) {
  911. let active = "";
  912. switch (status) {
  913. case "1":
  914. active = "";
  915. break;
  916. case "2":
  917. active = "info";
  918. break;
  919. case "3":
  920. active = "warning";
  921. break;
  922. case "4":
  923. active = "danger";
  924. break;
  925. case "5":
  926. active = "success";
  927. break;
  928. }
  929. return active;
  930. },
  931. async initForm() {
  932. this.loading = true;
  933. this.rulesThis = this.rules;
  934. await this.resetForm();
  935. await this.initData();
  936. this.loading = false;
  937. },
  938. async againForm(sitem) {
  939. const {
  940. platform_code,
  941. po_code,
  942. platform_time,
  943. plat_code,
  944. sale_source,
  945. mode,
  946. contactor,
  947. mobile,
  948. price,
  949. num,
  950. before_discount_all_price,
  951. activity_code,
  952. order_remark,
  953. addr,
  954. addr_code,
  955. } = sitem;
  956. this.ruleForm = {
  957. id: this.queryId || "",
  958. platform_code: platform_code || "", //平台订单号
  959. po_code: po_code || "", //其他单号
  960. platform_time: platform_time || "", //平台下单时间
  961. plat_code: plat_code || "", //平台商品编号
  962. sale_source: sale_source || "", //销售渠道
  963. mode: mode || "", //收费模式
  964. contactor: contactor || "", ///收货人
  965. mobile: mobile || "", //联系电话
  966. price: price || "", //单价
  967. num: num || "", //数量
  968. before_discount_all_price: before_discount_all_price || "", //优惠前总金额
  969. activity_code: activity_code || "", //优惠活动名称
  970. order_remark: order_remark || "", //订单备注
  971. addr: addr || "", //联系地址
  972. addr_code:
  973. addr_code && addr_code.length > 0 ? addr_code.split(",") : [], //省市区
  974. };
  975. this.ruleForm.before_discount_all_price = this.accMul(
  976. this.ruleForm.num,
  977. this.ruleForm.price
  978. );
  979. if (plat_code && plat_code !== "") {
  980. await this.get_goods_active();
  981. }
  982. if (this.subGoodData.platform_code) {
  983. await this.get_source(this.subGoodData.platform_code);
  984. }
  985. },
  986. async initData() {
  987. this.sitem = null;
  988. this.loading = true;
  989. const { code, data, message } = await asyncRequest.detail({
  990. id: this.queryId,
  991. });
  992. if (code === 0) {
  993. const {
  994. status,
  995. import: simport,
  996. confirm,
  997. user_update,
  998. orderCode,
  999. creater,
  1000. addtime,
  1001. updater,
  1002. success_date,
  1003. error_msg,
  1004. platform_name,
  1005. platform_title,
  1006. } = data;
  1007. this.sitem = {
  1008. orderCode,
  1009. status,
  1010. creater,
  1011. addtime,
  1012. updater,
  1013. success_date,
  1014. status_name: this.statusActive(status),
  1015. status_type: this.statusActiveTag(status),
  1016. platform_name,
  1017. platform_title,
  1018. error_msg,
  1019. };
  1020. this.importSitem = simport ? JSON.parse(JSON.stringify(simport)) : null;
  1021. this.confirmSitem = confirm
  1022. ? JSON.parse(JSON.stringify(confirm))
  1023. : null;
  1024. this.status = status;
  1025. if (
  1026. !(this.status === "3" || this.status === "4" || this.status === "5")
  1027. ) {
  1028. console.log(12345);
  1029. this.subSitem = confirm ? JSON.parse(JSON.stringify(confirm)) : null;
  1030. } else {
  1031. this.subSitem = user_update
  1032. ? JSON.parse(JSON.stringify(user_update))
  1033. : null;
  1034. }
  1035. if (
  1036. this.confirmSitem !== null &&
  1037. this.confirmSitem.plat_code &&
  1038. this.confirmSitem.plat_code !== ""
  1039. ) {
  1040. await this.onlineData(1, this.confirmSitem.plat_code);
  1041. }
  1042. if (this.subSitem !== null) {
  1043. if (this.subSitem.plat_code && this.subSitem.plat_code !== "") {
  1044. await this.onlineData(2, this.subSitem.plat_code);
  1045. }
  1046. await this.againForm(this.subSitem);
  1047. }
  1048. this.getNewTime();
  1049. } else if (code >= 100 && code <= 104) {
  1050. await this.logout();
  1051. } else {
  1052. this.$message.warning(message);
  1053. }
  1054. this.loading = false;
  1055. },
  1056. async onlineData(type, good_code) {
  1057. this.loading = true;
  1058. const { code, data, message } = await asyncRequest.good_detail({
  1059. plat_code: good_code,
  1060. });
  1061. if (code === 0) {
  1062. if (type === 1) {
  1063. this.conGoodData = data;
  1064. } else {
  1065. this.subGoodData = data;
  1066. const { platform_name, platform_code } = data;
  1067. if (this.status !== "2") {
  1068. this.sitem.platform_name = platform_name + "客户";
  1069. }
  1070. if (platform_code) {
  1071. await this.get_source(platform_code);
  1072. }
  1073. }
  1074. } else if (code >= 100 && code <= 104) {
  1075. await this.logout();
  1076. } else {
  1077. this.$message.warning(message);
  1078. this.ruleForm.num = "0";
  1079. await this.get_new_price();
  1080. }
  1081. this.loading = false;
  1082. },
  1083. async get_source(platform_code) {
  1084. this.platform_id = platform_code;
  1085. this.coptions = [];
  1086. const { code, data, message } = await asyncRequest.sourceList({
  1087. platform_id: platform_code,
  1088. });
  1089. if (code === 0) {
  1090. this.coptions = data;
  1091. } else if (code >= 100 && code <= 104) {
  1092. await this.logout();
  1093. } else {
  1094. this.$message.warning(message);
  1095. }
  1096. if (this.coptions.length == 0) {
  1097. this.ruleForm.sale_source = "";
  1098. this.$refs.ruleForm.validateField("sale_source");
  1099. }
  1100. },
  1101. async resultList(e) {
  1102. if (e && e.length === 1) {
  1103. const { plat_code } = JSON.parse(JSON.stringify(e[0]));
  1104. this.ruleForm.plat_code = plat_code || "";
  1105. this.$refs.ruleForm.validateField("plat_code");
  1106. if (plat_code) {
  1107. await this.onlineData(2, plat_code);
  1108. } else {
  1109. this.subGoodData = null;
  1110. this.coptions = [];
  1111. this.ruleForm.num = "0";
  1112. this.ruleForm.price = "0";
  1113. this.ruleForm.sale_source = "";
  1114. this.$refs.ruleForm.validateField("num");
  1115. this.$refs.ruleForm.validateField("price");
  1116. this.$refs.ruleForm.validateField("sale_source");
  1117. }
  1118. }
  1119. },
  1120. //省市区选择
  1121. async select_area_change(e) {
  1122. this.ruleForm.addr_code = e;
  1123. this.$refs.ruleForm.validateField("addr_code");
  1124. },
  1125. async number_change(e, key) {
  1126. this.ruleForm[key] = e + "" || "0";
  1127. this.$refs.ruleForm.validateField(key);
  1128. if (key === "num") {
  1129. await this.get_new_price();
  1130. }
  1131. this.ruleForm.before_discount_all_price = this.accMul(
  1132. this.ruleForm.num,
  1133. this.ruleForm.price
  1134. );
  1135. },
  1136. async get_new_price() {
  1137. const { num, activity_code } = this.ruleForm;
  1138. if (num * 1 === 0) {
  1139. this.price_min = "0";
  1140. this.ruleForm.price = "0";
  1141. return;
  1142. } else {
  1143. const { skuCode: conSkuCode } = this.conGoodData;
  1144. const { skuCode: subSkuCode } = this.subGoodData;
  1145. let model = {
  1146. skuCode:
  1147. this.status === "3" || this.status === "4" || this.status === "5"
  1148. ? subSkuCode
  1149. : conSkuCode,
  1150. sale_num: num,
  1151. is_activity: activity_code ? "1" : "0",
  1152. act_code: activity_code ? activity_code : "",
  1153. };
  1154. if (!this.priceLoding) {
  1155. const { isok, price } = await this.set_salegetprice(model);
  1156. this.price_min = isok ? price : "0";
  1157. if (!isok) {
  1158. this.ruleForm.price = "0";
  1159. } else {
  1160. if (price * 1 >= this.ruleForm.price * 1)
  1161. this.ruleForm.price = price;
  1162. }
  1163. }
  1164. }
  1165. },
  1166. async get_goods_active() {
  1167. this.actOptions = [];
  1168. const { skuCode, companyNo, platform_code } = this.subGoodData;
  1169. let model = {
  1170. skuCode,
  1171. companyNo,
  1172. platform_id: platform_code,
  1173. };
  1174. const { code, data, message } = await asyncRequest.goods_active(model);
  1175. if (code === 0) {
  1176. const { act } = data;
  1177. this.actOptions = act;
  1178. } else if (code >= 100 && code <= 104) {
  1179. await this.logout();
  1180. } else {
  1181. this.$message.warning(message);
  1182. }
  1183. if (this.actOptions.length === 0) {
  1184. this.ruleForm.activity_code = "";
  1185. this.$refs.ruleForm.validateField("activity_code");
  1186. }
  1187. },
  1188. async resetForm() {
  1189. // 重置
  1190. await this.$nextTick(() => {
  1191. if (this.$refs.ruleForm) {
  1192. this.$refs.ruleForm.resetFields();
  1193. this.$refs.ruleForm.clearValidate();
  1194. this.ruleForm = ruleForm;
  1195. }
  1196. });
  1197. },
  1198. async submitForm() {
  1199. await this.$refs.ruleForm.validate(async (valid) => {
  1200. if (valid) {
  1201. if (this.loading) {
  1202. return;
  1203. }
  1204. this.loading = true;
  1205. let model = JSON.parse(JSON.stringify(this.ruleForm));
  1206. model.platform_id = this.platform_id;
  1207. const { code, data, message } = await asyncRequest.update(model);
  1208. this.loading = false;
  1209. if (code === 0) {
  1210. this.$notify.success({
  1211. title: "提交成功!",
  1212. message: "",
  1213. });
  1214. this.initForm();
  1215. } else if (code >= 100 && code <= 104) {
  1216. await this.logout();
  1217. } else {
  1218. this.$message.warning(message);
  1219. }
  1220. } else {
  1221. console.log("error submit!!");
  1222. return false;
  1223. }
  1224. });
  1225. },
  1226. accMul(arg1, arg2) {
  1227. var m = 0,
  1228. s1 = arg1.toString(),
  1229. s2 = arg2.toString();
  1230. try {
  1231. m += s1.split(".")[1].length;
  1232. } catch (e) {}
  1233. try {
  1234. m += s2.split(".")[1].length;
  1235. } catch (e) {}
  1236. return (
  1237. (Number(s1.replace(".", "")) * Number(s2.replace(".", ""))) /
  1238. Math.pow(10, m)
  1239. );
  1240. },
  1241. async set_salegetprice(model) {
  1242. this.priceLoding = true;
  1243. let resModel = {
  1244. isok: true,
  1245. price: "0",
  1246. };
  1247. // console.log(model);
  1248. let { code, message, data } = await asyncRequest.salegetprice(model);
  1249. if (code === 0) {
  1250. const { sale_price } = data;
  1251. resModel.price = sale_price + "";
  1252. } else if (code >= 100 && code <= 104) {
  1253. await this.logout();
  1254. } else {
  1255. this.$message.warning(message);
  1256. resModel.isok = false;
  1257. }
  1258. this.priceLoding = false;
  1259. return resModel;
  1260. },
  1261. getNewTime() {
  1262. this.newTime = new Date().valueOf();
  1263. },
  1264. },
  1265. };
  1266. </script>
  1267. <style lang="scss" scoped>
  1268. .orderConfirm {
  1269. font-size: 13px;
  1270. color: #909399 !important;
  1271. line-height: 26px;
  1272. .tab-row {
  1273. border-left: 1px solid #ebeef5;
  1274. border-top: 1px solid #ebeef5;
  1275. display: flex;
  1276. align-items: stretch;
  1277. &:last-child {
  1278. border-bottom: 1px solid #ebeef5;
  1279. }
  1280. .tab-item-label {
  1281. padding: 4px 5px;
  1282. width: 125px;
  1283. .red {
  1284. color: red;
  1285. padding: 0 5px 0 0;
  1286. }
  1287. }
  1288. .tab-item-main {
  1289. width: calc(100% - 125px);
  1290. border-left: 1px solid #ebeef5;
  1291. .tab-title {
  1292. display: flex;
  1293. align-items: stretch;
  1294. .el-col {
  1295. padding: 3px 5px;
  1296. border-right: 1px solid #ebeef5;
  1297. &.nop {
  1298. padding: 0;
  1299. }
  1300. &.border {
  1301. border: 0;
  1302. }
  1303. }
  1304. }
  1305. }
  1306. }
  1307. }
  1308. </style>