list.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div>
  3. <Toptitle title="码单列表">
  4. <slot name="titleButton"> </slot>
  5. </Toptitle>
  6. <div class="weight_memo_content">
  7. <div>
  8. <Topsearch :list="list" @init="initData" @searchData="initData" />
  9. </div>
  10. <div
  11. style="
  12. text-align: right;
  13. margin: 10px;
  14. border-top: 1px solid #f4f4f4;
  15. padding-top: 10px;
  16. "
  17. >
  18. <Button type="primary" size="small" style="margin-right: 10px" @click="gotoPage(3)"
  19. >新增</Button
  20. >
  21. </div>
  22. <Table :columns="tableColumns" border :data="tableData">
  23. <template slot="make_data" slot-scope="{row}">
  24. <span>{{func.replaceDate(row.crt_time)}}</span>
  25. </template>
  26. </Table>
  27. </div>
  28. <div class="content_body_page">
  29. <Page :page-size-opts="[10, 20, 30, 40,100]"
  30. @on-page-size-change='changeSize'
  31. @on-change='changePage'
  32. :current='pageIndex'
  33. show-total
  34. show-elevator
  35. :total="total"
  36. show-sizer
  37. :page-size='pageSize' />
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. list: [
  46. {
  47. title: "项目编号",
  48. name: "Input",
  49. value: "",
  50. placeholder: "请输入项目编号",
  51. serverName: "project_number",
  52. },
  53. {
  54. title: "项目名称",
  55. name: "Input",
  56. value: "",
  57. placeholder: "请输入项目名称",
  58. serverName: "project_name",
  59. },
  60. {
  61. title: "项目简称",
  62. name: "Input",
  63. value: "",
  64. placeholder: "请输入项目简称",
  65. serverName: "abbreviation",
  66. },
  67. // {
  68. // title: "匹配状态",
  69. // name: "Select",
  70. // value: "",
  71. // placeholder: "请选择",
  72. // serverName: "state",
  73. // option: [
  74. // { label: "匹配完成", value: 2 },
  75. // { label: "未匹配", value: 0 },
  76. // { label: "匹配中", value: 1 },
  77. // ]
  78. // },
  79. ],
  80. tableColumns: [
  81. { title: "项目编码", key: "project_number", align: "center" , resizable: true,
  82. width: 350},
  83. { title: "项目名称", key: "project_name", align: "center", resizable: true,
  84. width: 350 },
  85. { title: "项目简称", key: "abbreviation", align: "center", resizable: true,
  86. width: 350},
  87. // { title: "匹配状态", key: "state", align: "center", minWidth: 140,
  88. // render:(h,params)=>{
  89. // return h('span',{},params.row.state===0?'未匹配':params.row.state===2?'匹配完成':'匹配中')
  90. // }},
  91. { title: "制单日期", key: "make_data", align: "center", resizable: true,
  92. width: 350,slot:"make_data"},
  93. { title: "操作", key:'',align: "center", minWidth:150,
  94. render: (h, params) => {
  95. return h('div', [
  96. h('a', { style: {
  97. marginRight: '5px'
  98. }, on: {
  99. click: () => {
  100. this.gotoPage(1,params.row)
  101. }
  102. }
  103. }, '编辑'),
  104. h('a', { style: {
  105. marginRight: '5px'
  106. }, on: {
  107. click: () => {
  108. this.gotoPage(2,params.row)
  109. }
  110. }
  111. }, '查看'),
  112. h('a',{ style: {
  113. marginRight: '5px'
  114. }, on: {
  115. click: () => {
  116. this.del(params.row)
  117. }
  118. }},'删除')
  119. ]);
  120. }},
  121. ],
  122. tableData: [],
  123. pageIndex: 1,
  124. pageSize: 10,
  125. total: 0,
  126. };
  127. },
  128. methods: {
  129. initData(row) {
  130. this.axios.get('/api/cut_order_list',{params:{
  131. page_index:this.pageIndex,page_size:this.pageSize,
  132. order_type:1,
  133. ...row}}).then(res=>{
  134. this.tableData = res.data.data;
  135. this.total = res.data.total
  136. })
  137. },
  138. del(row){
  139. this.confirmDelete({
  140. content:'是否删除?',
  141. title:'码单删除',
  142. type:'primary',
  143. then:()=>{
  144. this.axios.post('/api/cut_order_delete',{cut_order_id:row.id,order_type:1}).then(()=>{
  145. this.initData()
  146. })
  147. },
  148. cancel:()=>{}
  149. })
  150. },
  151. gotoPage(type,row){
  152. //1 编辑 2 查看 3 新增
  153. switch(type){
  154. case 1:
  155. case 2:this.$router.push({ path: '/cms/leadMatch/weightMemo/edit', query: { type:type,cut_order_id:row.id} });
  156. break
  157. case 3:this.$router.push({ path: '/cms/leadMatch/weightMemo/edit', query: { type:type} });
  158. break
  159. }
  160. },
  161. changeSize (e) {
  162. this.pageSize = e;
  163. this.initData()
  164. },
  165. changePage (e) {
  166. this.pageIndex = e;
  167. this.initData()
  168. },
  169. },
  170. };
  171. </script>
  172. <style scoped lang='scss'>
  173. .weight_memo_content{
  174. height: 650px;
  175. overflow: auto;
  176. }
  177. .content_body_page{
  178. margin-top: 10px;
  179. text-align: center;
  180. }
  181. </style>