purchaseDetail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <div>
  3. <Toptitle title="工装单审批详情">
  4. <slot name="titleButton">
  5. <!-- <Button @click="approval(1)"
  6. type="success"
  7. style="margin-right:10px;">通过</Button>
  8. <Button @click="approval(2)"
  9. type="error"
  10. style="margin-right:10px;">驳回</Button> -->
  11. <Button @click="goback()"
  12. type="primary"
  13. style="margin-right:10px;">返回</Button>
  14. </slot>
  15. </Toptitle>
  16. <div class="body">
  17. <div class="header">
  18. <Steps :current="2">
  19. <Step title="开始审批"></Step>
  20. <Step title="1级审批"></Step>
  21. <Step title="2级审批"></Step>
  22. <Step title="审批完成"></Step>
  23. </Steps>
  24. </div>
  25. <div class="info_wrapper">
  26. <div class="info">
  27. <div class="info_item"><span>制单人:</span><span>{{orderInfo.nickname}}</span></div>
  28. <div class="info_item"><span>采购类型:</span><span>{{orderInfo.type_title}}</span></div>
  29. <div class="info_item"><span>项目名称:</span><span>{{orderInfo.residential_name}}</span></div>
  30. <div class="info_item"><span>单据号:</span><span>{{orderInfo.order_no}}</span></div>
  31. <div class="info_item"><span>制单日期:</span><span>{{func.replaceDate(orderInfo.crt_time)}}</span></div>
  32. <div class="info_item"><span>预计到货日期:</span><span>{{func.replaceDate(orderInfo.arrive_time)}}</span></div>
  33. <div class="info_item"><span>备注:</span><span>采购需要快点,生产部等着要</span></div>
  34. </div>
  35. <div class="info_fixed">
  36. <Steps :current="99"
  37. size="small"
  38. direction="vertical">
  39. <Step v-for="item in oaInfo"
  40. :key="item.level">
  41. <div slot="title">
  42. {{func.replaceDate(item.upd_time)}}
  43. 审批人:{{item.nickname}}
  44. </div>
  45. </Step>
  46. </Steps>
  47. </div>
  48. </div>
  49. <div class="tableContent">
  50. <div class="table_title">请购清单</div>
  51. <Table :columns="purchaseColumus" :data="purchaseData">
  52. <template slot="materiel_specs" slot-scope="{ row }">
  53. <div>
  54. {{ row.long ? row.long : 0 }}*{{ row.width ? row.width : 0 }}*{{
  55. row.high ? row.high : 0
  56. }}
  57. </div>
  58. </template>
  59. <template slot="untaxed_price" slot-scope="{ row }">
  60. <div>
  61. {{row.price-row.price*row.fax}}
  62. </div>
  63. </template>
  64. <template slot="untaxed_price_total" slot-scope="{ row }">
  65. <div>
  66. {{(row.price-row.price*row.fax)*row.num}}
  67. </div>
  68. </template>
  69. <template slot="tax_amount" slot-scope="{ row }">
  70. <div>
  71. {{row.price*row.fax}}
  72. </div>
  73. </template>
  74. <template slot="price_total" slot-scope="{ row }">
  75. <div>
  76. {{row.price*row.num}}
  77. </div>
  78. </template>
  79. </Table>
  80. </div>
  81. </div>
  82. </div>
  83. </template>
  84. <script>
  85. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  86. // 例如:import 《组件名称》 from '《组件路径》';
  87. export default {
  88. name: '',
  89. components: {
  90. },
  91. props: {},
  92. // import引入的组件需要注入到对象中才能使用
  93. data () {
  94. // 这里存放数据
  95. return {
  96. setpContent: [],
  97. orderInfo: {},
  98. oaInfo: [],
  99. type: null,
  100. purchaseColumus:[
  101. { title: '项目名称', key: 'residential_name', align: 'center', minWidth: 92 },
  102. { title: '物料分类', key: 'type_title', align: 'center', minWidth: 92 },
  103. { title: '物料名称', key: 'title', align: 'center', minWidth: 92 },
  104. { title: '物料规格', key: '', align: 'center', minWidth: 92, slot: "materiel_specs"},
  105. { title: '计量单位', key: 'unit', align: 'center', minWidth: 92 },
  106. { title: '采购数量', key: 'num', align: 'center', minWidth: 92 },
  107. { title: '无税单价', key: '', align: 'center', minWidth: 92 ,slot:'untaxed_price'},
  108. { title: '税率', key: 'fax', align: 'center', minWidth: 70 },
  109. { title: '含税单价', key: 'price', align: 'center', minWidth: 92 },
  110. { title: '无税金额', key: '', align: 'center', minWidth: 92 ,slot:'untaxed_price_total'},
  111. { title: '税额', key: '', align: 'center', minWidth: 70 ,slot:'tax_amount'},
  112. { title: '价格合计', key: '', align: 'center', minWidth: 92 ,slot:'price_total'},
  113. ],
  114. purchaseData:[],
  115. // tableColumns: [
  116. // { title: '序号', type: 'index', key: '', align: 'center', minWidth: 80 },
  117. // { title: '产品名称', key: 'title', align: 'center', tooltip: true, minWidth: 100 },
  118. // { title: '数量', key: 'num', align: 'center', minWidth: 80 },
  119. // { title: '价格', key: 'price', align: 'center', minWidth: 80 },
  120. // { title: '规格', key: 'measure', align: 'center', tooltip: true, minWidth: 140 },
  121. // { title: '工艺属性', key: 'process_property', align: 'center', tooltip: true, minWidth: 120 },
  122. // {
  123. // title: '图纸', align: 'center', key: 'url', minWidth: 100,
  124. // render: (h, params) => {
  125. // const { row } = params
  126. // let url = row.url ? row.url : []
  127. // return h('img', {
  128. // attrs: {
  129. // src: this.$store.state.ip + url[0],
  130. // style: 'max-width:50px;max-height:50px;position:relative;top:3px;'
  131. // },
  132. // on: {
  133. // click: (e) => {
  134. // // this.axios('/api/orders_img', { params: { id: row.id, type: 1 } }).then(res => {
  135. // // row.imgs = res.data
  136. // let list = []
  137. // url.length > 0 && url.forEach(el => {
  138. // list.push({ img_url: el })
  139. // });
  140. // this.$previewImg({
  141. // list,
  142. // baseUrl: this.$store.state.ip,
  143. // baseImgField: 'img_url',
  144. // baseTitleField: ''
  145. // })
  146. // // })
  147. // }
  148. // }
  149. // })
  150. // }
  151. // },
  152. // { title: '左右式', key: '', align: 'center', tooltip: true, minWidth: 80 },
  153. // { title: '图号', key: 'url_number', align: 'center', tooltip: true, minWidth: 80 },
  154. // { title: '备注', key: 'remark', align: 'center', minWidth: 80 },
  155. // // { title: '操作', key: 'remark', align: 'center', slot: 'Set', minWidth: 120 },
  156. // ],
  157. isOpen: false,
  158. btnLoading: false,
  159. fullAreaList: [],
  160. singleAreaList: [],
  161. warningList: [],
  162. }
  163. },
  164. // 生命周期 - 创建完成(可以访问当前this实例)
  165. created () {
  166. this.axios({
  167. method: 'get',
  168. url: '/api/order_oa_detail',
  169. params: {
  170. order_no: this.$route.query.order_no,
  171. type: this.$route.query.type
  172. }
  173. }).then((res) => {
  174. this.orderInfo = res.data
  175. // this.oaInfo = res.data.__ob__
  176. // this.areaList = [res.data.area]
  177. // this.singleAreaList = JSON.parse(JSON.stringify([res.data.area]))
  178. this.purchaseData = res.data.list;
  179. console.log(res)
  180. }).catch((err) => { });
  181. },
  182. // 生命周期 - 挂载完成(可以访问DOM元素)
  183. mounted () {
  184. },
  185. methods: {
  186. handleSet () { },
  187. // approval (status) {
  188. // let params = {
  189. // status,
  190. // type: this.type,
  191. // oa_order_no: this.$route.query.oa_order_no
  192. // }
  193. // this.axios.post('/api/order_price_oa_pull', params).then(res => {
  194. // if (res.code == 200) {
  195. // this.$Message.success(res.msg || '无提示')
  196. // // this.goback()
  197. // }
  198. // })
  199. // },
  200. goback () { this.$router.go(-1) },
  201. handleShowMore () {
  202. if (this.fullAreaList.length > 0) {
  203. this.areaList = this.isOpen ? JSON.parse(JSON.stringify(this.singleAreaList)) : JSON.parse(JSON.stringify(this.fullAreaList))
  204. this.isOpen = !this.isOpen
  205. } else {
  206. this.btnLoading = true
  207. this.axios({
  208. method: 'get',
  209. url: '/api/order_price_oa_deep_area_detail',
  210. params: {
  211. oa_order_no: this.$route.query.oa_order_no
  212. }
  213. }).then((res) => {
  214. this.isOpen = !this.isOpen
  215. this.fullAreaList = JSON.parse(JSON.stringify(res.data))
  216. this.areaList = res.data
  217. this.btnLoading = false
  218. }).catch((err) => { });
  219. }
  220. },
  221. },
  222. // 监听属性 类似于data概念
  223. computed: {},
  224. // 监控data中的数据变化
  225. watch: {},
  226. beforeCreate () { }, // 生命周期 - 创建之前
  227. beforeMount () { }, // 生命周期 - 挂载之前
  228. beforeUpdate () { }, // 生命周期 - 更新之前
  229. updated () { }, // 生命周期 - 更新之后
  230. beforeDestroy () { }, // 生命周期 - 销毁之前
  231. destroyed () { }, // 生命周期 - 销毁完成
  232. activated () { }, // 如果页面有keep-alive缓存功能,这个函数会触发
  233. }
  234. </script>
  235. <style lang='scss' scoped>
  236. .body {
  237. margin-top: 10px;
  238. .tableContent{
  239. .table_title{
  240. line-height: 30px;
  241. height: 36px;
  242. border-top: 1px solid #F4F4F4;
  243. font-size: 18px;
  244. font-weight: bold;
  245. }
  246. }
  247. .header {
  248. margin: 20px 10px;
  249. }
  250. .info_wrapper {
  251. display: flex;
  252. justify-content: space-around;
  253. .info {
  254. display: flex;
  255. justify-content: flex-start;
  256. flex-wrap: wrap;
  257. .info_item {
  258. width: 180px;
  259. padding: 0 10px 10px 10px;
  260. }
  261. }
  262. .info_fixed {
  263. width: 100%;
  264. max-height: 150px;
  265. padding-top: 20px;
  266. padding-left: 5px;
  267. border: 1px solid #ffffbb;
  268. overflow: hidden;
  269. overflow-y: auto;
  270. background-color: #ffffbb;
  271. text-align: center;
  272. /deep/.ivu-steps-head-inner {
  273. margin: 0;
  274. }
  275. /deep/.ivu-steps-title,
  276. /deep/.ivu-steps-head {
  277. background: transparent;
  278. }
  279. }
  280. }
  281. }
  282. </style>