detail.vue 59 KB

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