deliveryNotice.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <!-- 发货通知页面 -->
  3. <div class="shipTransport">
  4. <div class="top">
  5. <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
  6. <el-button type="primary" class="btn" @click="onclick">
  7. <i class="el-icon-search"></i>查询
  8. </el-button>
  9. <el-button type="primary" class="btn" @click="addClick">
  10. <i class="el-icon-circle-plus-outline"></i>新增
  11. </el-button>
  12. </div>
  13. <el-tabs v-model="activeName" @tab-click="handleClick">
  14. <!-- 未下发 -->
  15. <el-tab-pane label="未下发" name="first">
  16. <dilTable v-bind.sync="option1" ref="table">
  17. <el-table-column fixed="right" align="center" label="操作" width="120">
  18. <template slot-scope="scope">
  19. <el-button @click="sendClick(scope.row.noticeId)" type="text" size="small">
  20. 下发
  21. </el-button>
  22. <el-button @click="modifyclick(scope.row.noticeId)" type="text" size="small">
  23. 修改
  24. </el-button>
  25. <el-button @click="deleteclick(scope.row.noticeId)" type="text" size="small">
  26. 删除
  27. </el-button>
  28. <el-button @click="toPhotoClick(scope.row.noticeId)" type="text" size="small">
  29. 货权转移图片</el-button>
  30. </template>
  31. </el-table-column>
  32. </dilTable>
  33. </el-tab-pane>
  34. <!-- 已下发 -->
  35. <el-tab-pane label="已下发" name="second">
  36. <dilTable v-bind.sync="option2"> </dilTable>
  37. </el-tab-pane>
  38. </el-tabs>
  39. <vxe-modal width="549px" height="731px" v-model="isShow" show-footer>
  40. <div class="demo-image__preview">
  41. <el-image
  42. style=" height:731px;text-align:center"
  43. :src="src"
  44. :preview-src-list="srcList"
  45. >
  46. </el-image>
  47. </div>
  48. </vxe-modal>
  49. </div>
  50. </template>
  51. <script>
  52. import { getCookie } from "@/utils/util.js";
  53. export default {
  54. name: "homeworkPath",
  55. data() {
  56. return {
  57. srcList:[],
  58. isShow:false,
  59. src:"",
  60. // restaurants: [],
  61. input: "",
  62. activeName: "first",
  63. option1: {
  64. // 表格请求数据的地址
  65. requestUrl: "/api/v1/tms/getshipDeliveryNoticeList?apiId=69&status=0"
  66. },
  67. option2: {
  68. // 表格请求数据的地址
  69. requestUrl: "/api/v1/tms/getshipDeliveryNoticeList?apiId=69&status=1"
  70. }
  71. };
  72. },
  73. methods: {
  74. onclick() {
  75. if (this.activeName == "first") {
  76. this.option1.requestUrl =
  77. "/api/v1/tms/getshipDeliveryNoticeList?apiId=69&status=0&carrierSSOId=" +
  78. getCookie("userId") +
  79. "&con=" +
  80. this.input;
  81. } else{
  82. this.option2.requestUrl =
  83. "/api/v1/tms/getshipDeliveryNoticeList?apiId=69&status=1&carrierSSOId=" +
  84. getCookie("userId") +
  85. "&con=" +
  86. this.input;
  87. }
  88. },
  89. addClick() {
  90. this.$router.push("/addDeliveryNotice/");
  91. },
  92. modifyclick(noticeId) {
  93. this.$router.push("/modifyDeliveryNotice/" + noticeId);
  94. },
  95. deleteclick(scope) {
  96. let noticeId = scope;
  97. this.$confirm("是否删除", "提示", {
  98. confirmButtonText: "确定",
  99. cancelButtonText: "取消",
  100. type: "warning",
  101. center: true
  102. })
  103. .then(() => {
  104. this.axios
  105. .post("/api/v1/tms/deleteByNoticeId/" + noticeId)
  106. .then(() => {
  107. this.$message({
  108. type: "success",
  109. message: "删除成功!"
  110. });
  111. this.option1.requestUrl =
  112. "/api/v1/tms/getshipDeliveryNoticeList?apiId=69&status=0&i=" +
  113. new Date();
  114. });
  115. })
  116. .catch(() => {
  117. this.$message({
  118. type: "info",
  119. message: "取消删除!"
  120. });
  121. });
  122. },
  123. toPhotoClick(noticeId) {
  124. this.axios
  125. .post("/api/v1/tms/downLoadDeilveryNotice?noticeId=" + noticeId)
  126. .then(res => {
  127. console.log("res",res.data.data);
  128. this.srcList = [];
  129. this.src = res.data.data;
  130. this.isShow = true;
  131. this.srcList.push(res.data.data);
  132. });
  133. },
  134. handleClick(tab, event) {
  135. console.log(tab, event);
  136. },
  137. sendClick(scope) {
  138. let noticeId = scope;
  139. this.$confirm("是否下发", "提示", {
  140. confirmButtonText: "确定",
  141. cancelButtonText: "取消",
  142. type: "warning",
  143. center: true
  144. })
  145. .then(() => {
  146. this.axios
  147. .post("/api/v1/tms/sendDeliveryNotice/" + noticeId)
  148. .then(() => {
  149. this.$message({
  150. type: "success",
  151. message: "下发成功!"
  152. });
  153. this.option1.requestUrl =
  154. "/api/v1/tms/getshipDeliveryNoticeList?apiId=69&status=0&i=" +
  155. new Date();
  156. this.option2.requestUrl =
  157. "/api/v1/tms/getshipDeliveryNoticeList?apiId=69&status=1&i=" +
  158. new Date();
  159. });
  160. })
  161. .catch(() => {
  162. this.$message({
  163. type: "info",
  164. message: "取消下发!"
  165. });
  166. });
  167. }
  168. }
  169. };
  170. </script>
  171. <style lang="scss" scoped>
  172. .shipTransport {
  173. .top {
  174. padding: 1.25rem 0.375rem;
  175. .el-input {
  176. width: 20%;
  177. margin-right: 40rpx;
  178. }
  179. }
  180. }
  181. </style>