deliveryNotice.vue 6.9 KB

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