BSTList.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="BidsList">
  3. <Toptitle title="工装订单">
  4. <slot name="titleButton">
  5. <Button type="primary" ghost style="margin-right:10px" @click="goDetailPage">统计报表</Button>
  6. <Button type="primary"
  7. style="margin-right:10px;"
  8. ghost>导入</Button>
  9. </slot>
  10. </Toptitle>
  11. <div style="height:84%;overflow:auto">
  12. <Form style="display:flex;flex-wrap:wrap;margin:10px 0" :label-width="80">
  13. <FormItem label='项目编码:'>
  14. <Input size="small" clearable v-model="searchData.order_no"></Input>
  15. </FormItem>
  16. <FormItem label="项目名称:">
  17. <Input size="small" clearable v-model="searchData.residential_name"></Input>
  18. </FormItem>
  19. <FormItem label="项目简称:">
  20. <Input size="small" clearable v-model="searchData.abbreviation"></Input>
  21. </FormItem>
  22. <FormItem label="制单日期:">
  23. <DatePicker type="date" placeholder="年/月/日" style="width: 130px" size='small' v-model="searchData.start_time"></DatePicker>
  24. ~
  25. <DatePicker type="date" placeholder="年/月/日" style="width: 130px" size='small' v-model="searchData.end_time"></DatePicker>
  26. </FormItem>
  27. <FormItem>
  28. <Button
  29. type="primary"
  30. size='small'
  31. @click="init">
  32. 搜索
  33. </Button>
  34. </FormItem>
  35. </Form>
  36. <Table
  37. :data='tableData'
  38. :columns='tableColumns'
  39. border
  40. >
  41. <template slot="crt_time" slot-scope="{row}">
  42. <span>{{func.replaceDate(row.crt_time)}}</span>
  43. </template>
  44. <template slot="set" slot-scope="{row}">
  45. <a @click="goPageDetail(row,1)" style="margin-right:10px">编辑</a>
  46. <a @click="goPageDetail(row,2)" style="margin-right:10px">详情</a>
  47. <a @click="goPageDetail(row,3)">图号导入</a>
  48. </template>
  49. </Table>
  50. </div>
  51. <div style="text-align:center;margin-top:20px">
  52. <Page :page-size-opts="[10, 20, 30, 40,100]"
  53. @on-page-size-change='changeSize'
  54. @on-change='changePage'
  55. :current='pageIndex'
  56. show-total
  57. :total="total"
  58. show-sizer
  59. :page-size='pageSize' />
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  65. // 例如:import 《组件名称》 from '《组件路径》';
  66. export default {
  67. data() {
  68. // 这里存放数据
  69. return {
  70. pageSize:10,
  71. pageIndex:1,
  72. total:0,
  73. searchData:{
  74. order_no:'',
  75. residential_name:'',
  76. abbreviation:'',
  77. start_time:'',
  78. end_time:''},
  79. tableData:[],
  80. tableColumns:[
  81. {title:'项目编码',align:'center',key:'order_no',minWidth:80},
  82. {title:'项目名称',align:'center',key:'residential_name',minWidth:80},
  83. {title:'项目简称',align:'center',key:'abbreviation',minWidth:80},
  84. {title:'合同金额',align:'center',key:'contract_price',minWidth:80},
  85. {title:'核量金额',align:'center',key:'quantity_price',minWidth:80},
  86. {title:'制单日期',align:'center',key:'crt_time',minWidth:80,slot:'crt_time'},
  87. {title:'操作',align:'center',slot:'set',minWidth:80},
  88. ]
  89. }
  90. },
  91. // 生命周期 - 创建完成(可以访问当前this实例)
  92. created() {
  93. },
  94. // 生命周期 - 挂载完成(可以访问DOM元素)
  95. mounted() {
  96. this.getData();
  97. },
  98. methods:{
  99. goDetailPage(){
  100. this.$router.push({path:'/cms/BidSystem/ContractList/detailReport'})
  101. },
  102. init(){
  103. let data = [];
  104. data=JSON.parse(JSON.stringify(this.searchData));
  105. data.start_time = data.start_time?Date.parse(data.start_time).toString().slice(0,10):'';
  106. data.end_time = data.end_time?Date.parse(data.end_time).toString().slice(0,10):'';
  107. this.getData(data)
  108. },
  109. goPageDetail(row,type){
  110. switch(type){
  111. case 1:
  112. case 2:this.$router.push({path:'/cms/BidSystem/ContractList/edit',query:{order_no:row.order_no,type}})
  113. break;
  114. case 3:this.$router.push({path:'/cms/BidSystem/ContractList/urlLeading',query:{order_no:row.order_no,type}})
  115. break;
  116. }
  117. },
  118. changeSize(e){
  119. this.pageSize = e;
  120. this.getData();
  121. },
  122. changePage(e){
  123. this.pageIndex = e;
  124. this.getData();
  125. },
  126. getData(row){
  127. this.axios.get('/api/frock_list',{params:{...row,page_size:this.pageSize,page_index:this.pageIndex}}).then(res=>{
  128. this.tableData = res.data.data;
  129. this.total = res.data.total;
  130. })
  131. }
  132. },
  133. // 监听属性 类似于data概念
  134. // 监控data中的数据变化
  135. watch: {},
  136. beforeCreate() {}, // 生命周期 - 创建之前
  137. beforeMount() {}, // 生命周期 - 挂载之前
  138. beforeUpdate() {}, // 生命周期 - 更新之前
  139. updated() {}, // 生命周期 - 更新之后
  140. beforeDestroy() {}, // 生命周期 - 销毁之前
  141. destroyed() {}, // 生命周期 - 销毁完成
  142. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. .BidsList{
  147. margin-top: 10px;
  148. height: 100%;
  149. }
  150. </style>