changeDetail.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960
  1. <template>
  2. <div class="changeDetail">
  3. <Toptitle title="变更">
  4. <slot name="titleButton">
  5. <Button
  6. @click="handleFinish()"
  7. type="primary"
  8. style="margin-right: 10px"
  9. >变更保存</Button
  10. >
  11. <Button
  12. @click="goback()"
  13. type="primary"
  14. ghost
  15. style="margin-right: 10px"
  16. >取消</Button
  17. >
  18. </slot>
  19. </Toptitle>
  20. <div>
  21. <div class="form">
  22. <div class="form_content">
  23. <Form
  24. :model="formData"
  25. :label-width="100"
  26. class="form_content_header"
  27. >
  28. <FormItem label="楼幢:">
  29. <Select
  30. filterable
  31. clearable
  32. v-model="formData.building"
  33. size="small"
  34. style="width: 120px"
  35. >
  36. <Option
  37. v-for="(_item, _index) in building_list"
  38. :key="_index"
  39. :label="_item"
  40. :value="_item"
  41. ></Option>
  42. </Select>
  43. </FormItem>
  44. <FormItem label="单元:">
  45. <Select
  46. filterable
  47. clearable
  48. v-model="formData.unit"
  49. size="small"
  50. style="width: 120px"
  51. >
  52. <Option
  53. v-for="(_item, _index) in unit_list"
  54. :key="_index"
  55. :label="_item"
  56. :value="_item"
  57. ></Option>
  58. </Select>
  59. </FormItem>
  60. <FormItem label="楼层:">
  61. <Select
  62. filterable
  63. clearable
  64. v-model="formData.floor"
  65. size="small"
  66. style="width: 120px"
  67. >
  68. <Option
  69. v-for="(_item, _index) in floor_list"
  70. :key="_index"
  71. :label="_item"
  72. :value="_item"
  73. ></Option>
  74. </Select>
  75. </FormItem>
  76. <FormItem label="房号:">
  77. <Select
  78. filterable
  79. clearable
  80. v-model="formData.room_number"
  81. size="small"
  82. style="width: 120px"
  83. >
  84. <Option
  85. v-for="(_item, _index) in room_number_list"
  86. :key="_index"
  87. :label="_item"
  88. :value="_item"
  89. ></Option>
  90. </Select>
  91. </FormItem>
  92. <FormItem label="产品名称:">
  93. <Select
  94. filterable
  95. clearable
  96. v-model="formData.product_title"
  97. size="small"
  98. style="width: 120px"
  99. >
  100. <Option
  101. v-for="(_item, _index) in product_title_list"
  102. :key="_index"
  103. :label="_item"
  104. :value="_item"
  105. ></Option>
  106. </Select>
  107. </FormItem>
  108. <FormItem label="图号:">
  109. <Select
  110. filterable
  111. clearable
  112. v-model="formData.pic_number"
  113. size="small"
  114. style="width: 120px"
  115. >
  116. <Option
  117. v-for="(_item, _index) in pic_number_list"
  118. :key="_index"
  119. :label="_item"
  120. :value="_item"
  121. ></Option>
  122. </Select>
  123. </FormItem>
  124. <FormItem>
  125. <Button @click="getListData" type="primary" size="small"
  126. >搜索</Button
  127. >
  128. </FormItem>
  129. </Form>
  130. <div class="top_search">
  131. <div><span>区域编码:</span>{{ formData.area_num }}</div>
  132. <div><span>区域名称:</span>{{ formData.area_title }}</div>
  133. <div><span>产品名称:</span>{{ formData.title }}</div>
  134. <div><span>数量:</span>{{ formData.num }}</div>
  135. <div><span>规格:</span>{{ formData.measure }}</div>
  136. <div><span>工艺属性:</span>{{ formData.process_property }}</div>
  137. <div><span>图号:</span>{{ formData.url_number }}</div>
  138. <div style="display:flex;width:auto">
  139. <span>图纸:</span>
  140. <div>
  141. <span
  142. v-for="item in formData.url"
  143. :key="item"
  144. @click="checkImg(formData.url)"
  145. >
  146. <img :src="$store.state.ip + item" alt="" style=" max-width: 100px; max-height: 100px;"/>
  147. </span>
  148. </div>
  149. </div>
  150. <div>
  151. <span>左右式:</span
  152. >{{
  153. formData.left_right_mode == 1
  154. ? "左式"
  155. : formData.left_right_mode == 2
  156. ? "右式"
  157. : "无"
  158. }}
  159. </div>
  160. <!-- <div><span>价格:</span>{{ formData.price }}</div> -->
  161. <div><span>备注:</span>{{ formData.remark }}</div>
  162. </div>
  163. </div>
  164. <div class="form_middle">
  165. <Form class="form_middle_content" :label-width="100">
  166. <FormItem label="联系单编号:">
  167. <Input
  168. placeholder="请输入单号"
  169. style="width: auto"
  170. v-model="formData.contact_order_no"
  171. ></Input>
  172. </FormItem>
  173. <FormItem label="原生产单编号:">
  174. <span
  175. style="width: auto"
  176. >{{this.$route.query.order_no}}</span>
  177. </FormItem>
  178. <FormItem label="接受部门:">
  179. <Select
  180. filterable
  181. clearable
  182. v-model="formData.depart_end"
  183. size="small"
  184. style="width: 120px"
  185. >
  186. <Option
  187. v-for="(item,index) in depart_list"
  188. :key="index"
  189. :label="item.title"
  190. :value="item.id"
  191. ></Option>
  192. </Select>
  193. </FormItem>
  194. <FormItem label="发出部门:">
  195. <Select
  196. filterable
  197. clearable
  198. v-model="formData.depart_start"
  199. size="small"
  200. style="width: 120px"
  201. >
  202. <Option
  203. v-for="(item, index) in depart_list"
  204. :key="index"
  205. :label="item.title"
  206. :value="item.id"
  207. ></Option>
  208. </Select>
  209. </FormItem>
  210. <FormItem label="更改性质:">
  211. <Input placeholder="请输入..." style="width: auto" v-model="formData.change_type"></Input>
  212. </FormItem>
  213. <FormItem label="变更原因:">
  214. <Input
  215. type="textarea"
  216. placeholder="请输入..."
  217. style="width: auto"
  218. v-model="formData.msg"
  219. ></Input>
  220. </FormItem>
  221. </Form>
  222. </div>
  223. </div>
  224. </div>
  225. <Card style="width: 100%">
  226. <div style="margin-left: 5px">
  227. <Button
  228. type="primary"
  229. size="small"
  230. style="width: 70px"
  231. @click="add_line"
  232. >增行</Button
  233. >
  234. </div>
  235. <Table :columns="tableColumns" :data="tableData" border>
  236. <template slot="houseSet" slot-scope="{ row, index }">
  237. <Input
  238. type="text"
  239. size="small"
  240. v-if="row.input_state"
  241. v-model="tableData[index].house"
  242. placeholder="楼栋"
  243. />
  244. <span v-else>{{ tableData[index].house }}</span>
  245. </template>
  246. <template slot="unitSet" slot-scope="{ row, index }">
  247. <Input
  248. type="text"
  249. size="small"
  250. v-if="row.input_state"
  251. v-model="tableData[index].unit"
  252. placeholder="单元"
  253. />
  254. <span v-else>{{ tableData[index].unit }}</span>
  255. </template>
  256. <template slot="layerSet" slot-scope="{ row, index }">
  257. <Input
  258. type="text"
  259. size="small"
  260. v-if="row.input_state"
  261. v-model="tableData[index].layer"
  262. placeholder="楼层"
  263. />
  264. <span v-else>{{ tableData[index].layer }}</span>
  265. </template>
  266. <template slot="numberSet" slot-scope="{ row, index }">
  267. <Input
  268. type="text"
  269. size="small"
  270. v-if="row.input_state"
  271. v-model="tableData[index].number"
  272. placeholder="房间号"
  273. />
  274. <span v-else>{{ tableData[index].number }}</span>
  275. </template>
  276. <template slot="type_titleSet" slot-scope="{ row, index }">
  277. <el-cascader
  278. v-if="row.input_state"
  279. v-model="tableData[index].type_id"
  280. size="small"
  281. :show-all-levels="false"
  282. :options="cascader_list"
  283. :props="{
  284. expandTrigger: 'hover',
  285. children: 'child',
  286. value: 'id',
  287. label: 'title',
  288. emitPath: false,
  289. checkStrictly: true,
  290. }"
  291. @change="handleTypeTitleChange"
  292. ></el-cascader>
  293. <!-- @change="changeProduct(tableData[index], index)" -->
  294. <span v-else>{{ tableData[index].type_title }}</span>
  295. </template>
  296. <template slot="titleSet" slot-scope="{ row, index }">
  297. <Input
  298. type="text"
  299. size="small"
  300. v-if="row.input_state"
  301. v-model="tableData[index].title"
  302. placeholder="产品"
  303. />
  304. <span v-else>{{ tableData[index].title }}</span>
  305. </template>
  306. <template slot="product_unitSet" slot-scope="{ row, index }">
  307. <Input
  308. type="text"
  309. size="small"
  310. v-if="row.input_state"
  311. v-model="tableData[index].product_unit"
  312. placeholder="单位"
  313. />
  314. <span v-else>{{ tableData[index].product_unit }}</span>
  315. </template>
  316. <template slot="positionSet" slot-scope="{ row, index }">
  317. <Input
  318. type="text"
  319. size="small"
  320. v-if="row.input_state"
  321. v-model="tableData[index].position"
  322. placeholder="位置"
  323. />
  324. <span v-else>{{ tableData[index].position }}</span>
  325. </template>
  326. <template slot="urlSet" slot-scope="{ index }">
  327. <div class="product-img">
  328. <div class="product-add">
  329. <div
  330. class="items"
  331. v-show="tableData[index].url.length !== 0 ? true : false"
  332. >
  333. <img
  334. @click="looks(tableData[index].url)"
  335. v-for="(el, idx) in tableData[index].url"
  336. :key="idx"
  337. :src="$store.state.ip + el"
  338. alt=""
  339. />
  340. </div>
  341. <template style="flex">
  342. <div style="display: flex; justify-content: center">
  343. <Icon
  344. size="50"
  345. @click="
  346. delItems(
  347. tableData[index].url.length - 1,
  348. tableData[index].url
  349. )
  350. "
  351. class="add-items"
  352. type="ios-remove"
  353. />
  354. <div class="add-items">
  355. <div class="_item">
  356. <Icon size="50" type="ios-add" />
  357. </div>
  358. <input
  359. @change="changeIpt($event, tableData[index])"
  360. type="file"
  361. class="ipt"
  362. />
  363. </div>
  364. </div>
  365. </template>
  366. </div>
  367. </div>
  368. </template>
  369. <template slot="url_numberSet" slot-scope="{ row, index }">
  370. <Input
  371. type="text"
  372. size="small"
  373. v-if="row.input_state"
  374. v-model="tableData[index].url_number"
  375. placeholder="图号"
  376. />
  377. <span v-else>{{ tableData[index].url_number }}</span>
  378. </template>
  379. <template slot="modelSet" slot-scope="{ row, index }">
  380. <Input
  381. type="text"
  382. size="small"
  383. v-if="row.input_state"
  384. v-model="tableData[index].model"
  385. placeholder="型号"
  386. />
  387. <span v-else>{{ tableData[index].model }}</span>
  388. </template>
  389. <template slot="status" slot-scope="{ index }">
  390. <span>{{ tableData[index].status?'新增':'变更' }}</span>
  391. </template>
  392. <template slot="long" slot-scope="{ row, index }">
  393. <Input
  394. type="text"
  395. size="small"
  396. v-if="row.input_state"
  397. v-model="tableData[index].long"
  398. placeholder="长"
  399. />
  400. <span v-else>{{ row.long }}</span>
  401. </template>
  402. <template slot="width" slot-scope="{ row, index }">
  403. <Input
  404. type="text"
  405. size="small"
  406. v-if="row.input_state"
  407. v-model="tableData[index].wide"
  408. placeholder="宽"
  409. />
  410. <span v-else>{{ tableData[index].wide }}</span>
  411. </template>
  412. <template slot="heigh" slot-scope="{ row, index }">
  413. <Input
  414. type="text"
  415. size="small"
  416. v-if="row.input_state"
  417. v-model="tableData[index].high"
  418. placeholder="高"
  419. />
  420. <span v-else>{{ tableData[index].high }}</span>
  421. </template>
  422. <template slot="set" slot-scope="{ row, index }">
  423. <a
  424. style="margin: 0 5px; color: blue"
  425. @click="handleSet(row, index, 1)"
  426. v-show="row.change_state"
  427. >变更</a
  428. >
  429. <a
  430. style="margin: 0 5px; color: blue"
  431. @click="handleSet(row, index, 2)"
  432. >复制</a
  433. >
  434. <a style="margin: 0 5px; color: red" @click="handleSet(row, index, 3)"
  435. >删除</a
  436. >
  437. </template>
  438. </Table>
  439. <div class="List_form_content">
  440. <div>
  441. <span style="font-size: 20px; font-weight: bold">原深化单内容</span>
  442. </div>
  443. <Table :columns="ListColumns" :data="ListData">
  444. <template slot="urlSet" slot-scope="{ index }">
  445. <div
  446. class="items"
  447. v-show="ListData[index].url.length !== 0 ? true : false"
  448. >
  449. <img
  450. @click="looks(ListData[index].url)"
  451. v-for="(el, idx) in ListData[index].url"
  452. :key="idx"
  453. :src="$store.state.ip + el"
  454. alt=""
  455. style="max-width: 40px; max-height: 40px"
  456. />
  457. </div>
  458. </template>
  459. </Table>
  460. </div>
  461. </Card>
  462. </div>
  463. </template>
  464. <script>
  465. export default {
  466. data() {
  467. return {
  468. formData: {
  469. building: "",
  470. unit: "",
  471. room_number: "",
  472. floor: "",
  473. product_title: "",
  474. pic_number: "",
  475. depart_end:'',
  476. depart_start:'',
  477. msg:'',
  478. contact_order_no:'',
  479. change_type:''
  480. },
  481. cascader_list: [],
  482. building_list: [],
  483. type: 1,
  484. unit_list: [],
  485. floor_list: [],
  486. room_number_list: [],
  487. product_title_list: [],
  488. pic_number_list: [],
  489. tableColumns: [
  490. {
  491. title: "楼栋",
  492. key: "house",
  493. align: "center",
  494. width: 80,
  495. slot: "houseSet",
  496. resizable: true,
  497. },
  498. {
  499. title: "楼单元",
  500. key: "unit",
  501. align: "center",
  502. width: 80,
  503. slot: "unitSet",
  504. resizable: true,
  505. },
  506. {
  507. title: "楼层",
  508. key: "layer",
  509. align: "center",
  510. width: 80,
  511. slot: "layerSet",
  512. resizable: true,
  513. },
  514. {
  515. title: "房间号",
  516. key: "number",
  517. align: "center",
  518. width: 100,
  519. slot: "numberSet",
  520. resizable: true,
  521. },
  522. {
  523. title: "产品分类",
  524. key: "title",
  525. align: "center",
  526. width: 140,
  527. slot: "type_titleSet",
  528. resizable: true,
  529. },
  530. {
  531. title: "产品",
  532. key: "title",
  533. align: "center",
  534. width: 130,
  535. slot: "titleSet",
  536. resizable: true,
  537. },
  538. {
  539. title: "计量单位",
  540. key: "product_unit",
  541. align: "center",
  542. width: 100,
  543. slot: "product_unitSet",
  544. resizable: true,
  545. },
  546. {
  547. title: "位置",
  548. key: "position",
  549. align: "center",
  550. width: 100,
  551. slot: "positionSet",
  552. resizable: true,
  553. },
  554. {
  555. title: "图纸",
  556. key: "url",
  557. align: "center",
  558. width: 120,
  559. slot: "urlSet",
  560. resizable: true,
  561. },
  562. {
  563. title: "图号",
  564. key: "url_number",
  565. align: "center",
  566. width: 120,
  567. slot: "url_numberSet",
  568. resizable: true,
  569. },
  570. {
  571. title: "型号",
  572. key: "model",
  573. align: "center",
  574. width: 120,
  575. slot: "modelSet",
  576. resizable: true,
  577. },
  578. {
  579. title: "长",
  580. key: "H",
  581. align: "center",
  582. width: 120,
  583. resizable: true,
  584. slot: "long",
  585. },
  586. {
  587. title: "宽",
  588. key: "W",
  589. align: "center",
  590. width: 120,
  591. slot: "width",
  592. resizable: true,
  593. },
  594. {
  595. title: "高",
  596. key: "T",
  597. align: "center",
  598. width: 120,
  599. slot: "heigh",
  600. resizable: true,
  601. },
  602. {
  603. title: "变更类型",
  604. key: "status",
  605. align: "center",
  606. width: 120,
  607. slot: "status",
  608. resizable: true,
  609. },
  610. this.$route.query.type == 2
  611. ? {
  612. title: "操作",
  613. key: "set",
  614. align: "center",
  615. minWidth: 150,
  616. fixed: "right",
  617. slot: "set",
  618. resizable: true,
  619. }
  620. : { width: 1 },
  621. ],
  622. tableData: [],
  623. ListColumns: [
  624. { title: "序号", align: "center", minWidth: 100, type: "index" },
  625. { title: "楼栋", key: "house", align: "center", minWidth: 100 },
  626. { title: "楼单元", key: "unit", align: "center", minWidth: 100 },
  627. { title: "楼层", key: "layer", align: "center", minWidth: 100 },
  628. { title: "房价号", key: "number", align: "center", minWidth: 100 },
  629. {
  630. title: "产品分类",
  631. key: "type_title",
  632. align: "center",
  633. minWidth: 100,
  634. },
  635. { title: "产品", key: "title", align: "center", minWidth: 100 },
  636. {
  637. title: "计量单位",
  638. key: "product_unit",
  639. align: "center",
  640. minWidth: 100,
  641. },
  642. { title: "位置", key: "position", align: "center", minWidth: 100 },
  643. {
  644. title: "图纸",
  645. key: "url",
  646. align: "center",
  647. minWidth: 100,
  648. slot: "urlSet",
  649. },
  650. { title: "图号", key: "url_number", align: "center", minWidth: 100 },
  651. { title: "型号", key: "model", align: "center", minWidth: 100 },
  652. { title: "长", key: "long", align: "center", minWidth: 100 },
  653. { title: "宽", key: "wide", align: "center", minWidth: 100 },
  654. { title: "高", key: "high", align: "center", minWidth: 100 },
  655. { title: "变更类型", key: "state", align: "center", minWidth: 100 },
  656. ],
  657. ListData: [],
  658. page_index: 1,
  659. page_size: 10,
  660. depart_list:[],
  661. show:false
  662. };
  663. },
  664. created(){
  665. this.axios.get("/api/basics_product_index").then((res) => {
  666. this.cascader_list = res.data.data;
  667. });
  668. this.axios.get('/api/employee_depart_list').then(res=>{
  669. this.depart_list = res.data
  670. let arr = [];
  671. this.depart_list.forEach(item=>{
  672. if(item.sub.length == 0){
  673. arr.push(item)
  674. }
  675. else{
  676. item.sub.forEach(_item=>{
  677. arr.push(_item)
  678. })
  679. }
  680. })
  681. this.depart_list =arr
  682. })
  683. },
  684. mounted() {
  685. this.initData(
  686. this.$route.query.order_no,
  687. this.$route.query.order_area_id,
  688. this.$route.query.order_area_product_id
  689. );
  690. },
  691. methods: {
  692. handleFinish(){
  693. if(this.formData.depart_end ==null||
  694. this.formData.depart_start == null||
  695. this.formData.change_type == null||
  696. this.formData.msg == null||
  697. this.formData.contact_order_no == null){
  698. this.$Message.error('请填写完整信息');
  699. }else{
  700. let arr = [];
  701. let arr1 = [];
  702. this.tableData.forEach(item=>{
  703. item.product_title = item.title
  704. if(item.status ==1||item.status ==0){
  705. arr.push(item)
  706. }
  707. })
  708. this.ListData.forEach(item=>{
  709. item.product_title = item.title
  710. if(item.status ==2){
  711. arr1.push(item)
  712. }
  713. })
  714. this.axios({
  715. method:'post',
  716. url:'/api/change_area_product_save',
  717. data:{
  718. order_area_product_id:this.$route.query.order_area_product_id,
  719. get_depart_id:this.formData.depart_end,
  720. send_depart_id:this.formData.depart_start,
  721. change_type:this.formData.change_type,
  722. reason:this.formData.msg,
  723. change_list:[...arr1,...arr],
  724. contact_order_no:this.formData.contact_order_no
  725. }
  726. }).then(res=>{
  727. if(res.code == 200){
  728. this.$Message.success(res.msg)
  729. }
  730. })
  731. }
  732. },
  733. add_line() {
  734. let arr = {
  735. long: "",
  736. high: "",
  737. wide: "",
  738. change_state: false,
  739. status:1,
  740. copy_state:true,
  741. check_state: false,
  742. explode_status: '',
  743. house: '',
  744. house_id: "",
  745. id: '',
  746. input_state: true,
  747. layer: '',
  748. model: "",
  749. number: '',
  750. order_area_id: '',
  751. order_area_product_id: '',
  752. order_no: "",
  753. position: "",
  754. price: null,
  755. product_id: '',
  756. product_unit: "",
  757. real_price: '',
  758. sign_id: "",
  759. status: '',
  760. title: "",
  761. type_id: '',
  762. type_title: "",
  763. unit: '',
  764. url: [],
  765. url_number: "",
  766. _index: '',
  767. _rowKey: '',
  768. };
  769. this.tableData.unshift(arr);
  770. },
  771. handleTypeTitleChange(e) {},
  772. changeIpt(e, row) {
  773. let file = e.target.files[0];
  774. this.postImg(file, row);
  775. e.target.value = null;
  776. },
  777. postImg(file, row) {
  778. let formData = new FormData();
  779. formData.append("file", file);
  780. this.axios.post("/api/upload_pic", formData).then((res) => {
  781. row.url.push(res.data.url);
  782. });
  783. },
  784. delItems(n, arr) {
  785. arr.splice(n, 1);
  786. },
  787. looks(arr) {
  788. // const array = [{ img_url: img }];
  789. const array = arr.map((v) => {
  790. return { img_url: v };
  791. });
  792. console.log("array :>> ", array);
  793. this.$previewImg({
  794. list: array,
  795. baseUrl: this.$store.state.ip,
  796. baseImgField: "img_url",
  797. baseTitleField: "",
  798. });
  799. },
  800. handleSet(row, index, type) {
  801. switch (type) {
  802. case 1:
  803. this.tableData[index].input_state = true;
  804. row.input_state = true;
  805. this.tableData[index].status = 0;
  806. if (!row.check_state) {
  807. row.state = "变更";
  808. row.status = 0;
  809. this.ListData.push(row);
  810. this.tableData[index].check_state = true;
  811. row.check_state = true;
  812. console.log(this.tableData);
  813. } else {
  814. this.$Message.warning("不可重复变更!");
  815. }
  816. break;
  817. case 2:
  818. this.tableData.splice(index, 0, row);
  819. // this.tableData[index+1].check_state = false
  820. this.tableData[index+1].status = 1;
  821. this.tableData[index + 1].input_state = true;
  822. this.tableData[index + 1].change_state = false;
  823. //标记是复制的数据
  824. this.tableData[index + 1].copy_state = true;
  825. console.log(row);
  826. break;
  827. case 3:
  828. this.confirmDelete({
  829. content: "确认删除么?",
  830. then: () => {
  831. let arr = this.tableData.splice(index, 1);
  832. if (row.copy_state) {
  833. return;
  834. } else {
  835. arr[0].state = "删除";
  836. arr[0].status =2;
  837. this.ListData = [...this.ListData, ...arr];
  838. console.log(arr);
  839. }
  840. }
  841. });
  842. }
  843. },
  844. getListData() {},
  845. goback() {
  846. this.$router.go(-1);
  847. },
  848. initData(order_no, order_area_id, order_area_product_id) {
  849. this.axios({
  850. method: "get",
  851. url: "/api/order_area_product_list",
  852. params: {
  853. order_no,
  854. order_area_id,
  855. order_area_product_id,
  856. },
  857. }).then((res) => {
  858. console.log(res);
  859. this.tableData = res.data.detail;
  860. this.formData =res.data;
  861. this.tableData.forEach((item) => {
  862. item.long = item.measure.split("*")[0];
  863. item.wide = item.measure.split("*")[1];
  864. item.high = item.measure.split("*")[2];
  865. item.input_state = false; //是否为input框
  866. item.check_state = false; //是否已经变更过
  867. item.change_state = true; //变更操作是否存在
  868. });
  869. });
  870. },
  871. },
  872. };
  873. </script>
  874. <style scoped lang='scss'>
  875. .changeDetail {
  876. overflow: auto;
  877. .form_content {
  878. border-bottom: 1px solid #a2a6b1;
  879. .top_search {
  880. display: flex;
  881. flex-wrap: wrap;
  882. div {
  883. width: 200px;
  884. font-size: 14px;
  885. margin: 10px;
  886. }
  887. }
  888. .form_content_header {
  889. display: flex;
  890. flex-wrap: wrap;
  891. }
  892. }
  893. .form_middle {
  894. margin: 20px 0;
  895. .form_middle_content {
  896. display: flex;
  897. flex-wrap: wrap;
  898. }
  899. }
  900. }
  901. .product-add {
  902. display: flex;
  903. flex-direction: column;
  904. .ipt {
  905. position: absolute;
  906. width: 100%;
  907. height: 100%;
  908. opacity: 0;
  909. cursor: pointer;
  910. outline: none;
  911. top: 0;
  912. left: 0;
  913. }
  914. .add-items {
  915. width: 40px;
  916. height: 40px;
  917. border: 1px dotted #e7e7e7;
  918. border-radius: 5px;
  919. display: flex;
  920. justify-content: center;
  921. align-items: center;
  922. overflow: hidden;
  923. position: relative;
  924. flex-direction: column;
  925. background: #f4f5f7;
  926. ._item {
  927. width: 46px;
  928. height: 46px;
  929. background: #3764ff;
  930. opacity: 0.6;
  931. display: flex;
  932. justify-content: center;
  933. align-items: center;
  934. border-radius: 50%;
  935. color: #fff;
  936. }
  937. }
  938. .items {
  939. width: 40px;
  940. height: 40px;
  941. margin-bottom: 10px;
  942. display: flex;
  943. align-items: center;
  944. border-radius: 5px;
  945. position: relative;
  946. img {
  947. max-width: 40px;
  948. max-height: 40px;
  949. }
  950. }
  951. }
  952. .List_form_content {
  953. margin: 30px 0;
  954. }
  955. .ivu-form-item {
  956. margin-left: 10px;
  957. }
  958. </style>