changeRecordDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <div class="changeDetail">
  3. <Toptitle title="变更记录详情">
  4. <slot name="titleButton">
  5. <Button
  6. type="primary"
  7. style="margin-right: 10px"
  8. >打印变更联系单</Button
  9. >
  10. <Button
  11. @click="goback()"
  12. type="primary"
  13. ghost
  14. style="margin-right: 10px"
  15. >返回</Button
  16. >
  17. </slot>
  18. </Toptitle>
  19. <div>
  20. <div class="form">
  21. <div class="form_content">
  22. <div class="top_search">
  23. <div><span>区域编码:</span>{{ formData.area_num }}</div>
  24. <div><span>区域名称:</span>{{ formData.area_title }}</div>
  25. <div><span>产品名称:</span>{{ formData.product_title }}</div>
  26. <div><span>数量:</span>{{ formData.product_num }}</div>
  27. <div><span>规格:</span>{{ formData.measure }}</div>
  28. <div><span>工艺属性:</span>{{ formData.process_property }}</div>
  29. <div><span>图号:</span>{{ formData.url_number }}</div>
  30. <div style="display:flex;">
  31. <span style="width:50px">图纸:</span>
  32. <div>
  33. <span
  34. v-for="item in formData.img"
  35. :key="item"
  36. @click="checkImg(formData.img)"
  37. >
  38. <img :src="$store.state.ip + item" alt="" style=" max-width: 80px; max-height: 80px;"/>
  39. </span>
  40. </div>
  41. </div>
  42. <div>
  43. <span>左右式:</span
  44. >{{
  45. formData.fashion == 1
  46. ? "左式"
  47. : formData.fashion == 2
  48. ? "右式"
  49. : "无"
  50. }}
  51. </div>
  52. <!-- <div><span>价格:</span>{{ formData.price }}</div> -->
  53. <div><span>备注:</span>{{ formData.remark }}</div>
  54. </div>
  55. </div>
  56. <div class="form_middle">
  57. <Form class="form_middle_content" :label-width="100">
  58. <FormItem label="联系单编号:">
  59. <span>{{formData.contact_order_no}}</span>
  60. </FormItem>
  61. <FormItem label="原生产单编号:">
  62. <span
  63. style="width: auto"
  64. >{{this.$route.query.order_no}}</span>
  65. </FormItem>
  66. <FormItem label="接受部门:">
  67. <Select
  68. filterable
  69. clearable
  70. v-model="formData.get_depart_id"
  71. size="small"
  72. style="width: 120px"
  73. disabled
  74. >
  75. <Option
  76. v-for="(item,index) in depart_list"
  77. :key="index"
  78. :label="item.title"
  79. :value="item.id"
  80. ></Option>
  81. </Select>
  82. </FormItem>
  83. <FormItem label="发出部门:">
  84. <Select
  85. filterable
  86. clearable
  87. v-model="formData.send_depart_id"
  88. disabled
  89. size="small"
  90. style="width: 120px"
  91. >
  92. <Option
  93. v-for="(item, index) in depart_list"
  94. :key="index"
  95. :label="item.title"
  96. :value="item.id"
  97. ></Option>
  98. </Select>
  99. </FormItem>
  100. <FormItem label="更改性质:">
  101. <Input placeholder="请输入..." style="width: auto" v-model="formData.type_title" disabled></Input>
  102. </FormItem>
  103. <FormItem label="变更原因:">
  104. <Input
  105. type="textarea"
  106. placeholder="请输入..."
  107. style="width: auto"
  108. v-model="formData.reason"
  109. disabled
  110. ></Input>
  111. </FormItem>
  112. </Form>
  113. </div>
  114. </div>
  115. </div>
  116. <Card style="width: 100%">
  117. <div style="margin-left: 5px">
  118. <span style="font-size: 20px; font-weight: bold">变更后深化单内容</span>
  119. </div>
  120. <Table :columns="tableColumns" :data="tableData" border>
  121. <template slot="urlSet" slot-scope="{ index }">
  122. <div class="product-img">
  123. <div class="product-add">
  124. <div
  125. class="items"
  126. v-show="tableData[index].img.length !== 0 ? true : false"
  127. >
  128. <img
  129. @click="looks(tableData[index].img)"
  130. v-for="(el, idx) in tableData[index].img"
  131. :key="idx"
  132. :src="$store.state.ip + el"
  133. alt=""
  134. />
  135. </div>
  136. </div>
  137. </div>
  138. </template>
  139. </Table>
  140. <div class="List_form_content">
  141. <div>
  142. <span style="font-size: 20px; font-weight: bold">原深化单内容</span>
  143. </div>
  144. <Table :columns="ListColumns" :data="ListData">
  145. <template slot="urlSet" slot-scope="{ index }">
  146. <div
  147. class="items"
  148. >
  149. <img
  150. @click="looks(ListData[index].img)"
  151. v-for="(el, idx) in ListData[index].img"
  152. :key="idx"
  153. :src="$store.state.ip + el"
  154. alt=""
  155. style="max-width: 40px; max-height: 40px"
  156. />
  157. </div>
  158. </template>
  159. </Table>
  160. </div>
  161. </Card>
  162. </div>
  163. </template>
  164. <script>
  165. export default {
  166. data() {
  167. return {
  168. formData: {
  169. depart_end:'',
  170. depart_start:'',
  171. msg:'',
  172. contact_order_no:'',
  173. change_type:''
  174. },
  175. cascader_list: [],
  176. building_list: [],
  177. type: 1,
  178. tableColumns: [
  179. {
  180. title: "楼栋",
  181. key: "house",
  182. align: "center",
  183. width: 80,
  184. resizable: true,
  185. },
  186. {
  187. title: "楼单元",
  188. key: "unit",
  189. align: "center",
  190. width: 80,
  191. resizable: true,
  192. },
  193. {
  194. title: "楼层",
  195. key: "layer",
  196. align: "center",
  197. width: 80,
  198. resizable: true,
  199. },
  200. {
  201. title: "房间号",
  202. key: "number",
  203. align: "center",
  204. width: 100,
  205. resizable: true,
  206. },
  207. {
  208. title: "产品分类",
  209. key: "type_title",
  210. align: "center",
  211. width: 140,
  212. resizable: true,
  213. },
  214. {
  215. title: "产品",
  216. key: "title",
  217. align: "center",
  218. width: 130,
  219. resizable: true,
  220. },
  221. {
  222. title: "计量单位",
  223. key: "product_unit",
  224. align: "center",
  225. width: 100,
  226. resizable: true,
  227. },
  228. {
  229. title: "位置",
  230. key: "position",
  231. align: "center",
  232. width: 100,
  233. resizable: true,
  234. },
  235. {
  236. title: "图纸",
  237. key: "url",
  238. align: "center",
  239. width: 120,
  240. slot: "urlSet",
  241. resizable: true,
  242. },
  243. {
  244. title: "图号",
  245. key: "url_number",
  246. align: "center",
  247. width: 120,
  248. resizable: true,
  249. },
  250. {
  251. title: "型号",
  252. key: "model",
  253. align: "center",
  254. width: 120,
  255. resizable: true,
  256. },
  257. {
  258. title: "长",
  259. key: "long",
  260. align: "center",
  261. width: 120,
  262. resizable: true,
  263. },
  264. {
  265. title: "宽",
  266. key: "wide",
  267. align: "center",
  268. width: 120,
  269. resizable: true,
  270. },
  271. {
  272. title: "高",
  273. key: "high",
  274. align: "center",
  275. width: 120,
  276. resizable: true,
  277. }
  278. ],
  279. tableData: [],
  280. ListColumns: [
  281. { title: "序号", align: "center", minWidth: 100, type: "index" },
  282. { title: "楼栋", key: "house", align: "center", minWidth: 100 },
  283. { title: "楼单元", key: "unit", align: "center", minWidth: 100 },
  284. { title: "楼层", key: "layer", align: "center", minWidth: 100 },
  285. { title: "房价号", key: "number", align: "center", minWidth: 100 },
  286. {
  287. title: "产品分类",
  288. key: "type_title",
  289. align: "center",
  290. minWidth: 100,
  291. },
  292. { title: "产品", key: "title", align: "center", minWidth: 100 },
  293. {
  294. title: "计量单位",
  295. key: "product_unit",
  296. align: "center",
  297. minWidth: 100,
  298. },
  299. { title: "位置", key: "position", align: "center", minWidth: 100 },
  300. {
  301. title: "图纸",
  302. key: "url",
  303. align: "center",
  304. minWidth: 100,
  305. slot: "urlSet",
  306. },
  307. { title: "图号", key: "url_number", align: "center", minWidth: 100 },
  308. { title: "型号", key: "model", align: "center", minWidth: 100 },
  309. { title: "长", key: "long", align: "center", minWidth: 100 },
  310. { title: "宽", key: "wide", align: "center", minWidth: 100 },
  311. { title: "高", key: "high", align: "center", minWidth: 100 }
  312. ],
  313. ListData: [],
  314. page_index: 1,
  315. page_size: 10,
  316. depart_list:[],
  317. show:false
  318. };
  319. },
  320. created(){
  321. this.axios.get("/api/basics_product_index").then((res) => {
  322. this.cascader_list = res.data.data;
  323. });
  324. this.axios.get('/api/employee_depart_list').then(res=>{
  325. this.depart_list = res.data
  326. let arr = [];
  327. this.depart_list.forEach(item=>{
  328. if(item.sub.length == 0){
  329. arr.push(item)
  330. }
  331. else{
  332. item.sub.forEach(_item=>{
  333. arr.push(_item)
  334. })
  335. }
  336. })
  337. this.depart_list =arr
  338. })
  339. },
  340. mounted() {
  341. this.initData(
  342. this.$route.query.contact_order_no
  343. );
  344. },
  345. methods: {
  346. looks(arr) {
  347. // const array = [{ img_url: img }];
  348. const array = arr.map((v) => {
  349. return { img_url: v };
  350. });
  351. this.$previewImg({
  352. list: array,
  353. baseUrl: this.$store.state.ip,
  354. baseImgField: "img_url",
  355. baseTitleField: "",
  356. });
  357. },
  358. goback() {
  359. this.$router.go(-1);
  360. },
  361. initData(contact_order_no) {
  362. this.axios({
  363. method: "get",
  364. url: "/api/change_area_product_detail",
  365. params: {
  366. contact_order_no
  367. },
  368. }).then((res) => {
  369. console.log(res);
  370. this.tableData = res.data.new_list;
  371. this.ListData =res.data.old_list;
  372. this.formData =res.data;
  373. this.tableData.forEach((item) => {
  374. item.long = item.measure.split("*")[0];
  375. item.wide = item.measure.split("*")[1];
  376. item.high = item.measure.split("*")[2];
  377. });
  378. this.ListData.forEach(item=>{
  379. item.long = item.measure.split("*")[0];
  380. item.wide = item.measure.split("*")[1];
  381. item.high = item.measure.split("*")[2];
  382. })
  383. });
  384. },
  385. },
  386. };
  387. </script>
  388. <style scoped lang='scss'>
  389. .changeDetail {
  390. overflow: auto;
  391. .form_content {
  392. border-bottom: 1px solid #a2a6b1;
  393. .top_search {
  394. display: flex;
  395. flex-wrap: wrap;
  396. div {
  397. width: 200px;
  398. font-size: 14px;
  399. margin: 10px;
  400. }
  401. }
  402. .form_content_header {
  403. display: flex;
  404. flex-wrap: wrap;
  405. }
  406. }
  407. .form_middle {
  408. margin: 20px 0;
  409. .form_middle_content {
  410. display: flex;
  411. flex-wrap: wrap;
  412. }
  413. }
  414. }
  415. .product-add {
  416. display: flex;
  417. flex-direction: column;
  418. .ipt {
  419. position: absolute;
  420. width: 100%;
  421. height: 100%;
  422. opacity: 0;
  423. cursor: pointer;
  424. outline: none;
  425. top: 0;
  426. left: 0;
  427. }
  428. .items {
  429. width: auto;
  430. height: 40px;
  431. margin-bottom: 10px;
  432. overflow: hidden;
  433. border-radius: 5px;
  434. position: relative;
  435. img {
  436. max-width: 40px;
  437. max-height: 40px;
  438. }
  439. }
  440. }
  441. .List_form_content {
  442. margin: 30px 0;
  443. }
  444. .ivu-form-item{
  445. width: 250px;
  446. }
  447. </style>