deliveryAttorney.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <!-- 提货委托页面 -->
  3. <div class="shipTransport">
  4. <div class="top">
  5. <el-input
  6. class="el-input"
  7. placeholder="请输入内容"
  8. v-model="input"
  9. clearable
  10. >
  11. </el-input>
  12. <!-- <el-date-picker
  13. v-model="startTime"
  14. type="datetime"
  15. placeholder="选择日期"
  16. >
  17. </el-date-picker>
  18. <span>至</span>
  19. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
  20. </el-date-picker> -->
  21. <el-button type="primary" class="btn" @click="onclick">
  22. <i class="el-icon-search"></i>查询
  23. </el-button>
  24. <el-button type="primary" class="btn" @click="addClick">
  25. <i class="el-icon-circle-plus-outline"></i>新增
  26. </el-button>
  27. <el-button type="primary" @click="refresh()">
  28. <i class="el-icon-refresh"></i>刷新
  29. </el-button>
  30. <el-button
  31. type="primary"
  32. class="btn"
  33. @click="addPick"
  34. v-if="activeName === 'second'"
  35. >
  36. <i class="el-icon-circle-plus-outline"></i>生成提货委托书
  37. </el-button>
  38. </div>
  39. <el-tabs v-model="activeName">
  40. <!-- 未下发 -->
  41. <el-tab-pane label="未下发" name="first">
  42. <dilTable v-bind.sync="option1" ref="table">
  43. <el-table-column
  44. fixed="right"
  45. align="center"
  46. label="操作"
  47. width="120"
  48. >
  49. <template slot-scope="scope">
  50. <el-button
  51. @click="sendClick(scope.row.attorneyId)"
  52. type="text"
  53. size="small"
  54. >
  55. 下发
  56. </el-button>
  57. <el-button
  58. @click="modifyClick(scope.row.attorneyId)"
  59. type="text"
  60. size="small"
  61. >
  62. 修改
  63. </el-button>
  64. <el-button
  65. @click="deleteclick(scope.row.attorneyId)"
  66. type="text"
  67. size="small"
  68. >
  69. 删除
  70. </el-button>
  71. </template>
  72. </el-table-column>
  73. </dilTable>
  74. </el-tab-pane>
  75. <!-- 已下发 -->
  76. <el-tab-pane label="已下发" name="second">
  77. <dilTable v-bind.sync="option2" @selection-change="selectionChange">
  78. <el-table-column
  79. fixed="right"
  80. align="center"
  81. label="操作"
  82. width="120"
  83. >
  84. <!-- <template slot-scope="scope">
  85. <el-button
  86. @click="modifyClick(scope.row.attorneyId)"
  87. type="text"
  88. size="small"
  89. :disabled="scope.row.purchaseOrderMaterialNum && scope.row.realForeignShipName && scope.row.realForeignShipName != '' && scope.row.realForeignShipName != 'null'"
  90. >
  91. 修改
  92. </el-button>
  93. </template> -->
  94. </el-table-column>
  95. </dilTable>
  96. </el-tab-pane>
  97. </el-tabs>
  98. </div>
  99. </template>
  100. <script>
  101. import { sjTime } from "@/utils/sharedJsFile";
  102. import { getCookie } from "@/utils/util.js";
  103. export default {
  104. name: "homeworkPath",
  105. data() {
  106. return {
  107. input: "",
  108. activeName: "first",
  109. attorneyId: null,
  110. option1: {
  111. // 表格请求数据的地址
  112. requestUrl:
  113. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=0"
  114. },
  115. option2: {
  116. // 表格请求数据的地址
  117. requestUrl:
  118. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=1",
  119. selectionType: "select"
  120. },
  121. amsShipDeliveryList: [],
  122. startTime: null,
  123. endTime: null,
  124. };
  125. },
  126. methods: {
  127. selectionChange(selection) {
  128. this.amsShipDeliveryList = selection;
  129. },
  130. onclick() {
  131. let startTime = null;
  132. let endTime = null;
  133. if (this.startTime) {
  134. startTime = sjTime(this.startTime);
  135. }
  136. if (this.endTime) {
  137. endTime = sjTime(this.endTime);
  138. }
  139. if(startTime && endTime && startTime < endTime){
  140. if (this.activeName == "first") {
  141. this.option1.requestUrl =
  142. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=0&carrierSSOId=" +
  143. getCookie("userId") +
  144. "&con=" +
  145. this.input+
  146. "&startTime=" +
  147. startTime +
  148. "&endTime=" +
  149. endTime;
  150. } else{
  151. this.option2.requestUrl =
  152. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=1&carrierSSOId=" +
  153. getCookie("userId") +
  154. "&con=" +
  155. this.input+
  156. "&startTime=" +
  157. startTime +
  158. "&endTime=" +
  159. endTime;
  160. }
  161. }else{
  162. if (this.activeName == "first") {
  163. this.option1.requestUrl =
  164. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=0&carrierSSOId=" +
  165. getCookie("userId") +
  166. "&con=" +
  167. this.input;
  168. } else{
  169. this.option2.requestUrl =
  170. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=1&carrierSSOId=" +
  171. getCookie("userId") +
  172. "&con=" +
  173. this.input;
  174. }
  175. }
  176. },
  177. click(pathId) {
  178. this.$router.push("/path/addDeliveryNotice/" + pathId);
  179. },
  180. addClick() {
  181. this.$router.push("/addDeliveryAttorney/");
  182. },
  183. // 生成提货委托书
  184. addPick() {
  185. if (this.amsShipDeliveryList.length == 0) {
  186. this.$message.warning("请勾选已下发的提货委托,方可生成提货委托书");
  187. return;
  188. }
  189. let amsShipDeliveryNameList = {
  190. amsShipDeliveryNameList: this.amsShipDeliveryList
  191. };
  192. console.log("list",amsShipDeliveryNameList);
  193. let test = encodeURIComponent(JSON.stringify(amsShipDeliveryNameList));
  194. this.$router.push("/attorneytext/" + test);
  195. },
  196. //修改
  197. modifyClick(attorneyId) {
  198. this.$router.push("/modifyDeliveryAttroney/" + attorneyId);
  199. },
  200. deleteclick(scope) {
  201. let attorneyId = scope;
  202. this.$confirm("是否删除", "提示", {
  203. confirmButtonText: "确定",
  204. cancelButtonText: "取消",
  205. type: "warning",
  206. center: true
  207. })
  208. .then(() => {
  209. this.axios
  210. .post("/api/v1/tms/deleteByAttorneyId/" + attorneyId)
  211. .then(() => {
  212. this.$message({
  213. type: "success",
  214. message: "删除成功!"
  215. });
  216. this.option1.requestUrl =
  217. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=0&i=" +
  218. new Date();
  219. });
  220. })
  221. .catch(() => {
  222. this.$message({
  223. type: "info",
  224. message: "取消删除!"
  225. });
  226. });
  227. },
  228. sendClick(scope) {
  229. let attorneyId = scope;
  230. this.$confirm("是否下发", "提示", {
  231. confirmButtonText: "确定",
  232. cancelButtonText: "取消",
  233. type: "warning",
  234. center: true
  235. })
  236. .then(() => {
  237. this.$message({
  238. type: "success",
  239. message: "下发成功"
  240. });
  241. this.axios
  242. .post("/api/v1/tms/sendDeliveryAttorneyStatus/" + attorneyId)
  243. .then(() => {
  244. this.option1.requestUrl =
  245. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=0&i=" +
  246. new Date();
  247. this.option2.requestUrl =
  248. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=1&i=" +
  249. new Date();
  250. });
  251. })
  252. .catch(() => {
  253. this.$message({
  254. type: "info",
  255. message: "下发失败!"
  256. });
  257. });
  258. },
  259. refresh(){
  260. this.$router.go(0);
  261. }
  262. }
  263. };
  264. </script>
  265. <style lang="scss" scoped>
  266. .shipTransport {
  267. .top {
  268. padding: 1.25rem 0.375rem;
  269. .el-input {
  270. width: 20%;
  271. margin-right: 40rpx;
  272. }
  273. }
  274. }
  275. </style>