info.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850
  1. <template>
  2. <div class="BidSystemDeepeningOrderDetail">
  3. <Toptitle title="深化单详情">
  4. <slot name="titleButton">
  5. <!-- <Button
  6. @click="handleFinish()"
  7. type="primary"
  8. style="margin-right: 10px"
  9. >完成</Button
  10. > -->
  11. <Upload
  12. style="display: inline"
  13. name="your_file"
  14. :show-upload-list="false"
  15. :headers="headers"
  16. :on-error="uploadError"
  17. :on-success="uploadSuccess"
  18. :action="$store.state.ip + '/api/order_area_product_import'"
  19. >
  20. <Button type="primary" style="margin-right: 10px">导入</Button>
  21. </Upload>
  22. <Button
  23. @click="showSupModal = true"
  24. type="primary"
  25. style="margin-right: 10px"
  26. >项目辅料</Button
  27. >
  28. <Button
  29. @click="handleOpenModal"
  30. type="primary"
  31. style="margin-right: 10px"
  32. >批量下拆单</Button
  33. >
  34. <Button
  35. @click="goback()"
  36. type="primary"
  37. ghost
  38. style="margin-right: 10px"
  39. >返回</Button
  40. >
  41. </slot>
  42. </Toptitle>
  43. <Tabs value="name1" @on-click="handleCurTabChange">
  44. <TabPane
  45. label="块状形式"
  46. name="name1"
  47. style="overflow: hidden; overflow-y: auto"
  48. >
  49. <div class="top_search_name1">
  50. <div>
  51. <span>订单号:</span
  52. ><span style="font-weight:bold">{{ formData.order_no }}</span>
  53. </div>
  54. <div>
  55. <span>项目名称:</span
  56. ><span style="font-weight:bold">{{
  57. formData.residential_name
  58. }}</span>
  59. </div>
  60. <div>
  61. <span>客户姓名:</span
  62. ><span style="font-weight:bold">{{ formData.client_name }}</span>
  63. </div>
  64. <div>
  65. <span>紧急程度:</span
  66. ><span
  67. v-for="_item in warningList"
  68. :key="_item.id"
  69. v-show="_item.id == formData.warning_state"
  70. :style="{ color: _item.color }"
  71. style="font-weight:bold"
  72. >{{ _item.title }}</span
  73. >
  74. </div>
  75. <div>
  76. <span>收款:</span
  77. ><span style="font-weight:bold">{{
  78. formData.pay_state == 1 ? "已收款" : "未收款"
  79. }}</span>
  80. </div>
  81. <div>
  82. <span>详细地址:</span
  83. ><span style="font-weight:bold">{{ formData.address }}</span>
  84. </div>
  85. <div>
  86. <span>手机号:</span
  87. ><span style="font-weight:bold">{{ formData.mobile }}</span>
  88. </div>
  89. <div>
  90. <span>开始日期:</span
  91. ><span style="font-weight:bold">{{
  92. func.replaceDateNoHMS(formData.start_time)
  93. }}</span>
  94. </div>
  95. <div>
  96. <span>交付日期:</span
  97. ><span style="font-weight:bold">{{
  98. func.replaceDateNoHMS(formData.end_time)
  99. }}</span>
  100. </div>
  101. <div>
  102. <span>业务员:</span>
  103. <span
  104. v-for="item in salesmanList"
  105. :key="item.id"
  106. v-show="formData.salesman == item.id"
  107. style="font-weight:bold"
  108. >{{ item.nickname }}</span
  109. >
  110. </div>
  111. <div>
  112. <span>订单类型:</span
  113. ><span style="font-weight:bold">{{
  114. formData.renovation_type == 1 ? "工装" : "家装"
  115. }}</span>
  116. </div>
  117. <div v-for="item in formData.special" :key="item.id">
  118. <span>{{ item.key + ":" }}</span>
  119. <span style="font-weight:bold">{{ item.value }}</span>
  120. </div>
  121. <div>
  122. <span>备注:</span
  123. ><span style="font-weight:bold">{{ formData.remark }}</span>
  124. </div>
  125. </div>
  126. <div
  127. class="table-data"
  128. v-for="(item, index) in formData.list"
  129. :key="item.id"
  130. >
  131. <div class="addBtn">
  132. <Button
  133. @click="handleShowCurrencyArea(item, index)"
  134. ghost
  135. size="small"
  136. v-show="type != 1 && item.id && !item.isCurrencyArea"
  137. type="primary"
  138. >展示产品
  139. </Button>
  140. <Button
  141. @click="handleOpenModal"
  142. ghost
  143. size="small"
  144. v-show="!(type != 1 && item.id && !item.isCurrencyArea)"
  145. type="primary"
  146. >下拆单
  147. </Button>
  148. </div>
  149. <div class="addAreaForm">
  150. <div class="addFormInfo">
  151. <div><span>区域编码:</span>{{ item.num }}</div>
  152. <div><span>区域名称:</span>{{ item.title }}</div>
  153. <div><span>单位:</span>{{ item.unit }}</div>
  154. <div><span>工程量:</span>{{ item.quantity }}</div>
  155. <div><span>户型:</span>{{ item.house_type }}</div>
  156. <div v-for="ele in item.special" :key="ele.id">
  157. <span>{{ ele.key }}:</span>{{ ele.value }}
  158. </div>
  159. <div><span>备注:</span>{{ item.remark }}</div>
  160. </div>
  161. <div class="addAreaTable">
  162. <Table
  163. :columns="tableColumns"
  164. v-show="item.product && item.product.length > 0"
  165. max-height="500"
  166. :data="item.product"
  167. @on-selection-change="handleSelection"
  168. border
  169. >
  170. <template slot="urlSet" slot-scope="{ row }">
  171. <span
  172. class="urlSetStyle"
  173. v-for="(item, index) in row.url"
  174. :key="index"
  175. >
  176. <img
  177. :src="$store.state.ip + item"
  178. @click="(e) => handleImgClick(e, row)"
  179. alt=""
  180. />
  181. </span>
  182. </template>
  183. <template slot="statusSlot" slot-scope="{ row }">
  184. {{ row.status == 1 ? "已完成" : "未完成" }}
  185. </template>
  186. <template slot="set" slot-scope="{ row, index }">
  187. <a
  188. style="margin: 0 5px"
  189. @click="handleSet(row, index, 2, item)"
  190. >详情</a
  191. >
  192. </template>
  193. </Table>
  194. </div>
  195. </div>
  196. </div>
  197. </TabPane>
  198. <TabPane
  199. label="列表形式"
  200. name="name2"
  201. style="overflow: hidden; overflow-y: auto"
  202. >
  203. <div class="top_search">
  204. <div class="top_search_content">
  205. <Form
  206. :model="searchData"
  207. :label-width="100"
  208. class="top_search_form"
  209. >
  210. <FormItem label="区域编码:">
  211. <Select
  212. filterable
  213. clearable
  214. v-model="searchData.area_no"
  215. size="small"
  216. style="width:120px"
  217. >
  218. <Option
  219. v-for="(_item, _index) in area_no_list"
  220. :key="_index"
  221. :label="_item"
  222. :value="_item"
  223. ></Option>
  224. </Select>
  225. </FormItem>
  226. <FormItem label="区域名称:">
  227. <Select
  228. filterable
  229. clearable
  230. v-model="searchData.area_title"
  231. size="small"
  232. style="width:120px"
  233. >
  234. <Option
  235. v-for="(_item, _index) in area_title_list"
  236. :key="_index"
  237. :label="_item"
  238. :value="_item"
  239. ></Option>
  240. </Select>
  241. </FormItem>
  242. <FormItem label="产品名称:">
  243. <Select
  244. filterable
  245. clearable
  246. v-model="searchData.product_title"
  247. size="small"
  248. style="width:120px"
  249. >
  250. <Option
  251. v-for="(_item, _index) in product_title_list"
  252. :key="_index"
  253. :label="_item"
  254. :value="_item"
  255. ></Option>
  256. </Select>
  257. </FormItem>
  258. <FormItem label="图号:">
  259. <Select
  260. filterable
  261. clearable
  262. v-model="searchData.url_number"
  263. size="small"
  264. style="width:120px"
  265. >
  266. <Option
  267. v-for="(_item, _index) in url_number_list"
  268. :key="_index"
  269. :label="_item"
  270. :value="_item"
  271. ></Option>
  272. </Select>
  273. </FormItem>
  274. <FormItem label="是否完成:">
  275. <Select
  276. clearable
  277. v-model="searchData.status"
  278. size="small"
  279. style="width:120px"
  280. >
  281. <Option label="是" :value="1"></Option>
  282. <Option label="否" :value="0"></Option>
  283. </Select>
  284. </FormItem>
  285. <FormItem label="是否下拆单:">
  286. <Select
  287. clearable
  288. v-model="searchData.sub_state"
  289. size="small"
  290. style="width:120px"
  291. >
  292. <Option label="是" :value="2"></Option>
  293. <Option label="否" :value="1"></Option>
  294. </Select>
  295. </FormItem>
  296. <FormItem>
  297. <Button @click="getListData" type="primary" size="small"
  298. >搜索</Button
  299. >
  300. </FormItem>
  301. </Form>
  302. </div>
  303. <Form :model="formData" :label-width="100" class="top_search_form">
  304. <FormItem label="订单号:">
  305. {{ formData.order_no }}
  306. </FormItem>
  307. <FormItem label="项目名称:">
  308. {{ formData.residential_name }}
  309. </FormItem>
  310. <FormItem label="客户姓名:">
  311. {{ formData.client_name }}
  312. </FormItem>
  313. <FormItem label="紧急程度:">
  314. <span
  315. v-for="_item in warningList"
  316. :key="_item.id"
  317. v-show="_item.id == formData.warning_state"
  318. :style="{ color: _item.color }"
  319. >{{ _item.title }}
  320. </span>
  321. </FormItem>
  322. <FormItem label="项目定金:">
  323. {{ formData.front_money }}
  324. <!-- <RadioGroup v-model="formData.pay_state"
  325. size="small">
  326. <Radio :label=0
  327. :disabled="isChecked">未收款</Radio>
  328. <Radio :label=1
  329. :disabled="isChecked">已收款</Radio>
  330. </RadioGroup> -->
  331. </FormItem>
  332. <FormItem label="详细地址:">
  333. {{ formData.address }}
  334. </FormItem>
  335. <FormItem label="手机号:">
  336. {{ formData.mobile }}
  337. </FormItem>
  338. <FormItem label="开始日期:">
  339. {{
  340. formData.start_time
  341. ? func.replaceDateNoHMS(formData.start_time)
  342. : ""
  343. }}
  344. </FormItem>
  345. <FormItem label="结束日期:">
  346. {{
  347. formData.end_time
  348. ? func.replaceDateNoHMS(formData.end_time)
  349. : ""
  350. }}
  351. </FormItem>
  352. <FormItem label="业务员:">
  353. <span
  354. v-for="_item in salesmanList"
  355. :key="_item.id"
  356. v-show="_item.id == formData.salesman"
  357. :style="{ color: _item.color }"
  358. >{{ _item.nickname }}
  359. </span>
  360. </FormItem>
  361. <!-- <FormItem label="订单类型:">
  362. <Select v-model="formData.type"
  363. :disabled="isChecked"
  364. size="small"
  365. style="width:200px">
  366. <Option label='工装'
  367. :value=1></Option>
  368. <Option label='家装'
  369. :value=2></Option>
  370. </Select>
  371. </FormItem> -->
  372. <FormItem
  373. v-for="item in formData.special"
  374. :key="item.id"
  375. :label="item.key + ':'"
  376. >
  377. {{ item.value }}
  378. </FormItem>
  379. <FormItem label="备注:">
  380. {{ formData.remark }}
  381. </FormItem>
  382. </Form>
  383. </div>
  384. <div>
  385. <Table
  386. :columns="listTableColumns"
  387. :data="listTableData"
  388. @on-selection-change="handleSelection"
  389. :max-height="500"
  390. border
  391. >
  392. <template slot="statusSlot" slot-scope="{ row }">
  393. {{ row.status == 1 ? "已完成" : "未完成" }}
  394. </template>
  395. <template slot="set" slot-scope="{ row, index }">
  396. <a
  397. style="margin: 0 5px"
  398. @click="handleSet(row, index, 4, formData)"
  399. >详情</a
  400. >
  401. </template>
  402. </Table>
  403. </div>
  404. <div ref="footercenter" class="footer-center">
  405. <Page
  406. :total="total"
  407. :current.sync="page_index"
  408. :show-total="true"
  409. :page-size="page_size"
  410. :show-sizer="true"
  411. :show-elevator="true"
  412. @on-change="changePage"
  413. @on-page-size-change="changeSize"
  414. >
  415. </Page>
  416. </div>
  417. </TabPane>
  418. </Tabs>
  419. <!-- 项目辅料弹窗 -->
  420. <Modal title="项目辅料" v-model="showSupModal" :width="400">
  421. <div>
  422. <div class="supModalBtn">
  423. <!-- <Button @click="handleAddSup" type="primary">新增</Button> -->
  424. </div>
  425. <Table :columns="supTableColumns" :data="supTableData" border>
  426. <template slot="combine" slot-scope="{ index }">
  427. <span
  428. v-for="_item in combineList"
  429. :key="_item.id"
  430. v-show="_item.id == supTableData[index].id"
  431. >{{ _item.title }}</span
  432. >
  433. <!-- <Select
  434. v-model="supTableData[index].id"
  435. disabled
  436. size="small"
  437. >
  438. <Option
  439. v-for="item in combineList"
  440. :value="item.id"
  441. :key="item.id"
  442. :label="item.title"
  443. ></Option>
  444. </Select> -->
  445. </template>
  446. <!-- <template slot="supSet" slot-scope="{ row, index }">
  447. <a
  448. style="margin: 0 5px; color: red"
  449. @click="handleSupSet(row, index)"
  450. >删除</a
  451. >
  452. </template> -->
  453. </Table>
  454. </div>
  455. <div class="modal-footer" slot="footer">
  456. <!-- <Button @click="showSupModal = false">取消</Button> -->
  457. <Button type="primary" @click="showSupModal = false">确认</Button>
  458. </div>
  459. </Modal>
  460. <!-- 新增产品弹窗 -->
  461. <Modal
  462. title="新增产品"
  463. v-model="showPDTModal"
  464. :mask-closable="false"
  465. class="addPDTFormModal"
  466. :width="1000"
  467. >
  468. <div
  469. class="addPDTForm"
  470. v-for="(item, index) in tempPDTList"
  471. :key="item.id"
  472. >
  473. <Form :label-width="100" :model="item">
  474. <FormItem label="产品名称:">
  475. <Input
  476. type="text"
  477. size="small"
  478. placeholder="请输入"
  479. v-model="item.title"
  480. style="width: 120px"
  481. />
  482. </FormItem>
  483. <FormItem label="数量">
  484. <Input
  485. type="text"
  486. size="small"
  487. v-model="item.num"
  488. placeholder="请输入"
  489. style="width: 120px"
  490. />
  491. </FormItem>
  492. <FormItem label="图号:">
  493. <Input
  494. type="text"
  495. size="small"
  496. placeholder="请输入"
  497. v-model="item.url_number"
  498. style="width: 120px"
  499. />
  500. </FormItem>
  501. <FormItem label="图纸">
  502. <div class="product-img">
  503. <div class="product-add">
  504. <div
  505. class="items"
  506. v-for="(_item, _index) of item.url"
  507. :key="_index"
  508. >
  509. <img
  510. @click="looks(_item)"
  511. :src="$store.state.ip + _item"
  512. alt=""
  513. />
  514. <Icon
  515. size="20"
  516. @click="delItems(_index, item.url)"
  517. class="delete-img"
  518. type="ios-close-circle"
  519. />
  520. </div>
  521. <div class="add-items">
  522. <div class="_item">
  523. <Icon size="50" type="ios-add" />
  524. </div>
  525. <input
  526. @change="changeIpt($event, item.url)"
  527. type="file"
  528. class="ipt"
  529. />
  530. </div>
  531. </div>
  532. </div>
  533. </FormItem>
  534. <FormItem label="产品分类">
  535. <Select
  536. v-model="item.type_id"
  537. placeholder="请选择"
  538. style="width: 120px"
  539. label-in-value
  540. @on-change="(e) => hanndleAddPDTTypeChange(item, e)"
  541. size="small"
  542. >
  543. <Option
  544. v-for="item in PDTTypeList"
  545. :value="item.value"
  546. :key="item.value"
  547. >{{ item.label }}</Option
  548. >
  549. </Select>
  550. </FormItem>
  551. <div
  552. style="display: contents"
  553. v-for="el in item.tempPDTTypeList"
  554. :key="el"
  555. >
  556. <FormItem
  557. :label="_item.title"
  558. v-for="_item in item.tempMeasureList"
  559. v-show="el == _item.id"
  560. :key="_item.id"
  561. >
  562. <Input
  563. type="text"
  564. size="small"
  565. v-model="_item.value"
  566. placeholder="请输入"
  567. style="width: 120px"
  568. />
  569. </FormItem>
  570. </div>
  571. <FormItem label="价格:">
  572. <Input
  573. type="text"
  574. size="small"
  575. v-model="item.price"
  576. placeholder="请输入备注"
  577. style="width: 120px"
  578. />
  579. </FormItem>
  580. <FormItem label="备注:">
  581. <Input
  582. type="text"
  583. size="small"
  584. v-model="item.remark"
  585. placeholder="请输入备注"
  586. style="width: 120px"
  587. />
  588. </FormItem>
  589. <FormItem label="工艺属性">
  590. <Button
  591. @click="handleProcessAdd(item, index)"
  592. size="small"
  593. type="text"
  594. style="color: #57a3f3"
  595. >添加属性</Button
  596. >
  597. </FormItem>
  598. </Form>
  599. <div class="addPDTProcess">
  600. <div
  601. v-for="(_item, _index) in item.addPDTProcessAttrList"
  602. :key="_item.id"
  603. >
  604. <span>属性{{ _index + 1 }}</span>
  605. <Select
  606. :value="_item.id"
  607. size="small"
  608. @on-change="
  609. (value) => handleAddPDTAttrChange(_item, _index, value)
  610. "
  611. style="width: 80px"
  612. >
  613. <Option
  614. v-for="__item in PDTProcessAttrList"
  615. :key="__item.id"
  616. :value="__item.id"
  617. :label="__item.title"
  618. >
  619. </Option>
  620. </Select>
  621. <Select
  622. :value="_item.type_id"
  623. filterable
  624. clearable
  625. label-in-value
  626. @on-change="
  627. (value) => handleAddPDTAttrDetailChange(_item, _index, value)
  628. "
  629. size="small"
  630. style="width: 80px"
  631. >
  632. <Option
  633. v-for="__item in _item.PDTProcessAttrDetailList"
  634. :key="__item.id"
  635. :value="__item.id"
  636. :label="__item.title"
  637. />
  638. </Select>
  639. <div class="dele_icon">
  640. <Icon
  641. v-show="item.addPDTProcessAttrList.length != 1"
  642. type="ios-trash"
  643. @click="
  644. handleAddPDTDetailDele(item.addPDTProcessAttrList, _index)
  645. "
  646. />
  647. </div>
  648. </div>
  649. </div>
  650. <div class="addPDTBtn">
  651. <Button
  652. type="primary"
  653. v-show="false"
  654. style="margin-right: 10px"
  655. @click="handleAddPDTCopy(item, index)"
  656. >复制</Button
  657. >
  658. <Button
  659. type="primary"
  660. v-show="false"
  661. style="margin-right: 10px"
  662. @click="handleAddPDTAdd(index)"
  663. >添加</Button
  664. >
  665. <Button
  666. type="error"
  667. v-show="false"
  668. style="margin-right: 10px"
  669. @click="handleAddPDTDele(index)"
  670. >删除</Button
  671. >
  672. </div>
  673. </div>
  674. <div class="modal-footer" slot="footer">
  675. <Button @click="showPDTModal = false">取消</Button>
  676. <Button type="primary" @click="handleAddPDTConfirm">确认</Button>
  677. </div>
  678. </Modal>
  679. <!-- 批量下拆单 -->
  680. <Modal
  681. v-model="processModal"
  682. title="下拆单"
  683. @on-ok="handleProcess"
  684. @on-cancel="processModal = false"
  685. >
  686. <div>
  687. <div class="process_modal">
  688. <span>拆单人员:</span>
  689. <Select v-model="process_man" style="width: 150px">
  690. <Option
  691. v-for="item in processManList"
  692. :key="item.id"
  693. :label="item.nickname"
  694. :value="item.id"
  695. ></Option>
  696. </Select>
  697. </div>
  698. <div class="process_modal">
  699. <span>选择时间:</span>
  700. <DatePicker
  701. type="date"
  702. v-model="process_start_time"
  703. placeholder="年/月/日"
  704. style="width: 150px"
  705. ></DatePicker>
  706. <DatePicker
  707. type="date"
  708. v-model="process_end_time"
  709. placeholder="年/月/日"
  710. style="width: 150px"
  711. ></DatePicker>
  712. </div>
  713. </div>
  714. </Modal>
  715. </div>
  716. </template>
  717. <script>
  718. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  719. // 例如:import 《组件名称》 from '《组件路径》';
  720. import UploadImg from "./uploadImg/index.vue";
  721. export default {
  722. name: "",
  723. components: {
  724. UploadImg,
  725. },
  726. props: {},
  727. // import引入的组件需要注入到对象中才能使用
  728. data() {
  729. // 这里存放数据
  730. return {
  731. headers: { Authorization: localStorage.getItem("token") },
  732. salesmanList: [],
  733. PDTTypeList: [],
  734. combineList: [],
  735. tempPDTList: [
  736. {
  737. url: [],
  738. process_property: "",
  739. process_properties: [],
  740. tempPDTTypeList: [],
  741. measure: "",
  742. //新增产品工艺属性列表
  743. addPDTProcessAttrList: [
  744. {
  745. showValue: "",
  746. showId: "",
  747. PDTProcessAttrDetailList: [],
  748. },
  749. ],
  750. },
  751. ],
  752. supTableData: [],
  753. showPDTModal: false,
  754. showSupModal: false,
  755. formData: {
  756. order_no: "",
  757. residential_name: "",
  758. client_name: "",
  759. address: "",
  760. mobile: "",
  761. pay_state: "",
  762. warning_state: "",
  763. salesman: "",
  764. remark: "",
  765. start_time: "",
  766. end_time: "",
  767. type: "",
  768. //区域列表
  769. list: [
  770. {
  771. areaIndex: 1,
  772. num: "",
  773. title: "",
  774. unit: "",
  775. quantity: "",
  776. house_type: "",
  777. remark: "",
  778. order_no: "",
  779. product: [
  780. // {
  781. // title:'',
  782. // num:'',
  783. // measure:'',
  784. // process_property:'',
  785. // url:'',
  786. // url_number:'',
  787. // remark:''
  788. // }
  789. ],
  790. },
  791. // {
  792. // areaIndex: 2,
  793. // num: '',
  794. // title: '',
  795. // unit: '',
  796. // quantity: '',
  797. // house_type: '',
  798. // remark: '',
  799. // order_no: '',
  800. // product: []
  801. // },
  802. ],
  803. },
  804. tableColumns: [
  805. { type: "selection", align: "center", minWidth: 60 },
  806. { title: "序号", key: "index", align: "center", minWidth: 80 },
  807. { title: "产品名称", key: "title", align: "center", minWidth: 140 },
  808. { title: "数量", key: "num", align: "center", minWidth: 80 },
  809. { title: "价格", key: "price", align: "center", minWidth: 80 },
  810. { title: "规格", key: "measure", align: "center", minWidth: 140 },
  811. {
  812. title: "工艺属性",
  813. key: "process_property",
  814. align: "center",
  815. minWidth: 140,
  816. tooltip: true,
  817. },
  818. {
  819. title: "图纸",
  820. align: "center",
  821. key: "url",
  822. minWidth: 80,
  823. slot: "urlSet",
  824. },
  825. // { title: "左右式", key: "url_number", align: "center", minWidth: 90 },
  826. { title: "图号", key: "url_number", align: "center", minWidth: 90 },
  827. // { title: '型号', key: 'model', align: 'center', minWidth: 80 },
  828. { title: "备注", key: "remark", align: "center", minWidth: 80 },
  829. {
  830. title: "状态",
  831. key: "status",
  832. align: "center",
  833. minWidth: 80,
  834. slot: "statusSlot",
  835. },
  836. {
  837. title: "操作",
  838. key: "remark",
  839. align: "center",
  840. width: "120",
  841. slot: "set",
  842. }
  843. ],
  844. productDetail: {},
  845. supTableColumns: [
  846. { title: "序号", type: "index", align: "center" },
  847. {
  848. title: "辅料名称",
  849. key: "title",
  850. align: "center",
  851. slot: "combine",
  852. minWidth: 60,
  853. },
  854. { title: "操作", key: "set", align: "center", slot: "supSet" },
  855. ],
  856. listTableColumns: [
  857. { type: "selection", align: "center", minWidth: 100 },
  858. { title: "区域编码", key: "area_num", align: "center", minWidth: 100 },
  859. {
  860. title: "区域名称",
  861. key: "area_title",
  862. align: "center",
  863. minWidth: 100,
  864. },
  865. { title: "单位", key: "area_unit", align: "center", minWidth: 100 },
  866. {
  867. title: "工程量",
  868. key: "area_quantity",
  869. align: "center",
  870. minWidth: 100,
  871. },
  872. { title: "户型", key: "house_type", align: "center", minWidth: 100 },
  873. { title: "备注", key: "remark", align: "center", minWidth: 100 },
  874. { title: "产品名称", key: "title", align: "center", minWidth: 100 },
  875. { title: "数量", key: "num", align: "center", minWidth: 100 },
  876. { title: "价格", key: "price", align: "center", minWidth: 100 },
  877. { title: "规格", key: "measure", align: "center", minWidth: 100 },
  878. {
  879. title: "工艺属性",
  880. key: "process_property",
  881. align: "center",
  882. minWidth: 100,
  883. },
  884. {
  885. title: "图纸",
  886. key: "url",
  887. align: "center",
  888. minWidth: 100,
  889. render: (h, params) => {
  890. const { row } = params;
  891. let url = row.url ? row.url : [];
  892. return h("img", {
  893. attrs: {
  894. src: this.$store.state.ip + url[0],
  895. style:
  896. "max-width:50px;max-height:50px;position:relative;top:3px;",
  897. },
  898. on: {
  899. click: (e) => {
  900. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  901. // row.imgs = res.data
  902. let list = [];
  903. row.url.forEach((el) => {
  904. list.push({ img_url: el });
  905. });
  906. this.$previewImg({
  907. list,
  908. baseUrl: this.$store.state.ip,
  909. baseImgField: "img_url",
  910. baseTitleField: "",
  911. });
  912. // })
  913. },
  914. },
  915. });
  916. },
  917. },
  918. {
  919. title: "左右式",
  920. key: "left_right_mode",
  921. align: "center",
  922. minWidth: 100,
  923. render: (h, params) => {
  924. return h(
  925. "span",
  926. {},
  927. params.row.left_right_mode == 1
  928. ? "左式"
  929. : params.row.left_right_mode == 2
  930. ? "右式"
  931. : "无"
  932. );
  933. },
  934. },
  935. { title: "图号", key: "url_number", align: "center", minWidth: 100 },
  936. { title: "备注", key: "remark", align: "center", minWidth: 100 },
  937. {
  938. title: "状态",
  939. key: "status",
  940. align: "center",
  941. minWidth: 80,
  942. slot: "statusSlot",
  943. },
  944. {
  945. title: "操作",
  946. key: "remark",
  947. align: "center",
  948. width: "120",
  949. slot: "set",
  950. },
  951. ],
  952. listTableData: [],
  953. //是否查看
  954. isChecked: false,
  955. PDTProcessAttrList: [],
  956. // 测量字段列表
  957. measureList: [],
  958. order_area_id: "",
  959. uploadData: {
  960. order_no: this.$route.query.order_no,
  961. title: "",
  962. },
  963. contactSpecValueList: [{ key: "", value: "" }],
  964. areaSpecValueList: [{ key: "", value: "" }],
  965. productSpecValueList: [{ key: "", value: "" }],
  966. processManList: [],
  967. process_man: "",
  968. process_start_time: "",
  969. process_end_time: "",
  970. warningList: [],
  971. selected: [],
  972. processModal: false,
  973. currencyTab: "",
  974. type: this.$route.query.type,
  975. page_index: 1,
  976. page_size: 10,
  977. total: 0,
  978. searchData: {},
  979. area_no_list: [],
  980. area_title_list: [],
  981. product_title_list: [],
  982. url_number_list: [],
  983. oa_id: this.$route.query.oa_id || "",
  984. };
  985. },
  986. // 生命周期 - 创建完成(可以访问当前this实例)
  987. created() {
  988. //2编辑 3详情 4变更 5变更记录
  989. this.$route.query.type == 3 ? (this.isChecked = true) : "";
  990. this.$route.query.order_no
  991. ? (this.formData.order_no = this.$route.query.order_no)
  992. : "";
  993. // 获取工艺属性
  994. this.axios("/api/basics_properties_index").then((res) => {
  995. this.PDTProcessAttrList = res.data.data;
  996. });
  997. // 获取组合管理
  998. this.axios("/api/material_combination").then((res) => {
  999. this.combineList = res.data.data;
  1000. });
  1001. // 获取紧急程度
  1002. this.axios.get("/api/warning_list").then((res) => {
  1003. this.warningList = res.data.data;
  1004. });
  1005. },
  1006. // 生命周期 - 挂载完成(可以访问DOM元素)
  1007. mounted() {
  1008. this.axios("/api/user").then(
  1009. (res) => (
  1010. (this.salesmanList = res.data.data),
  1011. (this.processManList = res.data.data)
  1012. )
  1013. );
  1014. this.axios("/api/parts_product_list").then((res) => {
  1015. this.PDTTypeList = res.data;
  1016. this.PDTTypeList.forEach((el) => {
  1017. el.value = el.id;
  1018. el.label = el.title;
  1019. });
  1020. });
  1021. //获取基础测量字段列表
  1022. this.axios("/api/basics_measure_index").then((res) => {
  1023. this.measureList = res.data.data;
  1024. });
  1025. this.initData(this.formData.order_no, this.oa_id);
  1026. },
  1027. methods: {
  1028. async handleBeforeUpload(row) {
  1029. // row.name
  1030. console.log("row :>> ", row);
  1031. this.uploadData.title = row.name.substring(0, row.name.indexOf("."));
  1032. return true;
  1033. },
  1034. onProgress(e) {
  1035. console.log(e);
  1036. },
  1037. initData(order_no, oa_id) {
  1038. this.axios({
  1039. method: "get",
  1040. url: "/api/order_area_list",
  1041. params: {
  1042. order_no,
  1043. type: 2,
  1044. oa_id,
  1045. },
  1046. }).then((res) => {
  1047. this.formData = res.data;
  1048. this.supTableData = res.data.ext;
  1049. // 产品特殊字段→ 弹窗窗口,table表头
  1050. let arr = [];
  1051. res.data.head[3] &&
  1052. res.data.head[3].length > 0 &&
  1053. res.data.head[3].forEach((item) => {
  1054. arr.push({
  1055. title: item.key,
  1056. key: item.key,
  1057. align: "center",
  1058. minWidth: 80,
  1059. });
  1060. });
  1061. this.tableColumns = [
  1062. { type: "selection", align: "center", minWidth: 60 },
  1063. { title: "序号", key: "index", align: "center", minWidth: 80 },
  1064. {
  1065. title: "产品名称",
  1066. key: "title",
  1067. align: "center",
  1068. tooltip: true,
  1069. minWidth: 100,
  1070. },
  1071. { title: "数量", key: "num", align: "center", minWidth: 80 },
  1072. { title: "价格", key: "price", align: "center", minWidth: 80 },
  1073. {
  1074. title: "规格",
  1075. key: "measure",
  1076. align: "center",
  1077. tooltip: true,
  1078. minWidth: 140,
  1079. },
  1080. {
  1081. title: "工艺属性",
  1082. key: "process_property",
  1083. align: "center",
  1084. tooltip: true,
  1085. minWidth: 120,
  1086. },
  1087. {
  1088. title: "图纸",
  1089. align: "center",
  1090. key: "url",
  1091. minWidth: 100,
  1092. render: (h, params) => {
  1093. const { row } = params;
  1094. let url = row.url ? row.url : [];
  1095. return h("img", {
  1096. attrs: {
  1097. src: this.$store.state.ip + url[0],
  1098. style:
  1099. "max-width:50px;max-height:50px;position:relative;top:3px;",
  1100. },
  1101. on: {
  1102. click: (e) => {
  1103. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  1104. // row.imgs = res.data
  1105. let list = [];
  1106. row.url.forEach((el) => {
  1107. list.push({ img_url: el });
  1108. });
  1109. this.$previewImg({
  1110. list,
  1111. baseUrl: this.$store.state.ip,
  1112. baseImgField: "img_url",
  1113. baseTitleField: "",
  1114. });
  1115. // })
  1116. },
  1117. },
  1118. });
  1119. },
  1120. },
  1121. {
  1122. title: "图号",
  1123. key: "url_number",
  1124. align: "center",
  1125. tooltip: true,
  1126. minWidth: 80,
  1127. },
  1128. ...arr,
  1129. { title: "备注", key: "remark", align: "center", minWidth: 80 },
  1130. {
  1131. title: "状态",
  1132. key: "status",
  1133. align: "center",
  1134. minWidth: 80,
  1135. slot: "statusSlot",
  1136. },
  1137. {
  1138. title: "操作",
  1139. key: "remark",
  1140. align: "center",
  1141. slot: "set",
  1142. minWidth: 120,
  1143. },
  1144. ];
  1145. // 订单特殊字段
  1146. this.formData.special &&
  1147. this.formData.special.length > 0 &&
  1148. this.formData.special.forEach((element) => {
  1149. this.formData.head[1].forEach((item) => {
  1150. if (element.head_id == item.id) {
  1151. element = Object.assign(element, item);
  1152. this.contactSpecValueList.push(element);
  1153. }
  1154. });
  1155. });
  1156. this.contactForm = this.formData.head[1] ? this.formData.head[1] : [];
  1157. // 区域特殊字段
  1158. this.formData.list.forEach((element, index) => {
  1159. element.special &&
  1160. element.special.length > 0 &&
  1161. element.special.forEach((ele) => {
  1162. this.formData.head[2].forEach((item) => {
  1163. if (ele.head_id == item.id) {
  1164. ele = Object.assign(ele, item);
  1165. }
  1166. });
  1167. });
  1168. // if (index == 0) {
  1169. // element.isCurrencyArea = true;
  1170. // //编辑进入页面是展示第一条区域的产品
  1171. // element.id &&
  1172. // this.axios
  1173. // .get("/api/order_area_list_product", {
  1174. // params: {
  1175. // order_no: this.$route.query.order_no,
  1176. // area_id: element.id,type:1
  1177. // },
  1178. // })
  1179. // .then((res) => {
  1180. // if (res.code == 200) {
  1181. // if (!element.product) {
  1182. // element.product = [];
  1183. // }
  1184. // element.product = res.data;
  1185. // element.product.forEach((pdt, index) => {
  1186. // if (!pdt.url) {
  1187. // pdt.url = [];
  1188. // }
  1189. // pdt.index = index + 1;
  1190. // pdt.special &&
  1191. // pdt.special.length > 0 &&
  1192. // pdt.special.forEach((_pdt) => {
  1193. // this.formData.head[3].forEach((element) => {
  1194. // if (_pdt.head_id == element.id) {
  1195. // _pdt = Object.assign(_pdt, element);
  1196. // pdt[_pdt.key] = _pdt.value;
  1197. // this.productSpecValueList.push(_pdt);
  1198. // }
  1199. // });
  1200. // });
  1201. // });
  1202. // this.$forceUpdate();
  1203. // }
  1204. // });
  1205. // } else {
  1206. // element.isCurrencyArea = false;
  1207. // }
  1208. });
  1209. this.areaSpecValueList = this.formData.head[2]
  1210. ? this.formData.head[2]
  1211. : [];
  1212. this.productSpecValueList = this.formData.head[3]
  1213. ? this.formData.head[3]
  1214. : [];
  1215. });
  1216. },
  1217. goback() {
  1218. this.$router.go(-1);
  1219. },
  1220. handleSelection(selection) {
  1221. this.selected = selection;
  1222. },
  1223. // 1拆单 2详情
  1224. handleSet(row, index, type, item) {
  1225. switch (type) {
  1226. case 1:
  1227. break;
  1228. case 2:
  1229. this.$router.push({
  1230. path: "/cms/BidSystem/DeepeningOrder/edit",
  1231. query: {
  1232. type,
  1233. order_no: this.formData.order_no,
  1234. // order_area_id: item.id,
  1235. order_area_product_id: row.id,
  1236. },
  1237. });
  1238. break;
  1239. case 3:
  1240. this.$Modal.confirm({
  1241. title: "确认删除?",
  1242. content: "此操作确认后不可恢复,请确认!",
  1243. onOk: () => {
  1244. this.axios({
  1245. method: "post",
  1246. url: "/api/order_area_deep_del",
  1247. data: {
  1248. id: row.id,
  1249. },
  1250. }).then((res) => {
  1251. if (res.doce == 200) {
  1252. this.$Message.success(res.msg);
  1253. this.initData(this.formData.order_no, this.oa_id);
  1254. }
  1255. });
  1256. },
  1257. onCancel: () => {},
  1258. });
  1259. break;
  1260. case 4:
  1261. this.$router.push({
  1262. path: "/cms/BidSystem/DeepeningOrder/edit",
  1263. query: {
  1264. type,
  1265. order_no: this.formData.order_no,
  1266. order_area_id: item.id,
  1267. order_area_product_id: row.order_area_product_id,
  1268. },
  1269. });
  1270. break;
  1271. }
  1272. },
  1273. // 删除工艺属性
  1274. handleAddPDTDetailDele(arr, index) {
  1275. arr.splice(index, 1);
  1276. },
  1277. //新增产品复制
  1278. handleAddPDTCopy(item, index) {
  1279. const temp = JSON.parse(JSON.stringify(item));
  1280. this.tempPDTList.splice(index + 1, 0, temp);
  1281. },
  1282. //新增产品添加
  1283. handleAddPDTAdd(index) {
  1284. this.tempPDTList.splice(index + 1, 0, { addPDTProcessAttrList: [] });
  1285. },
  1286. //新增产品删除
  1287. handleAddPDTDele(index) {
  1288. this.tempPDTList.splice(index, 1);
  1289. },
  1290. //新增产品→新增区域确认
  1291. handleAddPDTConfirm() {
  1292. this.tempPDTList.forEach((element) => {
  1293. // element.measure = `${element.length ? element.length : 0}*${element.width ? element.width : 0}*${element.height ? element.height : 0}`
  1294. element.addPDTProcessAttrList.forEach((el, i) => {
  1295. if (i == element.tempMeasureList.length - 1) {
  1296. element.process_property += el.showValue;
  1297. element.process_properties += el.showId;
  1298. } else {
  1299. element.process_property += el.showValue + ",";
  1300. element.process_properties += el.showId + ",";
  1301. }
  1302. });
  1303. element.tempMeasureList.forEach((el, i) => {
  1304. if (i == element.tempMeasureList.length - 1) {
  1305. element.measure += `${el.e_title}${el.value}`;
  1306. } else {
  1307. element.measure += `${el.e_title}${el.value}*`;
  1308. }
  1309. });
  1310. });
  1311. this.axios({
  1312. method: "post",
  1313. url: "/api/order_area_deep_add",
  1314. data: {
  1315. order_no: this.formData.order_no,
  1316. order_area_id: this.order_area_id,
  1317. oa_id: this.$route.query.oa_id,
  1318. ...this.tempPDTList[0],
  1319. },
  1320. }).then((res) => {
  1321. this.$Message.success(res.msg);
  1322. this.showPDTModal = false;
  1323. this.initData(this.formData.order_no, this.oa_id);
  1324. });
  1325. // this.tempPDTList = [
  1326. // {
  1327. // addPDTProcessAttrList:[{}]
  1328. // }
  1329. // ]
  1330. },
  1331. //项目辅料新增
  1332. handleAddSup() {
  1333. this.supTableData.push({ index: "", title: "" });
  1334. // this.supTableData.forEach((element, index) => {
  1335. // element.index = index + 1;
  1336. // });
  1337. },
  1338. //项目辅料删除
  1339. handleSupSet(row, index) {
  1340. this.supTableData.splice(index, 1);
  1341. },
  1342. //添加工艺属性
  1343. handleProcessAdd(item, index) {
  1344. this.tempPDTList[index].addPDTProcessAttrList.push({
  1345. PDTProcessAttrDetailList: [],
  1346. });
  1347. },
  1348. //选择工艺属性
  1349. handleAddPDTAttrChange(item, index, value) {
  1350. this.axios("/api/properties_index", { params: { id: value } }).then(
  1351. (res) => {
  1352. item.PDTProcessAttrDetailList = res.data.data;
  1353. }
  1354. );
  1355. },
  1356. //选择工艺属性细节
  1357. handleAddPDTAttrDetailChange(item, index, value) {
  1358. item.showValue = value.label;
  1359. item.showId = value.value;
  1360. },
  1361. // handleFinish() {
  1362. // if (this.selected.length < 1) {
  1363. // this.$Message.warning("请选择数据");
  1364. // } else {
  1365. // const order_area_product_id = this.selected.map(
  1366. // (item) => item.order_area_product_id || item.id
  1367. // );
  1368. // this.$Modal.confirm({
  1369. // title: "确认完成?",
  1370. // // content: "此操作确认后不可恢复,请确认!",
  1371. // onOk: () => {
  1372. // this.axios({
  1373. // method: "post",
  1374. // url: "/api/order_area_product_status",
  1375. // data: {
  1376. // order_area_product_id,
  1377. // },
  1378. // }).then((res) => {
  1379. // if (res.code == 200) {
  1380. // this.$Message.success(res.msg);
  1381. // this.initData(this.formData.order_no, this.oa_id);
  1382. // this.handleShowCurrencyArea(item,index)
  1383. // this.getListData()
  1384. // }
  1385. // });
  1386. // },
  1387. // onCancel: () => {},
  1388. // });
  1389. // }
  1390. // },
  1391. looks(img) {
  1392. const array = [{ img_url: img }];
  1393. this.$previewImg({
  1394. list: array,
  1395. baseUrl: this.$store.state.ip,
  1396. baseImgField: "img_url",
  1397. baseTitleField: "",
  1398. });
  1399. },
  1400. delItems(n, arr) {
  1401. arr.splice(n, 1);
  1402. },
  1403. changeIpt(e, row) {
  1404. let file = e.target.files[0];
  1405. this.postImg(file, row);
  1406. e.target.value = null;
  1407. },
  1408. postImg(file, row) {
  1409. let formData = new FormData();
  1410. formData.append("file", file);
  1411. this.axios.post("/api/upload_pic", formData).then((res) => {
  1412. row.push(res.data.url);
  1413. });
  1414. },
  1415. // 产品分类选择→对应不同测量字段
  1416. hanndleAddPDTTypeChange(item, e) {
  1417. this.axios("/api/basics_product_index", {
  1418. params: { title: e.label },
  1419. }).then((res) => {
  1420. item.tempPDTTypeList = res.data.data[0].measure_id.split(",");
  1421. item.tempMeasureList = this.measureList;
  1422. this.measureList.forEach((el) => {
  1423. item[el.e_title] = "";
  1424. });
  1425. });
  1426. // basics_measure_index
  1427. },
  1428. handleImgClick(e, row) {
  1429. const list = [{ img_url: e.target.src }];
  1430. this.$previewImg({
  1431. list,
  1432. baseUrl: "",
  1433. baseImgField: "img_url",
  1434. baseTitleField: "",
  1435. });
  1436. },
  1437. uploadError(err) {
  1438. this.$Message.error(err.msg || "上传失败");
  1439. },
  1440. //导入成功
  1441. uploadSuccess(res) {
  1442. if (res.code == 200) {
  1443. this.$Message.success(res.msg || "上传成功");
  1444. // const temp = res.data;
  1445. // let list = [...this.postInfo.children, ...temp];
  1446. } else {
  1447. this.$Message.warning(res.msg || "上传失败");
  1448. }
  1449. },
  1450. handleProcess() {
  1451. const order_area_product_id = this.selected.map(
  1452. (item) => item.order_area_product_id || item.id
  1453. );
  1454. this.axios({
  1455. method: "get",
  1456. url: "/api/order_area_detail_pull",
  1457. params: {
  1458. order_no: this.order_no,
  1459. type: 2,
  1460. sub_state: 2,
  1461. order_area_product_id,
  1462. process_man: this.process_man,
  1463. process_start_time: this.process_start_time
  1464. ? this.func.replaceDateNoHMS(this.process_start_time)
  1465. : "",
  1466. process_end_time: this.process_end_time
  1467. ? this.func.replaceDateNoHMS(this.process_end_time)
  1468. : "",
  1469. },
  1470. }).then((res) => {
  1471. if (res.code == 200) {
  1472. this.$Message.success(res.msg);
  1473. this.getListData();
  1474. this.initData(this.formData.order_no, this.oa_id);
  1475. }
  1476. });
  1477. },
  1478. handleOpenModal() {
  1479. if (this.selected.length < 1) {
  1480. this.$Message.warning("请选择数据");
  1481. } else {
  1482. this.processModal = true;
  1483. }
  1484. },
  1485. handleCurTabChange(name) {
  1486. this.currencyTab = name;
  1487. this.selected = [];
  1488. if (name == "name2" && this.listTableData.length < 1) {
  1489. this.getListData();
  1490. }
  1491. },
  1492. getListData() {
  1493. this.axios
  1494. .get("/api/order_area_detail_list", {
  1495. params: {
  1496. order_no: this.$route.query.order_no,
  1497. ...this.searchData,
  1498. type: 2,
  1499. oa_id: this.oa_id,
  1500. },
  1501. })
  1502. .then((res) => {
  1503. this.area_no_list = res.data.area_no;
  1504. this.area_title_list = res.data.area_title;
  1505. this.product_title_list = res.data.product_title;
  1506. this.url_number_list = res.data.url_number;
  1507. this.listTableData = res.data.data;
  1508. this.listTableData.map((item) => {
  1509. !item.url && (item.url = []);
  1510. res.data.imgs.map((element) => {
  1511. if (item.sign_id == element.sign_id) {
  1512. item.url.push({ img_url: element.img_url });
  1513. }
  1514. });
  1515. });
  1516. this.total = res.data.total;
  1517. this.$forceUpdate();
  1518. });
  1519. },
  1520. changePage(e) {
  1521. this.page_index = e;
  1522. this.getListData();
  1523. },
  1524. changeSize(e) {
  1525. this.page_size = e;
  1526. this.getListData();
  1527. },
  1528. // 展示区域产品
  1529. handleShowCurrencyArea(item, index) {
  1530. const preObj = this.formData.list.filter((item) => item.isCurrencyArea);
  1531. // 判断当前打开是否与上一个是否一致
  1532. if (preObj.length > 0) {
  1533. // 1.1移除上一个展开区域及产品
  1534. this.formData.list.forEach((element) => {
  1535. element.product = [];
  1536. if (element.id == preObj[0].id) {
  1537. element.isCurrencyArea = false;
  1538. }
  1539. });
  1540. // 2.获取当前展开区域及产品
  1541. item.isCurrencyArea = true;
  1542. this.axios
  1543. .get("/api/order_area_list_product", {
  1544. params: {
  1545. order_no: this.$route.query.order_no,
  1546. oa_id: this.$route.query.oa_id,
  1547. area_id: item.id,
  1548. type: 2,
  1549. },
  1550. })
  1551. .then((res) => {
  1552. if (res.code == 200) {
  1553. if (!item.product) {
  1554. item.product = [];
  1555. }
  1556. item.product = res.data;
  1557. item.product.forEach((pdt, index) => {
  1558. pdt.index = index + 1;
  1559. pdt.special &&
  1560. pdt.special.length > 0 &&
  1561. pdt.special.forEach((element) => {
  1562. this.formData.head[3].forEach((item) => {
  1563. if (element.head_id == item.id) {
  1564. element = Object.assign(element, item);
  1565. pdt[element.key] = element.value;
  1566. this.productSpecValueList.push(element);
  1567. }
  1568. });
  1569. });
  1570. });
  1571. this.$forceUpdate();
  1572. }
  1573. });
  1574. } else {
  1575. // 2.获取当前展开区域及产品
  1576. item.isCurrencyArea = true;
  1577. this.axios
  1578. .get("/api/order_area_list_product", {
  1579. params: {
  1580. order_no: this.$route.query.order_no,
  1581. oa_id: this.$route.query.oa_id,
  1582. area_id: item.id,
  1583. type: 2,
  1584. },
  1585. })
  1586. .then((res) => {
  1587. if (res.code == 200) {
  1588. if (!item.product) {
  1589. item.product = [];
  1590. }
  1591. item.product = res.data;
  1592. item.product.forEach((pdt, index) => {
  1593. pdt.index = index + 1;
  1594. pdt.special &&
  1595. pdt.special.length > 0 &&
  1596. pdt.special.forEach((element) => {
  1597. this.formData.head[3].forEach((item) => {
  1598. if (element.head_id == item.id) {
  1599. element = Object.assign(element, item);
  1600. pdt[element.key] = element.value;
  1601. this.productSpecValueList.push(element);
  1602. }
  1603. });
  1604. });
  1605. });
  1606. this.$forceUpdate();
  1607. }
  1608. });
  1609. }
  1610. },
  1611. },
  1612. // 监听属性 类似于data概念
  1613. computed: {},
  1614. // 监控data中的数据变化
  1615. watch: {},
  1616. beforeCreate() {}, // 生命周期 - 创建之前
  1617. beforeMount() {}, // 生命周期 - 挂载之前
  1618. beforeUpdate() {}, // 生命周期 - 更新之前
  1619. updated() {}, // 生命周期 - 更新之后
  1620. beforeDestroy() {}, // 生命周期 - 销毁之前
  1621. destroyed() {}, // 生命周期 - 销毁完成
  1622. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  1623. };
  1624. </script>
  1625. <style lang="scss" scoped>
  1626. .BidSystemDeepeningOrderDetail {
  1627. overflow: hidden;
  1628. overflow-y: auto;
  1629. position: relative;
  1630. top: 20px;
  1631. height: 85%;
  1632. padding-bottom: 20px;
  1633. .top_search_name1 {
  1634. display: flex;
  1635. justify-content: flex-start;
  1636. align-items: center;
  1637. flex-wrap: wrap;
  1638. width: 100%;
  1639. padding: 10px 0;
  1640. font-size: 14px;
  1641. div {
  1642. width: 220px;
  1643. padding: 5px;
  1644. span {
  1645. display: inline-block;
  1646. min-width: 40px;
  1647. max-width: 150px;
  1648. text-align: justify;
  1649. text-justify: newspaper;
  1650. word-break: break-all;
  1651. vertical-align: middle;
  1652. }
  1653. }
  1654. .top_search_content {
  1655. display: flex;
  1656. justify-content: space-between;
  1657. }
  1658. .top_search_form {
  1659. // width: 800px;
  1660. // display: flex;
  1661. // justify-content: space-around;
  1662. /deep/ .ivu-form-item {
  1663. display: inline-block;
  1664. width: 300px;
  1665. }
  1666. }
  1667. }
  1668. .top_search {
  1669. padding: 20px 0;
  1670. width: 100%;
  1671. display: flex;
  1672. justify-content: flex-start;
  1673. align-items: center;
  1674. flex-wrap: wrap;
  1675. width: 100%;
  1676. padding: 10px 0;
  1677. font-size: 14px;
  1678. display: flex;
  1679. justify-content: flex-start;
  1680. align-items: center;
  1681. flex-wrap: wrap;
  1682. width: 100%;
  1683. padding: 10px 0;
  1684. font-size: 14px;
  1685. .top_search_form {
  1686. // width: 800px;
  1687. // display: flex;
  1688. // justify-content: space-around;
  1689. /deep/ .ivu-form-item {
  1690. display: inline-block;
  1691. width: 300px;
  1692. }
  1693. }
  1694. }
  1695. .addAreaForm {
  1696. font-size: 14px;
  1697. .addFormInfo {
  1698. width: 80%;
  1699. display: flex;
  1700. justify-content: flex-start;
  1701. align-items: center;
  1702. flex-wrap: wrap;
  1703. padding: 10px 0;
  1704. div {
  1705. width: 200px;
  1706. padding: 10px;
  1707. }
  1708. }
  1709. }
  1710. .table-data {
  1711. position: relative;
  1712. padding: 15px;
  1713. margin: 10px;
  1714. margin-bottom: 30px;
  1715. border-radius: 5px;
  1716. box-shadow: 1px 1px 5px 1px #999;
  1717. .addBtn {
  1718. position: absolute;
  1719. right: 20px;
  1720. top: 20px;
  1721. }
  1722. /deep/ .ivu-form-item {
  1723. display: inline-block;
  1724. width: 220px;
  1725. }
  1726. }
  1727. }
  1728. .footer-center {
  1729. display: flex;
  1730. justify-content: center;
  1731. padding: 10px 0;
  1732. }
  1733. .addPDTFormModal {
  1734. /deep/ .ivu-modal-body {
  1735. height: 400px;
  1736. overflow: hidden;
  1737. overflow-y: auto;
  1738. }
  1739. }
  1740. .addPDTForm {
  1741. position: relative;
  1742. border-bottom: 1px solid #e8eaec;
  1743. padding-bottom: 30px;
  1744. /deep/ .ivu-form-item {
  1745. display: inline-block;
  1746. width: 300px;
  1747. }
  1748. .addPDTBtn {
  1749. position: absolute;
  1750. right: 10px;
  1751. bottom: 25px;
  1752. }
  1753. }
  1754. .addPDTProcess {
  1755. width: 300px;
  1756. padding-bottom: 15px;
  1757. div {
  1758. display: flex;
  1759. justify-content: space-around;
  1760. padding: 5px 0;
  1761. span {
  1762. padding-top: 6px;
  1763. }
  1764. }
  1765. }
  1766. .product-img {
  1767. padding-top: 10px;
  1768. }
  1769. .process_modal {
  1770. display: flex;
  1771. justify-content: center;
  1772. align-items: center;
  1773. padding: 10px;
  1774. }
  1775. .product-add {
  1776. display: flex;
  1777. flex-wrap: wrap;
  1778. .ipt {
  1779. position: absolute;
  1780. width: 100%;
  1781. height: 100%;
  1782. opacity: 0;
  1783. cursor: pointer;
  1784. outline: none;
  1785. top: 0;
  1786. left: 0;
  1787. }
  1788. .add-items {
  1789. width: 40px;
  1790. height: 40px;
  1791. border: 1px dotted #e7e7e7;
  1792. border-radius: 5px;
  1793. display: flex;
  1794. justify-content: center;
  1795. align-items: center;
  1796. overflow: hidden;
  1797. position: relative;
  1798. flex-direction: column;
  1799. background: #f4f5f7;
  1800. .item {
  1801. width: 46px;
  1802. height: 46px;
  1803. background: #3764ff;
  1804. opacity: 0.6;
  1805. display: flex;
  1806. justify-content: center;
  1807. align-items: center;
  1808. border-radius: 50%;
  1809. color: #fff;
  1810. }
  1811. }
  1812. .items {
  1813. width: 40px;
  1814. height: 40px;
  1815. margin-bottom: 10px;
  1816. display: flex;
  1817. justify-content: center;
  1818. align-items: center;
  1819. background: #e7e7e7;
  1820. margin-right: 10px;
  1821. border-radius: 5px;
  1822. position: relative;
  1823. img {
  1824. max-width: 40px;
  1825. max-height: 40px;
  1826. }
  1827. }
  1828. }
  1829. .supModalBtn {
  1830. display: flex;
  1831. justify-content: flex-end;
  1832. margin-bottom: 10px;
  1833. }
  1834. .urlSetStyle {
  1835. img {
  1836. max-width: 100px;
  1837. }
  1838. }
  1839. /deep/ .ivu-table-wrapper {
  1840. overflow: visible;
  1841. } //穿透iview
  1842. /deep/.ivu-tabs-nav-scroll {
  1843. display: flex;
  1844. justify-content: center;
  1845. }
  1846. </style>