detail.vue 56 KB

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