infoDetail.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  1. <template>
  2. <div class="changeDetail">
  3. <Toptitle :title="type == 3 ? '生产拆单详情' : type == 10?'深化单新增':'生产拆单新增'">
  4. <slot name="titleButton">
  5. <!-- <Button type="primary" style="margin-right: 10px" v-if="type == 6||type ==10"
  6. >开启拆单</Button
  7. > -->
  8. <Button type="primary" style="margin-right: 10px" v-if="type == 3"
  9. >批量下生产</Button
  10. >
  11. <Button
  12. @click="goback()"
  13. type="primary"
  14. ghost
  15. style="margin-right: 10px"
  16. >返回</Button
  17. >
  18. <Button
  19. type="primary"
  20. style="margin-right: 10px"
  21. v-if="type == 6||type == 10"
  22. @click="save"
  23. >保存</Button
  24. >
  25. </slot>
  26. </Toptitle>
  27. <div class="content">
  28. <div class="form">
  29. <Form class="form_content" :label-width="100">
  30. <FormItem label="项目编号:">
  31. <Input
  32. v-if="type == 6||type == 10"
  33. v-model="saveData.order_no"
  34. placeholder="请输入项目编码"
  35. />
  36. <span style="width: 120px" v-else>{{ formData.order_no }}</span>
  37. </FormItem>
  38. <FormItem label="项目名称:">
  39. <Input
  40. v-if="type == 6||type == 10"
  41. v-model="saveData.residential_name"
  42. placeholder="请输入项目名称"
  43. />
  44. <span v-else>{{ formData.residential_name }}</span>
  45. </FormItem>
  46. <FormItem label="项目简称:">
  47. <Input
  48. v-if="type == 6||type == 10"
  49. v-model="saveData.abbreviation"
  50. placeholder="请输入项目简称"
  51. />
  52. <span v-else>{{ formData.abbreviation }}</span>
  53. </FormItem>
  54. <FormItem label="客户名称:">
  55. <Select
  56. filterable
  57. clearable
  58. v-model="saveData.custom_title"
  59. @on-change="handleCustomSelect"
  60. v-if="type == 6||type == 10"
  61. >
  62. <Option
  63. v-for="(item, index) in custom_title_list"
  64. :key="index"
  65. :label="item.title"
  66. :value="item.id"
  67. ></Option>
  68. </Select>
  69. <span v-else>{{ formData.custom_title }}</span>
  70. </FormItem>
  71. <FormItem label="紧急程度:">
  72. <Select clearable v-model="saveData.warning_state" v-if="type == 6||type == 10">
  73. <Option
  74. v-for="(item, index) in warning_state_list"
  75. :key="index"
  76. :label="item.title"
  77. :value="item.id"
  78. ></Option>
  79. </Select>
  80. <span v-else>{{ formData.warning_state }}</span>
  81. </FormItem>
  82. <FormItem label="项目定金:">
  83. <Input
  84. v-if="type == 6||type == 10"
  85. v-model="saveData.front_money"
  86. placeholder="请输入项目定金"
  87. />
  88. <span v-else>{{ formData.front_money }}</span>
  89. </FormItem>
  90. <FormItem label="详细地址:">
  91. <Select
  92. clearable
  93. filterable
  94. v-if="type == 6||type == 10"
  95. class="auto-width"
  96. @on-change="handleClientDetailChange"
  97. v-model="saveData.custom_detail_id"
  98. >
  99. <Option
  100. v-for="item in clientDetailList_address"
  101. :label="item.address"
  102. :key="item.id"
  103. :value="item.id"
  104. ></Option>
  105. </Select>
  106. <span v-else>{{ formData.address }}</span>
  107. </FormItem>
  108. <FormItem label="手机号:">
  109. <Select
  110. clearable
  111. filterable
  112. v-if="type == 6||type == 10"
  113. v-model="saveData.custom_detail_mobile"
  114. >
  115. <Option
  116. v-for="item in clientDetailList_mobile"
  117. :label="item.mobile"
  118. :key="item.id"
  119. :value="item.mobile"
  120. ></Option>
  121. </Select>
  122. <!-- <span v-else>{{ formData.mobile }}</span> -->
  123. <span v-else>{{
  124. clientDetailList_mobile.filter(
  125. (v) => v.mobile == saveData.custom_detail_mobile
  126. ).length > 0
  127. ? clientDetailList_mobile.filter(
  128. (v) => v.mobile == saveData.custom_detail_mobile
  129. )[0].mobile
  130. : formData.mobile
  131. }}</span>
  132. </FormItem>
  133. <FormItem label="开始日期:">
  134. <DatePicker
  135. type="date"
  136. v-model="saveData.start_time"
  137. placeholder="年/月/日"
  138. style="width: 150px"
  139. v-if="type == 6||type == 10"
  140. ></DatePicker>
  141. <span v-else>{{ formData.start_time }}</span>
  142. </FormItem>
  143. <FormItem label="交付日期:">
  144. <DatePicker
  145. type="date"
  146. v-model="saveData.end_time"
  147. placeholder="年/月/日"
  148. style="width: 150px"
  149. v-if="type == 6||type == 10"
  150. ></DatePicker>
  151. <span v-else>{{ formData.end_time }}</span>
  152. </FormItem>
  153. <FormItem label="业务员:">
  154. <Select
  155. filterable
  156. clearable
  157. v-model="saveData.nickname"
  158. v-if="type == 6||type == 10"
  159. >
  160. <Option
  161. v-for="(item, index) in nickname_list"
  162. :key="index"
  163. :label="item.nickname"
  164. :value="item.id"
  165. ></Option>
  166. </Select>
  167. <span v-else>{{ formData.nickname }}</span>
  168. </FormItem>
  169. <FormItem label="备注:">
  170. <Input
  171. v-if="type == 6||type == 10"
  172. v-model="saveData.remark"
  173. type="textarea"
  174. placeholder="请输入备注"
  175. />
  176. <span v-else>{{ formData.remark }}</span>
  177. </FormItem>
  178. </Form>
  179. </div>
  180. <Card style="width: 100%" class="card">
  181. <div class="form_middle">
  182. <Form class="form_middle_content" :label-width="100">
  183. <FormItem label="区域编码:">
  184. <Select
  185. filterable
  186. multiple
  187. v-model="searchData.area_code"
  188. size="small"
  189. style="width: 120px"
  190. >
  191. <Option
  192. v-for="(item, index) in area_code"
  193. :key="index"
  194. :label="item.area_code"
  195. :value="item.area_code"
  196. ></Option>
  197. </Select>
  198. </FormItem>
  199. <FormItem label="区域名称:">
  200. <Select
  201. filterable
  202. multiple
  203. v-model="searchData.area_title"
  204. size="small"
  205. style="width: 120px"
  206. >
  207. <Option
  208. v-for="(item, index) in area_title"
  209. :key="index"
  210. :label="item.area_title"
  211. :value="item.area_title"
  212. ></Option>
  213. </Select>
  214. </FormItem>
  215. <FormItem label="户型:">
  216. <Select
  217. filterable
  218. multiple
  219. v-model="searchData.house_type"
  220. size="small"
  221. style="width: 120px"
  222. >
  223. <Option
  224. v-for="(item, index) in house_type"
  225. :key="index"
  226. :label="item.house_type"
  227. :value="item.house_type"
  228. ></Option>
  229. </Select>
  230. </FormItem>
  231. <FormItem label="楼栋:">
  232. <Select
  233. filterable
  234. multiple
  235. v-model="searchData.house"
  236. size="small"
  237. style="width: 120px"
  238. >
  239. <Option
  240. v-for="(item, index) in house"
  241. :key="index"
  242. :label="item.house"
  243. :value="item.house"
  244. ></Option>
  245. </Select>
  246. </FormItem>
  247. <FormItem label="单元:">
  248. <Select
  249. filterable
  250. multiple
  251. v-model="searchData.unit"
  252. size="small"
  253. style="width: 120px"
  254. >
  255. <Option
  256. v-for="(item, index) in unit"
  257. :key="index"
  258. :label="item.unit"
  259. :value="item.unit"
  260. ></Option>
  261. </Select>
  262. </FormItem>
  263. <FormItem label="楼层:">
  264. <Select
  265. filterable
  266. multiple
  267. v-model="searchData.layer"
  268. size="small"
  269. style="width: 120px"
  270. >
  271. <Option
  272. v-for="(item, index) in layer"
  273. :key="index"
  274. :label="item.layer"
  275. :value="item.layer"
  276. ></Option>
  277. </Select>
  278. </FormItem>
  279. <FormItem label="房号:">
  280. <Select
  281. filterable
  282. multiple
  283. v-model="searchData.number"
  284. size="small"
  285. style="width: 120px"
  286. >
  287. <Option
  288. v-for="(item, index) in number"
  289. :key="index"
  290. :label="item.number"
  291. :value="item.number"
  292. ></Option>
  293. </Select>
  294. </FormItem>
  295. <FormItem label="位置:">
  296. <Select
  297. filterable
  298. multiple
  299. v-model="searchData.position"
  300. size="small"
  301. style="width: 120px"
  302. >
  303. <Option
  304. v-for="(item, index) in position"
  305. :key="index"
  306. :label="item.position"
  307. :value="item.position"
  308. ></Option>
  309. </Select>
  310. </FormItem>
  311. <FormItem label="产品分类:">
  312. <Select
  313. filterable
  314. multiple
  315. v-model="searchData.product_type"
  316. size="small"
  317. style="width: 120px"
  318. >
  319. <Option
  320. v-for="(item, index) in product_type"
  321. :key="index"
  322. :label="item.product_type"
  323. :value="item.product_type"
  324. ></Option>
  325. </Select>
  326. </FormItem>
  327. <FormItem label="图号:">
  328. <Select
  329. filterable
  330. multiple
  331. v-model="searchData.url_number"
  332. size="small"
  333. style="width: 120px"
  334. >
  335. <Option
  336. v-for="(item, index) in url_number"
  337. :key="index"
  338. :label="item.url_number"
  339. :value="item.url_number"
  340. ></Option>
  341. </Select>
  342. </FormItem>
  343. <FormItem label="产品名称:">
  344. <Select
  345. filterable
  346. multiple
  347. v-model="searchData.product_title"
  348. size="small"
  349. style="width: 120px"
  350. >
  351. <Option
  352. v-for="(item, index) in product_title"
  353. :key="index"
  354. :label="item.product_title"
  355. :value="item.product_title"
  356. ></Option>
  357. </Select>
  358. </FormItem>
  359. <FormItem label="材质:">
  360. <Select
  361. filterable
  362. clearable
  363. v-model="searchData.material"
  364. size="small"
  365. style="width: 120px"
  366. >
  367. <Option
  368. v-for="(item, index) in material"
  369. :key="index"
  370. :label="item"
  371. :value="item"
  372. ></Option>
  373. </Select>
  374. </FormItem>
  375. <FormItem label="颜色:">
  376. <Select
  377. filterable
  378. clearable
  379. v-model="searchData.color"
  380. size="small"
  381. style="width: 120px"
  382. >
  383. <Option
  384. v-for="(item, index) in color"
  385. :key="index"
  386. :label="item"
  387. :value="item"
  388. ></Option>
  389. </Select>
  390. </FormItem>
  391. <FormItem label="工艺:">
  392. <Select
  393. filterable
  394. clearable
  395. v-model="searchData.work"
  396. size="small"
  397. style="width: 120px"
  398. >
  399. <Option
  400. v-for="(item, index) in work"
  401. :key="index"
  402. :label="item"
  403. :value="item"
  404. ></Option>
  405. </Select>
  406. </FormItem>
  407. <FormItem label="左右式:">
  408. <Select
  409. filterable
  410. multiple
  411. v-model="searchData.fashion"
  412. size="small"
  413. style="width: 120px"
  414. >
  415. <Option
  416. v-for="(item, index) in fashion"
  417. :key="index"
  418. :label="
  419. item.fashion === 0
  420. ? '无'
  421. : item.fashion === 1
  422. ? '左式'
  423. : '右式'
  424. "
  425. :value="item.fashion"
  426. ></Option>
  427. </Select>
  428. </FormItem>
  429. <FormItem label="拆单状态:">
  430. <Select
  431. filterable
  432. clearable
  433. v-model="searchData.state"
  434. size="small"
  435. style="width: 120px"
  436. >
  437. <Option
  438. v-for="(item, index) in state"
  439. :key="index"
  440. :label="item.state === 0 ? '未拆单' : '已拆单'"
  441. :value="item.state"
  442. ></Option>
  443. </Select>
  444. </FormItem>
  445. <FormItem>
  446. <Button
  447. @click="search"
  448. style="margin-right: 10px"
  449. type="primary"
  450. ghost
  451. >搜索</Button
  452. >
  453. </FormItem>
  454. </Form>
  455. </div>
  456. <Tabs type="card" @on-click="getData">
  457. <TabPane
  458. v-for="tab in tabs"
  459. :key="tab"
  460. :label="tab == 1 ? '汇总' : '明细'"
  461. style="margin: 0 auto"
  462. >
  463. <div v-show="tab === 1">
  464. <Table :columns="totalColumns" :data="totalData" border>
  465. <template slot="setSlot" slot-scope="{ row }">
  466. <a @click="handleGoPage(row)">详情</a>
  467. </template>
  468. <template slot="urlSet" slot-scope="{ index }">
  469. <div
  470. class="items"
  471. v-show="totalData[index].url.length !== 0 ? true : false"
  472. >
  473. <img
  474. @click="looks(totalData[index].url)"
  475. v-for="(el, idx) in totalData[index].url"
  476. :key="idx"
  477. :src="$store.state.ip + el"
  478. alt=""
  479. />
  480. </div>
  481. </template>
  482. </Table>
  483. <Page
  484. :page-size-opts="[10, 20, 30, 40, 100, 1000]"
  485. @on-page-size-change="changeTotalSize"
  486. @on-change="changeTotalPage"
  487. :current="page_index"
  488. show-total
  489. :total="total"
  490. show-sizer
  491. :page-size="page_size"
  492. style="text-align: center; margin-top: 10px"
  493. />
  494. </div>
  495. <div v-show="tab === 2">
  496. <Table :columns="detailColumns" :data="detailData" border>
  497. <template slot="setSlot" slot-scope="{ row }">
  498. <a @click="handleGoPage(row)">详情</a>
  499. </template>
  500. <template slot="urlSet" slot-scope="{ index }">
  501. <div
  502. class="items"
  503. v-show="detailData[index].url.length !== 0 ? true : false"
  504. >
  505. <img
  506. @click="looks(detailData[index].url)"
  507. v-for="(el, idx) in detailData[index].url"
  508. :key="idx"
  509. :src="$store.state.ip + el"
  510. alt=""
  511. />
  512. </div>
  513. </template>
  514. </Table>
  515. <Page
  516. :page-size-opts="[10, 20, 30, 40, 100, 1000]"
  517. @on-page-size-change="changeDetailSize"
  518. @on-change="changeDetailPage"
  519. :current="page_index"
  520. show-total
  521. :total="total"
  522. show-sizer
  523. :page-size="page_size"
  524. style="text-align: center; margin-top: 10px"
  525. />
  526. </div>
  527. </TabPane>
  528. <div slot="extra" class="upload">
  529. <Button
  530. @click="handleTabsAdd"
  531. size="small"
  532. style="margin-right: 10px"
  533. type="primary"
  534. ghost
  535. v-if="false"
  536. >新增</Button
  537. >
  538. <Upload
  539. :headers="headers"
  540. name="your_file"
  541. :data="uploadData"
  542. :show-upload-list="false"
  543. :on-error="uploadError"
  544. :on-success="uploadSuccess"
  545. :before-upload="handleBeforeUpload"
  546. :action="$route.query.type == 10?$store.state.ip + '/api/deep_import_new':$store.state.ip + '/api/explode_save_import_new'"
  547. style="margin-right: 10px"
  548. >
  549. <Button size="small" type="primary" ghost>导入</Button>
  550. </Upload>
  551. </div>
  552. </Tabs>
  553. </Card>
  554. </div>
  555. </div>
  556. </template>
  557. <script>
  558. export default {
  559. data() {
  560. return {
  561. ruleValidate: {
  562. name: [
  563. {
  564. required: true,
  565. message: "The name cannot be empty",
  566. trigger: "blur",
  567. },
  568. ],
  569. },
  570. totalColumns: [
  571. { type: "selection", align: "center", width: 60 },
  572. { title: "序号", align: "center", type: "index", minWidth: 200 },
  573. {
  574. title: "产品分类",
  575. align: "center",
  576. key: "product_type",
  577. minWidth: 200,
  578. },
  579. {
  580. title: "产品名称",
  581. align: "center",
  582. key: "product_title",
  583. minWidth: 200,
  584. },
  585. { title: "图号", align: "center", key: "url_number", minWidth: 200 },
  586. { title: "型号", align: "center", key: "model", minWidth: 200 },
  587. { title: "数量", align: "center", key: "num", minWidth: 200 },
  588. { title: "长", align: "center", key: "long", minWidth: 200 },
  589. { title: "宽", align: "center", key: "wide", minWidth: 200 },
  590. { title: "高", align: "center", key: "high", minWidth: 200 },
  591. { title: "材质", align: "center", key: "material", minWidth: 200 },
  592. { title: "颜色", align: "center", key: "color", minWidth: 200 },
  593. { title: "工艺", align: "center", key: "work", minWidth: 200 },
  594. {
  595. title: "图纸",
  596. align: "center",
  597. key: "url",
  598. minWidth: 200,
  599. slot: "urlSet",
  600. },
  601. {
  602. title: "左右式",
  603. align: "center",
  604. key: "fashion",
  605. minWidth: 200,
  606. render: (h, params) => {
  607. const { row } = params;
  608. return h(
  609. "span",
  610. {},
  611. row.left_right_mode == 1
  612. ? "左式"
  613. : row.left_right_mode == 2
  614. ? "右式"
  615. : "无"
  616. );
  617. },
  618. },
  619. { title: "备注", align: "center", key: "remark", minWidth: 200 },
  620. {
  621. title: "拆单状态",
  622. align: "center",
  623. key: "state",
  624. minWidth: 200,
  625. render: (h, params) => {
  626. const { row } = params;
  627. return h("span", {}, row.state == 0 ? "未拆单" : "已拆单");
  628. },
  629. },
  630. { title: "操作", align: "center", minWidth: 200, slot: "setSlot" },
  631. ],
  632. totalData: [],
  633. headers: { Authorization: localStorage.getItem("token") },
  634. detailColumns: [
  635. { type: "selection", align: "center", width: 60 },
  636. { title: "序号", align: "center", type: "index", minWidth: 200 },
  637. { title: "区域编码", align: "center", key: "area_code", minWidth: 200 },
  638. {
  639. title: "区域名称",
  640. align: "center",
  641. key: "area_title",
  642. minWidth: 200,
  643. },
  644. { title: "户型", align: "center", key: "house_type", minWidth: 200 },
  645. { title: "楼栋", align: "center", key: "house", minWidth: 200 },
  646. { title: "单元", align: "center", key: "unit", minWidth: 200 },
  647. { title: "楼层", align: "center", key: "layer", minWidth: 200 },
  648. { title: "房号", align: "center", key: "number", minWidth: 200 },
  649. { title: "位置", align: "center", key: "position", minWidth: 200 },
  650. {
  651. title: "产品分类",
  652. align: "center",
  653. key: "product_type",
  654. minWidth: 200,
  655. },
  656. {
  657. title: "产品名称",
  658. align: "center",
  659. key: "product_title",
  660. minWidth: 200,
  661. },
  662. {
  663. title: "计量单位",
  664. align: "center",
  665. key: "product_unit",
  666. minWidth: 200,
  667. },
  668. { title: "图号", align: "center", key: "url_number", minWidth: 200 },
  669. { title: "型号", align: "center", key: "model", minWidth: 200 },
  670. // { title: "数量", align: "center", key: "num", minWidth: 200 },
  671. { title: "长", align: "center", key: "long", minWidth: 200 },
  672. { title: "宽", align: "center", key: "wide", minWidth: 200 },
  673. { title: "高", align: "center", key: "high", minWidth: 200 },
  674. { title: "材质", align: "center", key: "material", minWidth: 200 },
  675. { title: "颜色", align: "center", key: "color", minWidth: 200 },
  676. { title: "工艺", align: "center", key: "work", minWidth: 200 },
  677. {
  678. title: "图纸",
  679. align: "center",
  680. key: "url",
  681. minWidth: 200,
  682. slot: "urlSet",
  683. },
  684. {
  685. title: "左右式",
  686. align: "center",
  687. key: "fashion",
  688. minWidth: 200,
  689. render: (h, params) => {
  690. const { row } = params;
  691. return h(
  692. "span",
  693. {},
  694. row.left_right_mode == 1
  695. ? "左式"
  696. : row.left_right_mode == 2
  697. ? "右式"
  698. : "无"
  699. );
  700. },
  701. },
  702. { title: "备注", align: "center", key: "remark", minWidth: 200 },
  703. {
  704. title: "拆单状态",
  705. align: "center",
  706. key: "state",
  707. minWidth: 200,
  708. render: (h, params) => {
  709. const { row } = params;
  710. return h("span", {}, row.state == 0 ? "未拆单" : "已拆单");
  711. },
  712. },
  713. { title: "操作", align: "center", minWidth: 200, slot: "setSlot" },
  714. ],
  715. detailData: [],
  716. saveData: {
  717. abbreviation: "",
  718. address: "",
  719. custom_title: "",
  720. end_time: "",
  721. front_money: "",
  722. mobile: "",
  723. nickname: "",
  724. order_no: "",
  725. remark: "",
  726. residential_name: "",
  727. start_time: "",
  728. warning_state: "",
  729. custom_detail_mobile: "",
  730. custom_detail_id: "",
  731. },
  732. formData: {},
  733. custom_title_list: [],
  734. warning_state_list: [],
  735. nickname_list: [],
  736. searchData: {
  737. area_code: [],
  738. area_title: [],
  739. house_type: [],
  740. product_type: [],
  741. fashion: [],
  742. house: [],
  743. unit: [],
  744. layer: [],
  745. number: [],
  746. position: [],
  747. url_number: [],
  748. product_title: [],
  749. material: "",
  750. color: "",
  751. work: "",
  752. state: "",
  753. },
  754. area_code: [],
  755. area_title: [],
  756. house_type: [],
  757. house: [],
  758. unit: [],
  759. layer: [],
  760. number: [],
  761. position: [],
  762. url_number: [],
  763. product_title: [],
  764. product_type: [],
  765. fashion: [],
  766. material: [],
  767. color: [],
  768. work: [],
  769. state: [],
  770. search_state: false,
  771. copy_form: [],
  772. type: this.$route.query.type,
  773. formData: {},
  774. tabs: 2,
  775. total: 0,
  776. page_index: 1,
  777. page_size: 10,
  778. save_state: false,
  779. currency_tag: 0,
  780. clientDetailList: [],
  781. clientDetailList_respon: [],
  782. clientDetailList_mobile: [],
  783. clientDetailList_address: [],
  784. };
  785. },
  786. computed: {
  787. uploadData() {
  788. return { order_no: this.saveData.order_no || this.$route.query.order_no };
  789. },
  790. },
  791. created() {
  792. if (this.$route.query.type == 3) {
  793. this.axios
  794. .get("/api/order_area_orders", {
  795. params: {
  796. order_no: this.$route.query.order_no,
  797. oa_id: this.$route.query.oa_id,
  798. },
  799. })
  800. .then((res) => {
  801. this.formData = res.data;
  802. });
  803. this.getData();
  804. } else {
  805. this.axios.get("/api/custom_list").then((res) => {
  806. this.custom_title_list = res.data.data;
  807. });
  808. this.axios.get("/api/warning_list").then((res) => {
  809. this.warning_state_list = res.data.data;
  810. });
  811. this.axios
  812. .get("/api/employee_list", { params: { type: 2 } })
  813. .then((res) => {
  814. this.nickname_list = res.data;
  815. });
  816. }
  817. },
  818. methods: {
  819. looks(arr) {
  820. // const array = [{ img_url: img }];
  821. const array = arr.map((v) => {
  822. return { img_url: v };
  823. });
  824. this.$previewImg({
  825. list: array,
  826. baseUrl: this.$store.state.ip,
  827. baseImgField: "img_url",
  828. baseTitleField: "",
  829. });
  830. },
  831. handleBeforeUpload() {console.log(1)},
  832. handleClientDetailChange(val) {
  833. val && (this.info.custom_detail_id = val);
  834. },
  835. handleCustomSelect(id) {
  836. id &&
  837. this.axios({
  838. method: "get",
  839. url: "/api/custom_detail",
  840. params: { id },
  841. }).then((res) => {
  842. this.clientDetailList = res.data.list;
  843. // 去重负责人
  844. this.clientDetailList_respon = this.unique(res.data.list);
  845. // 赋值默认负责人
  846. this.saveData.custom_detail_name = this.clientDetailList_respon[0].service_name;
  847. // 取出手机号码是该负责人的
  848. this.clientDetailList_mobile = this.clientDetailList.filter(
  849. (item) => item.service_name == this.saveData.custom_detail_name
  850. );
  851. // 赋值默认手机号码
  852. this.saveData.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
  853. // 去重手机号码
  854. this.clientDetailList_mobile = this.unique(
  855. this.clientDetailList_mobile
  856. );
  857. // 取出地址是该负责人的
  858. this.clientDetailList_address = this.clientDetailList.filter(
  859. (item) => item.service_name == this.saveData.custom_detail_name
  860. );
  861. // 赋值默认地址
  862. this.saveData.custom_detail_id =
  863. this.clientDetailList_respon[0].id || 0;
  864. this.saveData.service_id = res.data.detail.service_id;
  865. // this.$forceUpdate();
  866. });
  867. },
  868. unique(array) {
  869. let arr = JSON.parse(JSON.stringify(array));
  870. for (var i = 0; i < arr.length; i++) {
  871. for (var j = i + 1; j < arr.length; j++) {
  872. if (arr[i].service_name == arr[j].service_name) {
  873. //第一个等同于第二个,splice方法删除第二个
  874. arr.splice(j, 1);
  875. j--;
  876. }
  877. }
  878. }
  879. return arr;
  880. },
  881. handleGoPage(row) {
  882. this.$router.push({
  883. path: "/cms/BidSystem/ProductDeOrder/deorderdetail",
  884. query: {
  885. type: 3,
  886. order_no: this.$route.query.order_no || this.saveData.order_no,
  887. oa_id: row.oa_id,
  888. orders_area_product_detail_id: row.id,
  889. },
  890. });
  891. },
  892. handleTabsChange(name) {
  893. this.currency_tag = name;
  894. this.getData(name);
  895. },
  896. changeTotalSize(e) {
  897. this.page_size = e;
  898. this.getData(0);
  899. },
  900. changeTotalPage(e) {
  901. this.page_index = e;
  902. this.getData(0);
  903. },
  904. changeDetailSize(e) {
  905. this.page_size = e;
  906. this.getData(1);
  907. },
  908. changeDetailPage(e) {
  909. this.page_index = e;
  910. this.getData(1);
  911. },
  912. getData(type) {
  913. if (type === 1) {
  914. if (this.search_state) {
  915. console.log(2)
  916. this.axios
  917. .post("/api/order_area_details", {
  918. order_no: this.$route.query.order_no || this.saveData.order_no,
  919. oa_id: this.$route.query.oa_id,
  920. page_index: this.page_index,
  921. page_size: this.page_size,
  922. ...this.searchData,
  923. })
  924. .then((res) => {
  925. console.log(res);
  926. this.detailData = res.data.data;
  927. this.total = res.data.total;
  928. });
  929. } else {
  930. // this.$route.query.order_no &&
  931. console.log(1)
  932. this.axios
  933. .post("/api/order_area_details", {
  934. order_no: this.$route.query.order_no || this.saveData.order_no,
  935. oa_id: this.$route.query.oa_id,
  936. page_index: this.page_index,
  937. page_size: this.page_size,
  938. })
  939. .then((res) => {
  940. console.log(res);
  941. this.detailData = res.data.data;
  942. this.total = res.data.total;
  943. this.area_code = res.data.area_code;
  944. this.area_title = res.data.area_title;
  945. this.color = res.data.color;
  946. this.fashion = res.data.fashion;
  947. this.house = res.data.house;
  948. this.house_type = res.data.house_type;
  949. this.layer = res.data.layer;
  950. this.material = res.data.material;
  951. this.number = res.data.number;
  952. this.position = res.data.position;
  953. this.product_title = res.data.product_title;
  954. this.product_type = res.data.product_type;
  955. this.state = res.data.state;
  956. this.unit = res.data.unit;
  957. this.url_number = res.data.url_number;
  958. this.work = res.data.work;
  959. this.copy_form = this.searchData;
  960. });
  961. }
  962. } else if (type === 0) {
  963. console.log("111 :>> ", 111);
  964. this.axios
  965. .post("/api/order_area_details", {
  966. type: 1,
  967. order_no: this.$route.query.order_no || this.saveData.order_no,
  968. page_index: this.page_index,
  969. oa_id: this.$route.query.oa_id,
  970. page_size: this.page_size,
  971. ...this.searchData,
  972. })
  973. .then((res) => {
  974. console.log(res);
  975. this.detailData = res.data.data;
  976. this.totalData = res.data.data;
  977. this.total = res.data.total;
  978. this.area_code = res.data.area_code;
  979. this.area_title = res.data.area_title;
  980. this.color = res.data.color;
  981. this.fashion = res.data.fashion;
  982. this.house = res.data.house;
  983. this.house_type = res.data.house_type;
  984. this.layer = res.data.layer;
  985. this.material = res.data.material;
  986. this.number = res.data.number;
  987. this.position = res.data.position;
  988. this.product_title = res.data.product_title;
  989. this.product_type = res.data.product_type;
  990. this.state = res.data.state;
  991. this.unit = res.data.unit;
  992. this.url_number = res.data.url_number;
  993. this.work = res.data.work;
  994. this.copy_form = this.searchData;
  995. });
  996. } else {
  997. this.axios
  998. .post("/api/order_area_details", {
  999. type: this.$route.query.type,
  1000. oa_id: this.$route.query.oa_id,
  1001. order_no: this.$route.query.order_no || this.saveData.order_no,
  1002. ...{ page_index: this.page_index, page_size: this.page_size },
  1003. ...this.searchData,
  1004. })
  1005. .then((res) => {
  1006. console.log(res.msg.house_type, this.house_type);
  1007. this.totalData = res.data.data;
  1008. this.total = res.data.total;
  1009. this.area_code = res.data.area_code;
  1010. this.area_title = res.data.area_title;
  1011. this.color = res.data.color;
  1012. this.fashion = res.data.fashion;
  1013. this.house = res.data.house;
  1014. this.house_type = res.data.house_type;
  1015. this.layer = res.data.layer;
  1016. this.material = res.data.material;
  1017. this.number = res.data.number;
  1018. this.position = res.data.position;
  1019. this.product_title = res.data.product_title;
  1020. this.product_type = res.data.product_type;
  1021. this.state = res.data.state;
  1022. this.unit = res.data.unit;
  1023. this.url_number = res.data.url_number;
  1024. this.work = res.data.work;
  1025. this.copy_form = this.searchData;
  1026. });
  1027. }
  1028. },
  1029. uploadError(err) {
  1030. this.$Message.error(err.msg || "导入失败");
  1031. },
  1032. uploadSuccess(res) {
  1033. if (res.code == 200) {
  1034. this.$Message.success("导入成功");
  1035. this.search_state = true;
  1036. this.getData(this.currency_tag);
  1037. } else {
  1038. this.$Message.warning(res.msg || "导入失败");
  1039. }
  1040. // this.page_index = 1;
  1041. // this.page_size = 10;
  1042. // this.axios
  1043. // .post("/api/order_area_details", {
  1044. // ...this.$route.query,
  1045. // ...{ page_index: this.page_index, page_size: this.page_size },
  1046. // order_no:this.saveData.order_no
  1047. // })
  1048. // .then((res) => {
  1049. // console.log(res)
  1050. // this.totalData = res.msg.data;
  1051. // this.total = res.msg.total;
  1052. // this.area_code = res.msg.area_code;
  1053. // this.area_title = res.msg.area_title;
  1054. // this.color = res.msg.color;
  1055. // this.fashion = res.msg.fashion;
  1056. // this.house = res.msg.house;
  1057. // this.house_type = res.msg.house_type;
  1058. // this.layer = res.msg.layer;
  1059. // this.material = res.msg.material;
  1060. // this.number = res.msg.number;
  1061. // this.position = res.msg.position;
  1062. // this.product_title = res.msg.product_title;
  1063. // this.product_type = res.msg.product_type;
  1064. // this.state = res.msg.state;
  1065. // this.unit = res.msg.unit;
  1066. // this.url_number = res.msg.url_number;
  1067. // this.work = res.msg.work;
  1068. // this.copy_form = this.searchData;
  1069. // });
  1070. },
  1071. save() {
  1072. if (
  1073. !this.saveData.order_no &&
  1074. !this.saveData.residential_name &&
  1075. !this.saveData.abbreviation &&
  1076. !this.saveData.custom_title &&
  1077. !this.saveData.warning_state
  1078. ) {
  1079. this.$message.error("请填写必要信息!");
  1080. } else {
  1081. this.axios
  1082. .post("/api/order_area_save", { ...this.saveData })
  1083. .then((res) => {
  1084. this.$message.success(res.msg);
  1085. this.save_state = true;
  1086. });
  1087. }
  1088. },
  1089. goback() {
  1090. this.$router.go(-1);
  1091. },
  1092. handleTabsAdd() {
  1093. this.tabs++;
  1094. },
  1095. search() {
  1096. this.search_state = true;
  1097. this.getData(this.currency_tag);
  1098. },
  1099. },
  1100. };
  1101. </script>
  1102. <style scoped lang="scss">
  1103. .changeDetail {
  1104. .content {
  1105. overflow: auto;
  1106. height: 680px;
  1107. .form_content {
  1108. display: flex;
  1109. flex-wrap: wrap;
  1110. }
  1111. .card {
  1112. .form_middle {
  1113. .form_middle_content {
  1114. display: flex;
  1115. flex-wrap: wrap;
  1116. }
  1117. }
  1118. }
  1119. }
  1120. }
  1121. .ivu-form-item {
  1122. width: 250px;
  1123. }
  1124. .upload {
  1125. display: flex;
  1126. justify-content: space-around;
  1127. }
  1128. .items {
  1129. width: auto;
  1130. height: 40px;
  1131. margin-bottom: 10px;
  1132. overflow: hidden;
  1133. border-radius: 5px;
  1134. position: relative;
  1135. img {
  1136. max-width: 40px;
  1137. max-height: 40px;
  1138. }
  1139. }
  1140. </style>