shipmentInstructions.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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-button type="primary" class="btn" @click="onclick">
  13. <i class="el-icon-search"></i>查询
  14. </el-button>
  15. <el-button class="btn" type="primary" @click="btnclick(0)">
  16. <i class="el-icon-circle-plus-outline"></i>新增
  17. </el-button>
  18. <el-button
  19. type="primary"
  20. class="btn"
  21. @click="addPick"
  22. v-if="activeName === 'second'"
  23. >
  24. <i class="el-icon-circle-plus-outline"></i>生成装船指令PDF
  25. </el-button>
  26. </div>
  27. <el-tabs v-model="activeName" @tab-click="handleClick">
  28. <!-- 未下发 -->
  29. <el-tab-pane label="未下发" name="first">
  30. <dilTable v-bind.sync="option" ref="table">
  31. <el-table-column
  32. fixed="right"
  33. label="操作"
  34. align="center"
  35. width="180"
  36. >
  37. <template slot-scope="scope">
  38. <el-button
  39. @click="selectclick(scope.row)"
  40. type="text"
  41. size="small"
  42. >加船</el-button
  43. >
  44. <el-button
  45. @click="issueclick(scope.row.instructionsId)"
  46. type="text"
  47. size="small"
  48. >下发</el-button
  49. >
  50. <el-button
  51. @click="click(scope.row.instructionsId)"
  52. type="text"
  53. size="small"
  54. >编辑</el-button
  55. >
  56. <el-button
  57. type="text"
  58. size="small"
  59. @click="deleteclick(scope.row.instructionsId)"
  60. >删除</el-button
  61. >
  62. </template>
  63. </el-table-column>
  64. </dilTable>
  65. </el-tab-pane>
  66. <!-- 已下发 -->
  67. <el-tab-pane label="已下发" name="second">
  68. <dilTable
  69. v-bind.sync="option2"
  70. @selection-change="selectionChange"
  71. ></dilTable>
  72. </el-tab-pane>
  73. </el-tabs>
  74. </div>
  75. </template>
  76. <script>
  77. export default {
  78. name: "homeworkPath",
  79. data() {
  80. return {
  81. restaurants: [],
  82. input: "",
  83. activeName: "first",
  84. option: {
  85. // 表格请求数据的地址
  86. requestUrl:
  87. "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=未下发",
  88. },
  89. option2: {
  90. // 表格请求数据的地址
  91. requestUrl:
  92. "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=已下发",
  93. selectionType: "select",
  94. },
  95. shipmentInstructionList: [],
  96. };
  97. },
  98. mounted() {},
  99. methods: {
  100. selectionChange(selection) {
  101. // console.log(selection);
  102. this.shipmentInstructionList = selection;
  103. },
  104. addPick() {
  105. if (this.shipmentInstructionList.length == 0) {
  106. this.$message.warning("请勾选已下发的提货委托,方可生成提货委托书");
  107. return;
  108. }
  109. // if (this.shipmentInstructionList.instructions != null) {
  110. // this.$message.warning("请勾选已下发的提货委托,方可生成提货委托书");
  111. // return;
  112. // }
  113. let shipmentInstructionList = {
  114. shipmentInstructionList: this.shipmentInstructionList,
  115. };
  116. // console.log("list", shipmentInstructionList);
  117. let test = encodeURIComponent(JSON.stringify(shipmentInstructionList));
  118. console.log("test",test);
  119. this.$router.push("/shipmentInstructionText/" + test);
  120. },
  121. handleClick(tab, event) {
  122. console.log(tab, event);
  123. },
  124. onclick() {
  125. if (this.activeName == "first") {
  126. this.option1.requestUrl =
  127. "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=未下发&carrierSSOId=" +
  128. getCookie("userId") +
  129. "&con=" +
  130. this.input;
  131. } else{
  132. this.option2.requestUrl =
  133. "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=已下发&carrierSSOId=" +
  134. getCookie("userId") +
  135. "&con=" +
  136. this.input;
  137. }
  138. },
  139. btnclick() {
  140. this.$router.push("/addShipmentInstructions/");
  141. },
  142. selectclick(row) {
  143. this.$router.push("/instructionsCapacity/" + row.instructionsId);
  144. },
  145. click(instructionsId) {
  146. this.$router.push("/updateShipmentInstructions/" + instructionsId);
  147. },
  148. deleteclick(scope) {
  149. let instructionsId = scope;
  150. this.$confirm("是否删除", "提示", {
  151. confirmButtonText: "确定",
  152. cancelButtonText: "取消",
  153. type: "warning",
  154. center: true,
  155. })
  156. .then(() => {
  157. this.axios
  158. .post("/api/v1/tms/deleteByPrimaryKey/" + instructionsId)
  159. .then(() => {
  160. this.$message({
  161. type: "success",
  162. message: "删除成功!",
  163. });
  164. this.option.requestUrl =
  165. "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=未下发&i=" +
  166. new Date();
  167. this.option2.requestUrl =
  168. "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=已下发&i=" +
  169. new Date();
  170. });
  171. })
  172. .catch(() => {
  173. this.$message({
  174. type: "info",
  175. message: "取消删除!",
  176. });
  177. });
  178. },
  179. issueclick(scope) {
  180. let instructionsId = scope;
  181. this.$confirm("是否下发", "提示", {
  182. confirmButtonText: "确定",
  183. cancelButtonText: "取消",
  184. type: "warning",
  185. center: true,
  186. })
  187. .then(() => {
  188. this.axios
  189. .post(
  190. "/api/v1/tms/sendShipmentInstructionsStatus/" + instructionsId
  191. )
  192. .then(() => {
  193. this.$message({
  194. type: "success",
  195. message: "下发成功!",
  196. });
  197. this.option.requestUrl =
  198. "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=未下发&i=" +
  199. new Date();
  200. this.option2.requestUrl =
  201. "/api/v1/tms/getShipMentInstructionsList?apiId=74&status=已下发&i=" +
  202. new Date();
  203. });
  204. })
  205. .catch(() => {
  206. this.$message({
  207. type: "info",
  208. message: "取消下发!",
  209. });
  210. });
  211. },
  212. },
  213. };
  214. </script>
  215. <style lang="scss" scoped>
  216. .shipTransport {
  217. .top {
  218. padding: 1.25rem 0.375rem;
  219. .el-input {
  220. width: 20%;
  221. margin-right: 40rpx;
  222. }
  223. .btn {
  224. width: 12%;
  225. margin-left: 0.25rem;
  226. }
  227. }
  228. }
  229. </style>