matchList.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <div>
  3. <Toptitle title="匹配列表">
  4. <slot name="titleButton"> </slot>
  5. </Toptitle>
  6. <div class="match_list">
  7. <Row style="padding:10px 0">
  8. <Col span="6">
  9. <span>项目编号:</span>
  10. <span>
  11. <Input clearable v-model="SearchInfo.project_number" style="width:140px" size="small"/>
  12. </span>
  13. </Col>
  14. <Col span="6">
  15. <span>项目名称:</span>
  16. <span>
  17. <Input clearable v-model="SearchInfo.project_name" style="width:140px" size="small"/>
  18. </span>
  19. </Col>
  20. <Col span="6">
  21. <span>项目简称:</span>
  22. <span>
  23. <Input clearable v-model="SearchInfo.project_short_title" style="width:140px" size="small"/>
  24. </span>
  25. </Col>
  26. <Col span="6">
  27. <span>匹配状态:</span>
  28. <span>
  29. <Select
  30. filterable
  31. filter-by-label
  32. clearable
  33. transfer
  34. v-model="SearchInfo.matching_status"
  35. style="width: 140px"
  36. size="small"
  37. >
  38. <Option label="未匹配" value="0"></Option>
  39. <Option label="匹配中" value="1"></Option>
  40. <Option label="匹配完成" value="2"></Option>
  41. </Select>
  42. </span>
  43. </Col>
  44. <Col span="2" offset="2">
  45. <Button @click="initData" type="primary" style="margin-right: 10px" size='small'
  46. >搜索</Button
  47. >
  48. </Col>
  49. </Row>
  50. <Table :columns="tableColumns" border :max-height="500" :data="tableData">
  51. <template slot="setSlot" slot-scope="{ row, index }">
  52. <a @click="handleSet(row, index, 1)" style="margin: 0 5px">匹配</a>
  53. <a @click="handleSet(row, index, 2)">查看</a>
  54. </template>
  55. </Table>
  56. </div>
  57. <div class="content_body_page">
  58. <Page
  59. :page-size-opts="[10, 20, 30, 40, 100]"
  60. @on-page-size-change="changeSize"
  61. @on-change="changePage"
  62. :current="page_index"
  63. show-total
  64. show-elevator
  65. :total="total"
  66. show-sizer
  67. :page-size="page_size"
  68. />
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  74. // 例如:import 《组件名称》 from '《组件路径》';
  75. export default {
  76. name: "matchList",
  77. components: {},
  78. props: {},
  79. // import引入的组件需要注入到对象中才能使用
  80. data() {
  81. // 这里存放数据
  82. return {
  83. SearchInfo: {
  84. project_short_title: "",
  85. project_name: "",
  86. project_number: "",
  87. matching_status: "",
  88. },
  89. tableColumns: [
  90. {
  91. title: "项目编号",
  92. align: "center",
  93. key: "project_number",
  94. resizable: true,
  95. width: 250
  96. },
  97. {
  98. title: "项目名称",
  99. align: "center",
  100. key: "project_name",
  101. resizable: true,
  102. width: 250
  103. },
  104. {
  105. title: "项目简称",
  106. align: "center",
  107. key: "project_short_title",
  108. resizable: true,
  109. width: 250
  110. },
  111. // {
  112. // title: "匹配状态",
  113. // align: "center",
  114. // key: "matching_status",
  115. // minWidth: 60,
  116. // render: (h, params) => {
  117. // return h(
  118. // "span",
  119. // {},
  120. // params.row.matching_status == 0
  121. // ? "未匹配"
  122. // : params.row.matching_status == 1
  123. // ? "匹配中"
  124. // : "匹配完成"
  125. // );
  126. // },
  127. // },
  128. // {
  129. // title: "下生产状态",
  130. // align: "center",
  131. // key: "produce_status",
  132. // minWidth: 60,
  133. // render: (h, params) => {
  134. // return h(
  135. // "span",
  136. // {},
  137. // params.row.produce_status == 0
  138. // ? "未下生产"
  139. // : params.row.produce_status == 1
  140. // ? "下生产中"
  141. // : "下生产完成"
  142. // );
  143. // },
  144. // },
  145. {
  146. title: "制单日期",
  147. align: "center",
  148. key: "crt_time",
  149. resizable: true,
  150. width: 250,
  151. render: (h, params) => {
  152. return h("span", {}, this.func.replaceDate(params.row.crt_time));
  153. },
  154. },
  155. { title: "操作", align: "center", minWidth: 60, slot: "setSlot" },
  156. ],
  157. tableData: [],
  158. page_index: 1,
  159. page_size: 10,
  160. total: null,
  161. };
  162. },
  163. // 生命周期 - 创建完成(可以访问当前this实例)
  164. created() {},
  165. // 生命周期 - 挂载完成(可以访问DOM元素)
  166. mounted() {
  167. this.initData();
  168. },
  169. methods: {
  170. initData() {
  171. this.axios({
  172. method: "get",
  173. url: "/api/bst_matching_list",
  174. params: {...this.SearchInfo,page_index:this.page_index,page_size:this.page_size},
  175. }).then((res) => {
  176. if (res.code == 200) {
  177. this.tableData = res.data.data;
  178. this.total = res.data.total;
  179. }
  180. });
  181. },
  182. handleSet(row, index, type) {
  183. switch (type) {
  184. case 1:
  185. this.$router.push({
  186. path: "/cms/leadMatch/MatchList/matchPage",
  187. query: {
  188. type,
  189. id: row.id,
  190. project_number: row.project_number,
  191. project_name: row.project_name,
  192. },
  193. });
  194. break;
  195. case 2:
  196. this.$router.push({
  197. path: "/cms/leadMatch/MatchList/matchCheck",
  198. query: {
  199. type,
  200. id: row.id,
  201. project_number: row.project_number,
  202. project_name: row.project_name,
  203. },
  204. });
  205. break;
  206. }
  207. },
  208. changeSize(e) {
  209. this.page_size = e;
  210. this.initData();
  211. },
  212. changePage(e) {
  213. this.page_index = e;
  214. this.initData();
  215. },
  216. },
  217. // 监听属性 类似于data概念
  218. computed: {},
  219. // 监控data中的数据变化
  220. watch: {},
  221. beforeCreate() {}, // 生命周期 - 创建之前
  222. beforeMount() {}, // 生命周期 - 挂载之前
  223. beforeUpdate() {}, // 生命周期 - 更新之前
  224. updated() {}, // 生命周期 - 更新之后
  225. beforeDestroy() {}, // 生命周期 - 销毁之前
  226. destroyed() {}, // 生命周期 - 销毁完成
  227. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  228. };
  229. </script>
  230. <style lang="scss" scoped>
  231. .content_body_page {
  232. display: flex;
  233. justify-content: center;
  234. padding-top: 20px;
  235. }
  236. .match_list{
  237. height:620px;
  238. overflow: hidden;
  239. }
  240. /deep/ .ivu-col{
  241. display: flex;
  242. margin: 5px;
  243. }
  244. /deep/ .ivu-col-span-6{
  245. flex: auto;
  246. }
  247. </style>