deepDetail.vue 38 KB

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