detail.vue 58 KB

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