add.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div>
  3. <el-button size="small" type="primary" @click="onShow(dialogTableVisible = true)">新建发货单</el-button>
  4. <el-dialog append-to-body title="选择发货订单" :visible.sync="dialogTableVisible" width="1000px">
  5. <el-input style="width:200px;" class="mt-10 inline-16" placeholder="请输入" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" clearable>
  6. </el-input>
  7. <el-date-picker
  8. class="inline-16"
  9. v-model="param.content.where.begindate"
  10. type="date"
  11. placeholder="选择开始日期"
  12. value-format="yyyy-MM-dd"
  13. size="small"
  14. @change="listData(param.content.pageNumber = 1)">
  15. </el-date-picker>
  16. <el-date-picker
  17. v-model="param.content.where.enddate"
  18. type="date"
  19. placeholder="选择结束日期"
  20. value-format="yyyy-MM-dd"
  21. size="small"
  22. @change="listData(param.content.pageNumber = 1)">
  23. </el-date-picker>
  24. <el-table :data="list" size="mini" border>
  25. <el-table-column prop="sonum" label="订单号"></el-table-column>
  26. <el-table-column prop="projectname" label="项目名称"></el-table-column>
  27. <el-table-column prop="projectnote" label="项目备注"></el-table-column>
  28. <el-table-column prop="enterprisename" label="企业名称"></el-table-column>
  29. <el-table-column prop="checkdate" label="审核时间"></el-table-column>
  30. <el-table-column prop="remarks" label="备注"></el-table-column>
  31. <el-table-column label="操作" width="90">
  32. <template slot-scope="scope">
  33. <el-button size="small" type="text" @click="createDispatch(scope.row)">选择</el-button>
  34. </template>
  35. </el-table-column>
  36. </el-table>
  37. <div class="container normal-panel" style="text-align:right">
  38. <el-pagination
  39. background
  40. small
  41. @size-change="handleSizeChange"
  42. @current-change="handleCurrentChange"
  43. :current-page="currentPage"
  44. :page-sizes="[20, 50, 100, 200]"
  45. layout="total,sizes, prev, pager, next, jumper"
  46. :total="total">
  47. </el-pagination>
  48. </div>
  49. </el-dialog>
  50. </div>
  51. </template>
  52. <script>
  53. export default {
  54. data () {
  55. return {
  56. dialogTableVisible:false,
  57. param:{
  58. "id": "20221114165903",
  59. "version":1,
  60. "content": {
  61. "pageNumber":1,
  62. "pageSize":20,
  63. "where":{
  64. "condition":"",
  65. "sonum":"",
  66. "begindate":'',
  67. "enddate":''
  68. }
  69. }
  70. },
  71. list:[],
  72. total:0,
  73. currentPage:0
  74. }
  75. },
  76. methods:{
  77. onShow () {
  78. this.listData()
  79. },
  80. async listData() {
  81. const res = await this.$api.requested(this.param)
  82. this.list = res.data
  83. this.total = res.total
  84. this.currentPage = res.pageNumber
  85. },
  86. handleSizeChange(val) {
  87. // console.log(`每页 ${val} 条`);
  88. this.param.content.pageSize = val
  89. this.listData()
  90. },
  91. handleCurrentChange(val) {
  92. // console.log(`当前页: ${val}`);
  93. this.param.content.pageNumber = val
  94. this.listData()
  95. },
  96. async createDispatch (row) {
  97. const res = await this.$api.requested({
  98. "id": "20221114135203",
  99. "version":1,
  100. "content": {
  101. "sa_dispatchid":0,
  102. "sa_orderid":row.sa_orderid,
  103. "sys_enterpriseid":row.sys_enterpriseid,
  104. "sa_logiscompid":row.sa_logiscompid,
  105. "rec_contactsid":row.rec_contactsid,
  106. "remarks":row.remarks
  107. }
  108. })
  109. this.tool.showMessage(res,()=>{
  110. this.dialogTableVisible = false
  111. this.$emit('onSuccess')
  112. this.$store.dispatch('changeDetailDrawer',true)
  113. this.$router.push({path:'/dispatchdetail',query:{id:res.data.sa_dispatchid,rowindex:res.data.rowindex}})
  114. })
  115. }
  116. }
  117. }
  118. </script>