info.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491
  1. <template>
  2. <div class="BidSystemContractInfo">
  3. <Toptitle title="查看工装订单">
  4. <slot name="titleButton">
  5. <!-- <Button
  6. type="primary"
  7. style="margin-right: 10px"
  8. :disabled="isChecked"
  9. @click="showAddInputModal = true"
  10. >
  11. 添加特殊字段
  12. </Button> -->
  13. <Button
  14. @click="handleOpenModal"
  15. type="primary"
  16. v-show="currencyTab == 'name2'"
  17. style="margin-right: 10px"
  18. >批量下深化</Button
  19. >
  20. <Button
  21. @click="showSupModal = true"
  22. type="primary"
  23. style="margin-right: 10px"
  24. >项目辅料</Button
  25. >
  26. <Button
  27. @click="goback()"
  28. type="primary"
  29. ghost
  30. style="margin-right: 10px"
  31. >返回</Button
  32. >
  33. </slot>
  34. </Toptitle>
  35. <Tabs value="name1" @on-click="handleCurTabChange">
  36. <TabPane
  37. label="块状形式"
  38. name="name1"
  39. style="overflow: hidden; overflow-y: auto"
  40. >
  41. <div class="top_search">
  42. <Form :model="formData" :label-width="100" class="top_search_form">
  43. <FormItem label="订单号:">
  44. {{ formData.order_no }}
  45. </FormItem>
  46. <FormItem label="项目名称:">
  47. {{ formData.residential_name }}
  48. </FormItem>
  49. <FormItem label="客户姓名:">
  50. {{ formData.client_name }}
  51. </FormItem>
  52. <FormItem label="紧急程度:">
  53. <span
  54. v-for="_item in warningList"
  55. :key="_item.id"
  56. v-show="_item.id == formData.warning_state"
  57. :style="{ color: _item.color }"
  58. >{{ _item.title }}
  59. </span>
  60. </FormItem>
  61. <FormItem label="项目定金:">
  62. {{ formData.front_money }}
  63. <!-- <RadioGroup v-model="formData.pay_state"
  64. size="small">
  65. <Radio :label=0
  66. :disabled="isChecked">未收款</Radio>
  67. <Radio :label=1
  68. :disabled="isChecked">已收款</Radio>
  69. </RadioGroup> -->
  70. </FormItem>
  71. <FormItem label="详细地址:">
  72. {{ formData.address }}
  73. </FormItem>
  74. <FormItem label="手机号:">
  75. {{ formData.mobile }}
  76. </FormItem>
  77. <FormItem label="开始日期:">
  78. {{
  79. formData.start_time
  80. ? func.replaceDateNoHMS(formData.start_time)
  81. : ""
  82. }}
  83. </FormItem>
  84. <FormItem label="结束日期:">
  85. {{
  86. formData.end_time
  87. ? func.replaceDateNoHMS(formData.end_time)
  88. : ""
  89. }}
  90. </FormItem>
  91. <FormItem label="业务员:">
  92. <span
  93. v-for="_item in salesmanList"
  94. :key="_item.id"
  95. v-show="_item.id == formData.salesman"
  96. :style="{ color: _item.color }"
  97. >{{ _item.nickname }}
  98. </span>
  99. </FormItem>
  100. <!-- <FormItem label="订单类型:">
  101. <Select v-model="formData.type"
  102. :disabled="isChecked"
  103. size="small"
  104. style="width:200px">
  105. <Option label='工装'
  106. :value=1></Option>
  107. <Option label='家装'
  108. :value=2></Option>
  109. </Select>
  110. </FormItem> -->
  111. <FormItem
  112. v-for="item in formData.special"
  113. :key="item.id"
  114. :label="item.key + ':'"
  115. >
  116. {{ item.value }}
  117. </FormItem>
  118. <FormItem label="备注:">
  119. {{ formData.remark }}
  120. </FormItem>
  121. </Form>
  122. </div>
  123. <div
  124. class="addArea"
  125. v-for="(areaItem, areaIndex) in formData.list"
  126. :key="areaItem.areaIndex"
  127. >
  128. <div class="addAreaBtn">
  129. <Button
  130. @click="handleShowCurrencyArea(areaItem, areaIndex)"
  131. ghost
  132. size="small"
  133. type="primary"
  134. >展示产品</Button
  135. >
  136. </div>
  137. <div class="addAreaForm">
  138. <Form :label-width="100" :model="areaItem" style="width: 60%">
  139. <FormItem label="区域编码:">
  140. {{ areaItem.num }}
  141. </FormItem>
  142. <FormItem label="区域名称:">
  143. {{ areaItem.title }}
  144. </FormItem>
  145. <FormItem label="单位:">
  146. {{ areaItem.unit }}
  147. </FormItem>
  148. <FormItem label="工程量:">
  149. {{ areaItem.quantity }}
  150. </FormItem>
  151. <FormItem label="户型:">
  152. {{ areaItem.house_type }}
  153. </FormItem>
  154. <FormItem
  155. v-for="item in areaItem.special"
  156. :key="item.id"
  157. :label="item.key + ':'"
  158. >
  159. {{ item.value }}
  160. </FormItem>
  161. <FormItem label="备注:">
  162. {{ areaItem.remark }}
  163. </FormItem>
  164. </Form>
  165. </div>
  166. <div class="addAreaTable">
  167. <Table
  168. :columns="tableColumns"
  169. :data="areaItem.product"
  170. max-height="600"
  171. border
  172. >
  173. </Table>
  174. </div>
  175. </div>
  176. <li v-show="false" v-for="item in formData.list" :key="item.id"></li>
  177. </TabPane>
  178. <TabPane
  179. label="列表形式"
  180. name="name2"
  181. style="overflow: hidden; overflow-y: auto"
  182. >
  183. <div class="top_search">
  184. <Form :model="formData" :label-width="100" class="top_search_form">
  185. <FormItem label="订单号:">
  186. {{ formData.order_no }}
  187. </FormItem>
  188. <FormItem label="项目名称:">
  189. {{ formData.residential_name }}
  190. </FormItem>
  191. <FormItem label="客户姓名:">
  192. {{ formData.client_name }}
  193. </FormItem>
  194. <FormItem label="紧急程度:">
  195. <span
  196. v-for="_item in warningList"
  197. :key="_item.id"
  198. v-show="_item.id == formData.warning_state"
  199. :style="{ color: _item.color }"
  200. >{{ _item.title }}
  201. </span>
  202. </FormItem>
  203. <FormItem label="项目定金:">
  204. {{ formData.front_money }}
  205. <!-- <RadioGroup v-model="formData.pay_state"
  206. size="small">
  207. <Radio :label=0
  208. :disabled="isChecked">未收款</Radio>
  209. <Radio :label=1
  210. :disabled="isChecked">已收款</Radio>
  211. </RadioGroup> -->
  212. </FormItem>
  213. <FormItem label="详细地址:">
  214. {{ formData.address }}
  215. </FormItem>
  216. <FormItem label="手机号:">
  217. {{ formData.mobile }}
  218. </FormItem>
  219. <FormItem label="开始日期:">
  220. {{
  221. formData.start_time
  222. ? func.replaceDateNoHMS(formData.start_time)
  223. : ""
  224. }}
  225. </FormItem>
  226. <FormItem label="结束日期:">
  227. {{
  228. formData.end_time
  229. ? func.replaceDateNoHMS(formData.end_time)
  230. : ""
  231. }}
  232. </FormItem>
  233. <FormItem label="业务员:">
  234. <span
  235. v-for="_item in salesmanList"
  236. :key="_item.id"
  237. v-show="_item.id == formData.salesman"
  238. :style="{ color: _item.color }"
  239. >{{ _item.nickname }}
  240. </span>
  241. </FormItem>
  242. <!-- <FormItem label="订单类型:">
  243. <Select v-model="formData.type"
  244. :disabled="isChecked"
  245. size="small"
  246. style="width:200px">
  247. <Option label='工装'
  248. :value=1></Option>
  249. <Option label='家装'
  250. :value=2></Option>
  251. </Select>
  252. </FormItem> -->
  253. <FormItem
  254. v-for="item in formData.special"
  255. :key="item.id"
  256. :label="item.key + ':'"
  257. >
  258. {{ item.value }}
  259. </FormItem>
  260. <FormItem label="备注:">
  261. {{ formData.remark }}
  262. </FormItem>
  263. </Form>
  264. </div>
  265. <div>
  266. <Table
  267. :columns="listTableColumns"
  268. :data="listTableData"
  269. @on-selection-change="handleSelection"
  270. :max-height="500"
  271. border
  272. >
  273. </Table>
  274. </div>
  275. <div ref="footercenter" class="footer-center">
  276. <Page
  277. :total="total"
  278. :current.sync="page_index"
  279. :show-total="true"
  280. :page-size="page_size"
  281. :show-sizer="true"
  282. :show-elevator="true"
  283. @on-change="changePage"
  284. @on-page-size-change="changeSize"
  285. >
  286. </Page>
  287. </div>
  288. </TabPane>
  289. </Tabs>
  290. <!-- 项目辅料弹窗 -->
  291. <Modal title="项目辅料" v-model="showSupModal" :width="400">
  292. <div>
  293. <Table :columns="supTableColumns" :data="supTableData" border>
  294. <template slot="combine" slot-scope="{ index }">
  295. <Select
  296. v-model="supTableData[index].id"
  297. @on-change="handlechange"
  298. size="small"
  299. >
  300. <Option
  301. v-for="item in combineList"
  302. :value="item.id"
  303. :key="item.id"
  304. :label="item.title"
  305. ></Option>
  306. </Select>
  307. </template>
  308. <template slot="supSet" slot-scope="{ row, index }">
  309. <a
  310. style="margin: 0 5px; color: red"
  311. v-show="$route.query.type != 3"
  312. @click="handleSupSet(row, index)"
  313. >删除</a
  314. >
  315. </template>
  316. </Table>
  317. </div>
  318. <div class="modal-footer" slot="footer">
  319. <Button @click="showSupModal = false">取消</Button>
  320. <Button type="primary" @click="showSupModal = false">确认</Button>
  321. </div>
  322. </Modal>
  323. <!-- 编辑产品弹窗 -->
  324. <Modal
  325. title="编辑产品"
  326. v-model="showPDTEditModal"
  327. :mask-closable="false"
  328. class="addPDTFormModal"
  329. :width="1000"
  330. >
  331. <div class="modal-footer" slot="footer"></div>
  332. </Modal>
  333. <!-- 特殊字段弹窗 -->
  334. <Modal
  335. title="特殊字段"
  336. v-model="showAddInputModal"
  337. :mask-closable="false"
  338. class="addInputClassModal"
  339. :width="600"
  340. >
  341. <div class="addInputClass">
  342. <Tabs value="name1">
  343. <TabPane label="订单特殊字段" name="name1">
  344. <div style="display: flex; justify-content: center">
  345. <span
  346. class="dele_icon"
  347. @click="handleSpecValueAdd('', 1)"
  348. style="text-align: center; width: 50px"
  349. >添加
  350. </span>
  351. </div>
  352. <div class="addInputClassTab">
  353. <div v-for="(item, index) in contactSpecValueList" :key="index">
  354. <span>特殊字段名:</span>
  355. <Input
  356. type="text"
  357. size="small"
  358. v-model="item.key"
  359. placeholder="请输入"
  360. style="width: 120px"
  361. />
  362. <span class="dele_icon" style="margin-right: 5px">
  363. <Icon type="md-add" @click="handleSpecValueAdd(item, 1)" />
  364. </span>
  365. <span class="dele_icon">
  366. <Icon
  367. type="md-remove"
  368. @click="handleSpecValueDele(index, 1)"
  369. />
  370. </span>
  371. </div>
  372. </div>
  373. </TabPane>
  374. <TabPane label="区域特殊字段" name="name2">
  375. <div style="display: flex; justify-content: center">
  376. <span
  377. class="dele_icon"
  378. @click="handleSpecValueAdd('', 2)"
  379. style="text-align: center; width: 50px"
  380. >添加
  381. </span>
  382. </div>
  383. <div class="addInputClassTab">
  384. <div v-for="(item, index) in areaSpecValueList" :key="index">
  385. <span>特殊字段名:</span>
  386. <Input
  387. type="text"
  388. size="small"
  389. v-model="item.key"
  390. placeholder="请输入"
  391. style="width: 120px"
  392. />
  393. <span class="dele_icon" style="margin-right: 5px">
  394. <Icon type="md-add" @click="handleSpecValueAdd(item, 2)" />
  395. </span>
  396. <span class="dele_icon">
  397. <Icon
  398. type="md-remove"
  399. @click="handleSpecValueDele(index, 2)"
  400. />
  401. </span>
  402. </div>
  403. </div>
  404. </TabPane>
  405. <TabPane label="产品特殊字段" name="name3">
  406. <div style="display: flex; justify-content: center">
  407. <span
  408. class="dele_icon"
  409. @click="handleSpecValueAdd('', 3)"
  410. style="text-align: center; width: 50px"
  411. >添加
  412. </span>
  413. </div>
  414. <div class="addInputClassTab">
  415. <div v-for="(item, index) in productSpecValueList" :key="index">
  416. <span>特殊字段名:</span>
  417. <Input
  418. type="text"
  419. size="small"
  420. v-model="item.key"
  421. placeholder="请输入"
  422. style="width: 120px"
  423. />
  424. <span class="dele_icon" style="margin-right: 5px">
  425. <Icon type="md-add" @click="handleSpecValueAdd(item, 3)" />
  426. </span>
  427. <span class="dele_icon">
  428. <Icon
  429. type="md-remove"
  430. @click="handleSpecValueDele(index, 3)"
  431. />
  432. </span>
  433. </div>
  434. </div>
  435. </TabPane>
  436. </Tabs>
  437. <!-- <Form :label-width="100">
  438. <FormItem label="请输入字段名:">
  439. <Input type="text"
  440. size="small"
  441. v-model="addInputName"
  442. placeholder="请输入"
  443. style="width: 200px" />
  444. </FormItem>
  445. </Form> -->
  446. </div>
  447. <div class="modal-footer" slot="footer">
  448. <Button @click="showAddInputModal = false">取消</Button>
  449. <Button type="primary" @click="handleAddInputConfirm">确认</Button>
  450. </div>
  451. </Modal>
  452. <!-- 批量下深化 -->
  453. <Modal
  454. v-model="processModal"
  455. title="下深化"
  456. @on-ok="handleProcess"
  457. @on-cancel="processModal = false"
  458. >
  459. <div>
  460. <div class="process_modal">
  461. <span>深化人员:</span>
  462. <Select v-model="process_man" style="width: 150px">
  463. <Option
  464. v-for="item in processManList"
  465. :key="item.id"
  466. :label="item.nickname"
  467. :value="item.id"
  468. ></Option>
  469. </Select>
  470. </div>
  471. <div class="process_modal">
  472. <span>选择时间:</span>
  473. <DatePicker
  474. type="date"
  475. v-model="process_start_time"
  476. placeholder="年/月/日"
  477. style="width: 150px"
  478. ></DatePicker>
  479. <DatePicker
  480. type="date"
  481. v-model="process_end_time"
  482. placeholder="年/月/日"
  483. style="width: 150px"
  484. ></DatePicker>
  485. </div>
  486. </div>
  487. </Modal>
  488. </div>
  489. </template>
  490. <script>
  491. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  492. // 例如:import 《组件名称》 from '《组件路径》';
  493. export default {
  494. name: "BidSystemContractInfo",
  495. components: {},
  496. props: {},
  497. // import引入的组件需要注入到对象中才能使用
  498. data() {
  499. // 这里存放数据
  500. return {
  501. showSupModal: false,
  502. showPDTEditModal: false,
  503. options: {
  504. disabledDate(date) {
  505. return date && date.valueOf() < Date.now() - 86400000;
  506. },
  507. },
  508. formData: {
  509. order_no: "",
  510. residential_name: "",
  511. client_name: "",
  512. address: "",
  513. mobile: "",
  514. pay_state: "",
  515. warning_state: "",
  516. salesman: "",
  517. remark: "",
  518. start_time: "",
  519. end_time: "",
  520. type: "",
  521. special: [],
  522. head: [],
  523. //区域列表
  524. list: [
  525. {
  526. areaIndex: null,
  527. num: "",
  528. title: "",
  529. unit: "",
  530. quantity: "",
  531. house_type: "",
  532. remark: "",
  533. order_no: "",
  534. product: [],
  535. },
  536. ],
  537. },
  538. tableColumns: [
  539. { title: "序号", key: "index", align: "center", minWidth: 80 },
  540. {
  541. title: "产品名称",
  542. key: "title",
  543. align: "center",
  544. tooltip: true,
  545. minWidth: 100,
  546. },
  547. { title: "数量", key: "num", align: "center", minWidth: 80 },
  548. { title: "价格", key: "price", align: "center", minWidth: 80 },
  549. {
  550. title: "规格",
  551. key: "measure",
  552. align: "center",
  553. tooltip: true,
  554. minWidth: 140,
  555. },
  556. {
  557. title: "工艺属性",
  558. key: "process_property",
  559. align: "center",
  560. tooltip: true,
  561. minWidth: 120,
  562. },
  563. {
  564. title: "图纸",
  565. align: "center",
  566. key: "url",
  567. minWidth: 100,
  568. render: (h, params) => {
  569. const { row } = params;
  570. let url = row.url ? row.url : [];
  571. return h("img", {
  572. attrs: {
  573. src: this.$store.state.ip + url[0],
  574. style:
  575. "max-width:50px;max-height:50px;position:relative;top:3px;",
  576. },
  577. on: {
  578. click: (e) => {
  579. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  580. // row.imgs = res.data
  581. let list = [];
  582. row.url.forEach((el) => {
  583. list.push({ img_url: el });
  584. });
  585. this.$previewImg({
  586. list,
  587. baseUrl: this.$store.state.ip,
  588. baseImgField: "img_url",
  589. baseTitleField: "",
  590. });
  591. // })
  592. },
  593. },
  594. });
  595. },
  596. },
  597. {
  598. title: "图号",
  599. key: "url_number",
  600. align: "center",
  601. tooltip: true,
  602. minWidth: 80,
  603. },
  604. { title: "备注", key: "remark", align: "center", minWidth: 80 },
  605. ],
  606. supTableColumns: [
  607. { title: "序号", key: "index", align: "center" },
  608. {
  609. title: "辅料名称",
  610. key: "title",
  611. align: "center",
  612. slot: "combine",
  613. minWidth: 60,
  614. },
  615. { title: "操作", key: "set", align: "center", slot: "supSet" },
  616. ],
  617. listTableColumns: [
  618. { type: "selection", align: "center", minWidth: 100 },
  619. { title: "区域编码", key: "area_num", align: "center", minWidth: 100 },
  620. {
  621. title: "区域名称",
  622. key: "area_title",
  623. align: "center",
  624. minWidth: 100,
  625. },
  626. { title: "单位", key: "area_unit", align: "center", minWidth: 100 },
  627. {
  628. title: "工程量",
  629. key: "area_quantity",
  630. align: "center",
  631. minWidth: 100,
  632. },
  633. { title: "户型", key: "house_type", align: "center", minWidth: 100 },
  634. { title: "备注", key: "area_remark", align: "center", minWidth: 100 },
  635. { title: "产品名称", key: "title", align: "center", minWidth: 100 },
  636. { title: "数量", key: "num", align: "center", minWidth: 100 },
  637. { title: "价格", key: "price", align: "center", minWidth: 100 },
  638. { title: "规格", key: "measure", align: "center", minWidth: 100 },
  639. {
  640. title: "工艺属性",
  641. key: "process_property",
  642. align: "center",
  643. minWidth: 100,
  644. },
  645. {
  646. title: "图纸",
  647. key: "url",
  648. align: "center",
  649. minWidth: 100,
  650. render: (h, params) => {
  651. const { row } = params;
  652. let url = row.url ? row.url : [];
  653. return h("img", {
  654. attrs: {
  655. src:
  656. url.length > 0 ? this.$store.state.ip + url[0].img_url : "",
  657. style:
  658. "max-width:50px;max-height:50px;position:relative;top:3px;",
  659. },
  660. on: {
  661. click: () => {
  662. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  663. // row.imgs = res.data
  664. let list = [];
  665. row.url.forEach((el) => {
  666. list.push({ img_url: el });
  667. });
  668. this.$previewImg({
  669. list,
  670. baseUrl: this.$store.state.ip,
  671. baseImgField: "img_url",
  672. baseTitleField: "",
  673. });
  674. // })
  675. },
  676. },
  677. });
  678. },
  679. },
  680. { title: "左右式", key: "title", align: "center", minWidth: 100 },
  681. { title: "图号", key: "url_number", align: "center", minWidth: 100 },
  682. { title: "备注", key: "remark", align: "center", minWidth: 100 },
  683. ],
  684. listTableData: [],
  685. supTableData: [],
  686. PDTTypeList: [], //产品分类列表
  687. PDTEditTypeList: [],
  688. combineList: [], //项目辅料→辅料名称列表
  689. salesmanList: [], //业务员列表
  690. //是否查看
  691. isChecked: false,
  692. PDTProcessAttrList: [],
  693. // 测量字段列表
  694. measureList: [],
  695. contactForm: [],
  696. addInputTitle: "",
  697. showAddInputModal: false,
  698. addInputName: "",
  699. contactSpecValueList: [],
  700. areaSpecValueList: [],
  701. productSpecValueList: [],
  702. warningList: [],
  703. currencyTab: "",
  704. processModal: false,
  705. processManList: [],
  706. process_man: "",
  707. process_start_time: "",
  708. process_end_time: "",
  709. selected: [],
  710. page_index: 1,
  711. page_size: 10,
  712. total: 0,
  713. };
  714. },
  715. // 生命周期 - 创建完成(可以访问当前this实例)
  716. created() {
  717. //2编辑 3详情 0新增
  718. this.$route.query.type == 3 ? (this.isChecked = true) : "";
  719. this.$route.query.order_no
  720. ? (this.formData.order_no = this.$route.query.order_no)
  721. : "";
  722. // 获取工艺属性
  723. this.axios("/api/basics_properties_index").then((res) => {
  724. this.PDTProcessAttrList = res.data.data;
  725. });
  726. // 获取紧急程度
  727. this.axios.get("/api/warning_list").then((res) => {
  728. this.warningList = res.data.data;
  729. });
  730. },
  731. // 生命周期 - 挂载完成(可以访问DOM元素)
  732. mounted() {
  733. this.$route.query.type == 3 || this.$route.query.type == 2
  734. ? this.initData(this.$route.query.order_no)
  735. : "";
  736. //获取操作员
  737. this.axios("/api/user").then(
  738. (res) => (
  739. (this.salesmanList = res.data.data),
  740. (this.processManList = res.data.data)
  741. )
  742. );
  743. //获取产品分类下拉列表
  744. this.axios("/api/parts_product_list").then((res) => {
  745. this.PDTTypeList = res.data;
  746. this.PDTTypeList.forEach((el) => {
  747. el.value = el.id;
  748. el.label = el.title;
  749. });
  750. this.PDTEditTypeList = this.PDTTypeList;
  751. });
  752. //获取基础测量字段列表
  753. this.axios("/api/basics_measure_index").then((res) => {
  754. this.measureList = res.data.data;
  755. });
  756. // 获取项目辅料列表
  757. this.axios("/api/material_combination").then((res) => {
  758. this.combineList = res.data.data;
  759. });
  760. },
  761. methods: {
  762. handlechange(val) {
  763. console.log("val :>> ", val);
  764. },
  765. initData(order_no) {
  766. this.axios({
  767. method: "get",
  768. url: "/api/order_area_list",
  769. params: {
  770. order_no,
  771. },
  772. }).then((res) => {
  773. if (res.code == 200) {
  774. this.formData = res.data;
  775. if (this.formData.list.length == 0) {
  776. this.formData.list.push({
  777. areaIndex: 1,
  778. num: "",
  779. title: "",
  780. unit: "",
  781. quantity: "",
  782. house_type: "",
  783. remark: "",
  784. order_no: "",
  785. special: [],
  786. head: [],
  787. product: [
  788. {
  789. title: "",
  790. num: "",
  791. measure: "",
  792. process_property: "",
  793. special: [],
  794. url: [],
  795. url_number: "",
  796. remark: "",
  797. },
  798. ],
  799. });
  800. }
  801. this.formData.start_time = this.func.replaceDateNoHMS(
  802. this.formData.start_time
  803. );
  804. this.formData.end_time = this.func.replaceDateNoHMS(
  805. this.formData.end_time
  806. );
  807. // 产品特殊字段→ 弹窗窗口,table表头
  808. let arr = [];
  809. res.data.head[3] &&
  810. res.data.head[3].forEach((item) => {
  811. // ele[key] = item.key
  812. arr.push({
  813. title: item.key,
  814. key: item.key,
  815. align: "center",
  816. minWidth: 80,
  817. });
  818. });
  819. this.tableColumns = [
  820. { title: "序号", key: "index", align: "center", minWidth: 80 },
  821. {
  822. title: "产品名称",
  823. key: "title",
  824. align: "center",
  825. tooltip: true,
  826. minWidth: 100,
  827. },
  828. { title: "数量", key: "num", align: "center", minWidth: 80 },
  829. { title: "价格", key: "price", align: "center", minWidth: 80 },
  830. {
  831. title: "规格",
  832. key: "measure",
  833. align: "center",
  834. tooltip: true,
  835. minWidth: 140,
  836. },
  837. {
  838. title: "工艺属性",
  839. key: "process_property",
  840. align: "center",
  841. tooltip: true,
  842. minWidth: 120,
  843. },
  844. {
  845. title: "图纸",
  846. align: "center",
  847. key: "url",
  848. minWidth: 100,
  849. render: (h, params) => {
  850. const { row } = params;
  851. let url = row.url ? row.url : [];
  852. return h("img", {
  853. attrs: {
  854. src: this.$store.state.ip + url[0],
  855. style:
  856. "max-width:50px;max-height:50px;position:relative;top:3px;",
  857. },
  858. on: {
  859. click: (e) => {
  860. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  861. // row.imgs = res.data
  862. let list = [];
  863. row.url.forEach((el) => {
  864. list.push({ img_url: el });
  865. });
  866. this.$previewImg({
  867. list,
  868. baseUrl: this.$store.state.ip,
  869. baseImgField: "img_url",
  870. baseTitleField: "",
  871. });
  872. // })
  873. },
  874. },
  875. });
  876. },
  877. },
  878. {
  879. title: "图号",
  880. key: "url_number",
  881. align: "center",
  882. tooltip: true,
  883. minWidth: 80,
  884. },
  885. ...arr,
  886. { title: "备注", key: "remark", align: "center", minWidth: 80 },
  887. ];
  888. // 订单特殊字段
  889. this.formData.special &&
  890. this.formData.special.forEach((element) => {
  891. this.formData.head[1].forEach((item) => {
  892. if (element.head_id == item.id) {
  893. element = Object.assign(element, item);
  894. this.contactSpecValueList.push(element);
  895. }
  896. });
  897. });
  898. this.contactForm = this.formData.head[1] ? this.formData.head[1] : [];
  899. // 区域特殊字段
  900. this.formData.list.forEach((element, index) => {
  901. element.special &&
  902. element.special.forEach((ele) => {
  903. this.formData.head[2].forEach((item) => {
  904. if (ele.head_id == item.id) {
  905. ele = Object.assign(ele, item);
  906. this.areaSpecValueList.push(ele);
  907. }
  908. });
  909. });
  910. if (index == 0) {
  911. element.isCurrencyArea = true;
  912. //编辑进入页面是展示第一条区域的产品
  913. element.id &&
  914. this.axios
  915. .get("/api/order_area_list_product", {
  916. params: {
  917. order_no: this.$route.query.order_no,
  918. area_id: element.id,
  919. },
  920. })
  921. .then((res) => {
  922. if (res.code == 200) {
  923. if (!element.product) {
  924. element.product = [];
  925. }
  926. element.product = res.data;
  927. element.product.forEach((pdt, index) => {
  928. if (!pdt.url) {
  929. pdt.url = [];
  930. }
  931. pdt.index = index + 1;
  932. pdt.special &&
  933. pdt.special.length > 0 &&
  934. pdt.special.forEach((_pdt) => {
  935. this.formData.head[3].forEach((element) => {
  936. if (_pdt.head_id == element.id) {
  937. _pdt = Object.assign(_pdt, element);
  938. pdt[_pdt.key] = _pdt.value;
  939. this.productSpecValueList.push(_pdt);
  940. }
  941. });
  942. });
  943. });
  944. this.$forceUpdate();
  945. }
  946. });
  947. } else {
  948. element.isCurrencyArea = false;
  949. }
  950. });
  951. this.areaSpecValueList = this.formData.head[2]
  952. ? this.formData.head[2]
  953. : [];
  954. this.productSpecValueList = this.formData.head[3]
  955. ? this.formData.head[3]
  956. : [];
  957. }
  958. });
  959. },
  960. //项目辅料删除
  961. handleSupSet(row, index) {
  962. this.supTableData.splice(index, 1);
  963. // this.supTableData.forEach((element, index) => {
  964. // element.index = index + 1
  965. // });
  966. },
  967. goback() {
  968. this.$router.go(-1);
  969. },
  970. looks(img) {
  971. const array = [{ img_url: img }];
  972. this.$previewImg({
  973. list: array,
  974. baseUrl: this.$store.state.ip,
  975. baseImgField: "img_url",
  976. baseTitleField: "",
  977. });
  978. },
  979. delItems(n, arr) {
  980. arr.splice(n, 1);
  981. },
  982. changeIpt(e, row) {
  983. let file = e.target.files[0];
  984. this.postImg(file, row);
  985. e.target.value = null;
  986. },
  987. postImg(file, row) {
  988. let formData = new FormData();
  989. formData.append("file", file);
  990. this.axios.post("/api/upload_pic", formData).then((res) => {
  991. this.$nextTick(() => {
  992. row.push(res.data.url);
  993. this.$forceUpdate();
  994. });
  995. });
  996. },
  997. // 添加特殊字段
  998. handleAddInputConfirm() {
  999. this.formData.special = JSON.parse(
  1000. JSON.stringify(this.contactSpecValueList)
  1001. );
  1002. this.formData.list.forEach((element) => {
  1003. element.special = JSON.parse(JSON.stringify(this.areaSpecValueList));
  1004. element.product.forEach((ele) => {
  1005. ele.special = JSON.parse(JSON.stringify(this.productSpecValueList));
  1006. });
  1007. });
  1008. let arr = [];
  1009. this.productSpecValueList.forEach((element) => {
  1010. arr.push({
  1011. title: element.key,
  1012. key: element.key,
  1013. align: "center",
  1014. minWidth: 80,
  1015. });
  1016. });
  1017. this.tableColumns = [
  1018. { title: "序号", key: "index", align: "center", minWidth: 80 },
  1019. {
  1020. title: "产品名称",
  1021. key: "title",
  1022. align: "center",
  1023. tooltip: true,
  1024. minWidth: 100,
  1025. },
  1026. { title: "数量", key: "num", align: "center", minWidth: 80 },
  1027. { title: "价格", key: "price", align: "center", minWidth: 80 },
  1028. {
  1029. title: "规格",
  1030. key: "measure",
  1031. align: "center",
  1032. tooltip: true,
  1033. minWidth: 140,
  1034. },
  1035. {
  1036. title: "工艺属性",
  1037. key: "process_property",
  1038. align: "center",
  1039. tooltip: true,
  1040. minWidth: 120,
  1041. },
  1042. {
  1043. title: "图纸",
  1044. align: "center",
  1045. key: "url",
  1046. minWidth: 100,
  1047. render: (h, params) => {
  1048. const { row } = params;
  1049. let url = row.url ? row.url : [];
  1050. return h("img", {
  1051. attrs: {
  1052. src: this.$store.state.ip + url[0],
  1053. style:
  1054. "max-width:50px;max-height:50px;position:relative;top:3px;",
  1055. },
  1056. on: {
  1057. click: (e) => {
  1058. // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  1059. // row.imgs = res.data
  1060. let list = [];
  1061. row.url.forEach((el) => {
  1062. list.push({ img_url: el });
  1063. });
  1064. this.$previewImg({
  1065. list,
  1066. baseUrl: this.$store.state.ip,
  1067. baseImgField: "img_url",
  1068. baseTitleField: "",
  1069. });
  1070. // })
  1071. },
  1072. },
  1073. });
  1074. },
  1075. },
  1076. {
  1077. title: "图号",
  1078. key: "url_number",
  1079. align: "center",
  1080. tooltip: true,
  1081. minWidth: 80,
  1082. },
  1083. ...arr,
  1084. { title: "备注", key: "remark", align: "center", minWidth: 80 },
  1085. ];
  1086. this.showAddInputModal = false;
  1087. },
  1088. // 添加特殊字段
  1089. handleSpecValueAdd(item, type) {
  1090. switch (type) {
  1091. case 1:
  1092. this.contactSpecValueList.push({ key: "", value: "" });
  1093. break;
  1094. case 2:
  1095. this.areaSpecValueList.push({ key: "", value: "" });
  1096. break;
  1097. case 3:
  1098. this.productSpecValueList.push({ key: "", value: "" });
  1099. break;
  1100. }
  1101. },
  1102. // 删除特殊字段
  1103. handleSpecValueDele(index, type) {
  1104. switch (type) {
  1105. case 1:
  1106. this.contactSpecValueList.splice(index, 1);
  1107. break;
  1108. case 2:
  1109. this.areaSpecValueList.splice(index, 1);
  1110. break;
  1111. case 3:
  1112. this.productSpecValueList.splice(index, 1);
  1113. break;
  1114. }
  1115. },
  1116. getListData() {
  1117. this.axios
  1118. .get("/api/order_area_detail_list?", {
  1119. params: { order_no: this.$route.query.order_no },
  1120. })
  1121. .then((res) => {
  1122. this.listTableData = res.data.data;
  1123. this.listTableData.map((item) => {
  1124. !item.url && (item.url = []);
  1125. res.data.imgs.map((element) => {
  1126. if (item.sign_id == element.sign_id) {
  1127. item.url.push({ img_url: element.img_url });
  1128. }
  1129. });
  1130. });
  1131. this.total = res.data.total;
  1132. this.$forceUpdate();
  1133. });
  1134. },
  1135. handleCurTabChange(name) {
  1136. this.currencyTab = name;
  1137. if (name == "name2" && this.listTableData.length < 1) {
  1138. this.getListData();
  1139. }
  1140. },
  1141. handleSelection(selection) {
  1142. this.selected = selection;
  1143. },
  1144. handleOpenModal() {
  1145. if (this.selected.length < 1) {
  1146. this.$Message.warning("请选择数据");
  1147. } else {
  1148. this.processModal = true;
  1149. }
  1150. },
  1151. handleProcess() {
  1152. const order_area_product_id = this.selected.map(
  1153. (item) => item.order_area_product_id
  1154. );
  1155. this.axios({
  1156. method: "get",
  1157. url: "/api/order_area_detail_pull",
  1158. params: {
  1159. order_no: this.order_no,
  1160. type: 1,
  1161. order_area_product_id,
  1162. process_man: this.process_man,
  1163. process_start_time: this.process_start_time
  1164. ? this.func.replaceDateNoHMS(this.process_start_time)
  1165. : "",
  1166. process_end_time: this.process_end_time
  1167. ? this.func.replaceDateNoHMS(this.process_end_time)
  1168. : "",
  1169. },
  1170. }).then((res) => {
  1171. if (res.code == 200) {
  1172. this.$Message.success(res.msg);
  1173. this.getListData();
  1174. }
  1175. });
  1176. },
  1177. changePage(e) {
  1178. this.page_index = e;
  1179. this.getListData();
  1180. },
  1181. changeSize(e) {
  1182. this.page_size = e;
  1183. this.getListData();
  1184. },
  1185. // 展示区域产品
  1186. handleShowCurrencyArea(item, index) {
  1187. const preObj = this.formData.list.filter((item) => item.isCurrencyArea);
  1188. // 判断当前打开是否与上一个是否一致
  1189. if (preObj[0].id != item.id) {
  1190. // 1.保存上一个展开的区域及产品
  1191. this.axios
  1192. .post("/api/order_area_product_edit", {
  1193. order_no: this.$route.query.order_no,
  1194. area_id: preObj[0].id || "",
  1195. product: preObj[0].product,
  1196. })
  1197. .then((result) => {
  1198. if (result.code == 200) {
  1199. preObj[0].id = result.data.area_id;
  1200. // 1.1移除上一个展开区域及产品
  1201. this.formData.list.forEach((element) => {
  1202. element.product = [];
  1203. if (element.id == preObj[0].id) {
  1204. element.isCurrencyArea = false;
  1205. }
  1206. });
  1207. // 2.获取当前展开区域及产品
  1208. item.isCurrencyArea = true;
  1209. this.axios
  1210. .get("/api/order_area_list_product", {
  1211. params: {
  1212. order_no: this.$route.query.order_no,
  1213. area_id: item.id,
  1214. },
  1215. })
  1216. .then((res) => {
  1217. if (res.code == 200) {
  1218. if (!item.product) {
  1219. item.product = [];
  1220. }
  1221. item.product = res.data;
  1222. item.product.forEach((pdt, index) => {
  1223. pdt.index = index + 1;
  1224. pdt.special &&
  1225. pdt.special.length > 0 &&
  1226. pdt.special.forEach((element) => {
  1227. this.formData.head[3].forEach((item) => {
  1228. if (element.head_id == item.id) {
  1229. element = Object.assign(element, item);
  1230. pdt[element.key] = element.value;
  1231. this.productSpecValueList.push(element);
  1232. }
  1233. });
  1234. });
  1235. });
  1236. this.$forceUpdate();
  1237. }
  1238. });
  1239. }
  1240. });
  1241. } else {
  1242. // 2.获取当前展开区域及产品
  1243. item.isCurrencyArea = true;
  1244. this.axios
  1245. .get("/api/order_area_list_product", {
  1246. params: { order_no: this.$route.query.order_no, area_id: item.id },
  1247. })
  1248. .then((res) => {
  1249. if (res.code == 200) {
  1250. if (!item.product) {
  1251. item.product = [];
  1252. }
  1253. item.product = res.data;
  1254. item.product.forEach((pdt, index) => {
  1255. pdt.index = index + 1;
  1256. pdt.special &&
  1257. pdt.special.length > 0 &&
  1258. pdt.special.forEach((element) => {
  1259. this.formData.head[3].forEach((item) => {
  1260. if (element.head_id == item.id) {
  1261. element = Object.assign(element, item);
  1262. pdt[element.key] = element.value;
  1263. this.productSpecValueList.push(element);
  1264. }
  1265. });
  1266. });
  1267. });
  1268. this.$forceUpdate();
  1269. }
  1270. });
  1271. }
  1272. },
  1273. },
  1274. // 监听属性 类似于data概念
  1275. computed: {},
  1276. // 监控data中的数据变化
  1277. watch: {},
  1278. beforeCreate() {}, // 生命周期 - 创建之前
  1279. beforeMount() {}, // 生命周期 - 挂载之前
  1280. beforeUpdate() {}, // 生命周期 - 更新之前
  1281. updated() {}, // 生命周期 - 更新之后
  1282. beforeDestroy() {}, // 生命周期 - 销毁之前
  1283. destroyed() {}, // 生命周期 - 销毁完成
  1284. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  1285. };
  1286. </script>
  1287. <style lang="scss" scoped>
  1288. .BidSystemContractInfo {
  1289. overflow: hidden;
  1290. overflow-y: auto;
  1291. position: relative;
  1292. top: 20px;
  1293. height: 85%;
  1294. padding-bottom: 20px;
  1295. }
  1296. .footer-center {
  1297. display: flex;
  1298. justify-content: center;
  1299. padding: 10px 0;
  1300. }
  1301. .top_search {
  1302. padding: 20px 0;
  1303. width: 100%;
  1304. .top_search_form {
  1305. // width: 800px;
  1306. // display: flex;
  1307. // justify-content: space-around;
  1308. /deep/ .ivu-form-item {
  1309. display: inline-block;
  1310. width: 300px;
  1311. }
  1312. }
  1313. }
  1314. .addArea {
  1315. position: relative;
  1316. padding: 15px;
  1317. margin: 5px;
  1318. margin-bottom: 30px;
  1319. border-radius: 5px;
  1320. box-shadow: 1px 1px 5px 1px #999;
  1321. .addAreaBtn {
  1322. position: absolute;
  1323. right: 20px;
  1324. top: 20px;
  1325. }
  1326. /deep/ .ivu-form-item {
  1327. display: inline-block;
  1328. width: 220px;
  1329. }
  1330. }
  1331. .addPDTFormModal {
  1332. .addPDTForm {
  1333. width: 100%;
  1334. position: relative;
  1335. border-bottom: 1px solid #e8eaec;
  1336. margin-bottom: 30px;
  1337. /deep/ .ivu-form-item {
  1338. display: inline-block;
  1339. width: 300px;
  1340. }
  1341. .addPDTBtn {
  1342. position: absolute;
  1343. right: 10px;
  1344. bottom: 25px;
  1345. }
  1346. }
  1347. /deep/ .ivu-modal-body {
  1348. display: flex;
  1349. justify-content: center;
  1350. flex-wrap: wrap;
  1351. max-height: 700px;
  1352. overflow: hidden;
  1353. overflow-y: auto;
  1354. }
  1355. }
  1356. .addPDTProcess {
  1357. width: 300px;
  1358. padding-bottom: 15px;
  1359. div {
  1360. display: flex;
  1361. justify-content: space-around;
  1362. padding: 5px 0;
  1363. span {
  1364. padding-top: 6px;
  1365. }
  1366. }
  1367. .dele_icon {
  1368. width: 10px;
  1369. /deep/ .ivu-icon {
  1370. padding-top: 5px;
  1371. }
  1372. }
  1373. }
  1374. .product-img {
  1375. padding-top: 10px;
  1376. }
  1377. .product-add {
  1378. display: flex;
  1379. flex-wrap: wrap;
  1380. .ipt {
  1381. position: absolute;
  1382. width: 100%;
  1383. height: 100%;
  1384. opacity: 0;
  1385. cursor: pointer;
  1386. outline: none;
  1387. top: 0;
  1388. left: 0;
  1389. }
  1390. .add-items {
  1391. width: 40px;
  1392. height: 40px;
  1393. border: 1px dotted #e7e7e7;
  1394. border-radius: 5px;
  1395. display: flex;
  1396. justify-content: center;
  1397. align-items: center;
  1398. overflow: hidden;
  1399. position: relative;
  1400. flex-direction: column;
  1401. background: #f4f5f7;
  1402. .item {
  1403. width: 46px;
  1404. height: 46px;
  1405. background: #3764ff;
  1406. opacity: 0.6;
  1407. display: flex;
  1408. justify-content: center;
  1409. align-items: center;
  1410. border-radius: 50%;
  1411. color: #fff;
  1412. }
  1413. }
  1414. .items {
  1415. width: 40px;
  1416. height: 40px;
  1417. margin-bottom: 10px;
  1418. display: flex;
  1419. justify-content: center;
  1420. align-items: center;
  1421. background: #e7e7e7;
  1422. margin-right: 10px;
  1423. border-radius: 5px;
  1424. position: relative;
  1425. img {
  1426. max-width: 40px;
  1427. max-height: 40px;
  1428. }
  1429. }
  1430. }
  1431. .supModalBtn {
  1432. display: flex;
  1433. justify-content: flex-end;
  1434. margin-bottom: 10px;
  1435. }
  1436. /deep/.ivu-modal-body {
  1437. display: flex;
  1438. justify-content: center;
  1439. .addInputClass {
  1440. display: flex;
  1441. justify-content: center;
  1442. width: 500px;
  1443. .dele_icon {
  1444. cursor: pointer;
  1445. width: 10px;
  1446. /deep/ .ivu-icon {
  1447. padding-top: 5px;
  1448. }
  1449. }
  1450. }
  1451. }
  1452. .addInputClassTab {
  1453. display: flex;
  1454. justify-content: center;
  1455. align-items: center;
  1456. flex-wrap: wrap;
  1457. div {
  1458. display: flex;
  1459. justify-content: center;
  1460. align-items: center;
  1461. width: 100%;
  1462. padding: 5px;
  1463. .dele_icon {
  1464. i {
  1465. font-size: 20px;
  1466. }
  1467. }
  1468. }
  1469. }
  1470. /deep/.ivu-tabs-nav-scroll {
  1471. display: flex;
  1472. justify-content: center;
  1473. }
  1474. /deep/ .ivu-table-wrapper {
  1475. overflow: visible;
  1476. }
  1477. /deep/.ivu-table-fixed-body {
  1478. padding-bottom: 20px;
  1479. }
  1480. .process_modal {
  1481. display: flex;
  1482. justify-content: center;
  1483. align-items: center;
  1484. padding: 10px;
  1485. }
  1486. </style>