saleOrder.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <!-- 销售化产焦炭派车页面 -->
  3. <div class="salePlan">
  4. <div class="top">
  5. <span class="text">订单时间:</span>
  6. <el-date-picker
  7. v-model="startTime"
  8. type="datetime"
  9. placeholder="选择日期"
  10. style="width:200px"
  11. >
  12. </el-date-picker>
  13. <span class="text">至</span>
  14. <el-date-picker
  15. v-model="endTime"
  16. type="datetime"
  17. placeholder="选择日期"
  18. style="width:200px"
  19. >
  20. </el-date-picker>
  21. <el-input
  22. placeholder="请输入内容"
  23. v-model="input"
  24. style="width:250px"
  25. clearable
  26. >
  27. </el-input>
  28. <el-button type="primary" class="btn" @click="onclick">
  29. <i class="el-icon-search"></i>
  30. </el-button>
  31. <el-button type="primary" @click="refresh">
  32. <i class="el-icon-refresh"></i>
  33. </el-button>
  34. </div>
  35. <div class="table">
  36. <el-tabs v-model="activeName" @tab-click="handleClick">
  37. <!-- 已审批 -->
  38. <el-tab-pane label="已审批" name="four">
  39. <dilTable v-bind.sync="option4" ref="table" :pageSize="200">
  40. <el-table-column fixed="right" label="操作" width="180">
  41. <template slot-scope="scope">
  42. <el-button
  43. @click="sendClick(scope.row.saleOrderId)"
  44. type="text"
  45. size="small"
  46. >派车</el-button
  47. >
  48. <el-button
  49. @click="addClick(scope.row.saleOrderId)"
  50. type="text"
  51. size="small"
  52. >排车</el-button
  53. >
  54. <el-button
  55. @click="checkSaleOrderDetails(scope.row.saleOrderId)"
  56. type="text"
  57. size="small"
  58. >运单详情</el-button
  59. >
  60. </template>
  61. </el-table-column>
  62. </dilTable>
  63. </el-tab-pane>
  64. </el-tabs>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import { sjTime } from "@/utils/sharedJsFile";
  70. export default {
  71. name: "saleOrder",
  72. data() {
  73. return {
  74. endTime: null,
  75. startTime: null,
  76. startDate: new Date().getTime() - 3600 * 1000 * 24 * 85,
  77. endDate: new Date(),
  78. activeName: "four",
  79. input: "",
  80. option4: {
  81. // 表格请求数据的地址
  82. requestUrl: "/api/v1/ams/getSaleCokeOrder?apiId=475&shipperId=2"
  83. // &startDate="+sjTime(new Date().getTime() - 3600 * 1000 * 24 * 85)+"&endDate="+sjTime(new Date()),
  84. }
  85. };
  86. },
  87. methods: {
  88. checkSaleOrderDetails(saleOrderId) {
  89. console.log(saleOrderId);
  90. this.$router.push("saleOrderOODetails/" + saleOrderId);
  91. },
  92. refresh() {
  93. this.$router.go(0);
  94. },
  95. handleClick(tab, event) {
  96. console.log(tab, event);
  97. },
  98. onclick() {
  99. let startTime = null;
  100. let endTime = null;
  101. if (this.startTime && this.endTime) {
  102. startTime = sjTime(this.startTime);
  103. endTime = sjTime(this.endTime);
  104. }
  105. this.option4.requestUrl =
  106. "/api/v1/ams/getSaleCokeOrder?apiId=475&shipperId=2&con=" +
  107. this.input +
  108. "&startTime=" +
  109. startTime +
  110. "&endTime=" +
  111. endTime +
  112. "&i=" +
  113. new Date();
  114. },
  115. click(saleOrderId) {
  116. this.$router.push("/editSaleOrder/" + saleOrderId);
  117. },
  118. addClick(saleOrderId) {
  119. this.$router.push("/addSaleOrderArrange/" + saleOrderId);
  120. },
  121. sendClick(saleOrderId) {
  122. this.$router.push("/addSaleOrderSend/" + saleOrderId);
  123. },
  124. //删除
  125. deleteclick(scope) {
  126. let saleOrderId = scope;
  127. this.$confirm("是否删除", "提示", {
  128. confirmButtonText: "确定",
  129. cancelButtonText: "取消",
  130. type: "warning",
  131. center: true
  132. })
  133. .then(() => {
  134. this.$message({
  135. type: "success",
  136. message: "删除成功!"
  137. });
  138. this.axios
  139. .post(
  140. "/api/v1/ams/deleteAmsSaleOrderBySaleOrderId?saleOrderId=" +
  141. saleOrderId
  142. )
  143. .then(() => {
  144. this.$router.go(0);
  145. });
  146. })
  147. .catch(() => {
  148. this.$message({
  149. type: "info",
  150. message: "取消删除!"
  151. });
  152. });
  153. }
  154. }
  155. };
  156. </script>
  157. <style lang="scss" scoped>
  158. .salePlan {
  159. .top {
  160. margin-left: 20px;
  161. margin-top: 20px;
  162. }
  163. .table {
  164. margin-left: 20px;
  165. margin-top: 20px;
  166. }
  167. }
  168. </style>