deliveryAttorney.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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 type="primary" class="btn" @click="addClick">
  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-show="activeName === 'second'"
  23. v-model="makeSure"
  24. >
  25. <i class="el-icon-circle-plus-outline"></i>生成提货委托书
  26. </el-button>
  27. </div>
  28. <el-tabs v-model="activeName" @tab-click="handleClick">
  29. <!-- 未下发 -->
  30. <el-tab-pane label="未下发" name="first">
  31. <dilTable v-bind.sync="option1" ref="table">
  32. <el-table-column
  33. fixed="right"
  34. align="center"
  35. label="操作"
  36. width="120"
  37. >
  38. <template slot-scope="scope">
  39. <el-button
  40. @click="sendClick(scope.row.attorneyId)"
  41. type="text"
  42. size="small"
  43. >
  44. 下发
  45. </el-button>
  46. <el-button
  47. @click="modifyClick(scope.row.attorneyId)"
  48. type="text"
  49. size="small"
  50. >
  51. 修改
  52. </el-button>
  53. <el-button
  54. @click="deleteclick(scope.row.attorneyId)"
  55. type="text"
  56. size="small"
  57. >
  58. 删除
  59. </el-button>
  60. </template>
  61. </el-table-column>
  62. </dilTable>
  63. </el-tab-pane>
  64. <!-- 已下发 -->
  65. <el-tab-pane label="已下发" name="second">
  66. <dilTable
  67. v-bind.sync="option2"
  68. @selection-change="currentSelectionChange"
  69. >
  70. </dilTable>
  71. </el-tab-pane>
  72. </el-tabs>
  73. </div>
  74. </template>
  75. <script>
  76. export default {
  77. name: "homeworkPath",
  78. data() {
  79. return {
  80. // restaurants: [],
  81. input: "",
  82. activeName: "first",
  83. amsShipDeliveryList: {},
  84. option1: {
  85. // 表格请求数据的地址
  86. requestUrl:
  87. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=0",
  88. },
  89. option2: {
  90. // 表格请求数据的地址
  91. requestUrl:
  92. "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=1",
  93. selectionType: "select",
  94. amsShipList: [],
  95. },
  96. };
  97. },
  98. methods: {
  99. // querySearch(queryString, cb) {
  100. // var restaurants = this.restaurants;
  101. // var results = queryString
  102. // ? restaurants.filter(this.createFilter(queryString))
  103. // : restaurants;
  104. // cb(results);
  105. // },
  106. // createFilter(queryString) {
  107. // return (restaurant) => {
  108. // return (
  109. // restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
  110. // 0
  111. // );
  112. // };
  113. // },
  114. // 将所有数据送到新增提货委托书
  115. makeSure() {
  116. // let amsShipDeliveryList={
  117. // amsShipDeliveryList=this.amsShipDeliveryList
  118. // }
  119. },
  120. // 通过事件显示生成提货委托书按钮
  121. currentSelectionChange(selection) {
  122. this.amsShipDeliveryList = selection;
  123. },
  124. handleClick(tab, event) {
  125. console.log(tab, event);
  126. },
  127. onclick() {
  128. // this.option.requestUrl =
  129. // "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&con=" + this.input;
  130. },
  131. click(pathId) {
  132. this.$router.push("/path/addDeliveryNotice/" + pathId);
  133. },
  134. addClick() {
  135. this.$router.push("/addDeliveryAttorney/");
  136. },
  137. // 生成提货委托书
  138. addPick(){
  139. // console.log("enter")
  140. // console.log(this.amsShipDeliveryList);
  141. let amsShipDeliveryNameList={
  142. amsShipDeliveryNameList:this.amsShipDeliveryList
  143. }
  144. // console.log(amsShipDeliveryNameList)
  145. let test = encodeURIComponent(JSON.stringify(amsShipDeliveryNameList))
  146. console.log("test "+test)
  147. this.$router.push("/attorneytext/"+test);
  148. },
  149. modifyClick(attorneyId) {
  150. this.$router.push("/modifyDeliveryAttroney/" + attorneyId);
  151. },
  152. deleteclick(scope) {
  153. let attorneyId = scope;
  154. this.$confirm("是否删除", "提示", {
  155. confirmButtonText: "确定",
  156. cancelButtonText: "取消",
  157. type: "warning",
  158. center: true,
  159. })
  160. .then(() => {
  161. this.$message({
  162. type: "success",
  163. message: "删除成功!",
  164. });
  165. this.axios
  166. .post("/api/v1/tms/deleteByAttorneyId/" + attorneyId)
  167. .then(() => {
  168. this.$router.go(0);
  169. });
  170. })
  171. .catch(() => {
  172. this.$message({
  173. type: "info",
  174. message: "取消删除!",
  175. });
  176. });
  177. },
  178. sendClick(scope) {
  179. let attorneyId = scope;
  180. this.$confirm("是否下发", "提示", {
  181. confirmButtonText: "确定",
  182. cancelButtonText: "取消",
  183. type: "warning",
  184. center: true,
  185. })
  186. .then(() => {
  187. this.$message({
  188. type: "success",
  189. message: "下发成功",
  190. });
  191. this.axios
  192. .post("/api/v1/tms/sendDeliveryAttorneyStatus/" + attorneyId)
  193. .then(() => {
  194. this.$router.go(0);
  195. });
  196. })
  197. .catch(() => {
  198. this.$message({
  199. type: "info",
  200. message: "下发失败!",
  201. });
  202. });
  203. },
  204. },
  205. };
  206. </script>
  207. <style lang='scss' scoped>
  208. .shipTransport {
  209. .top {
  210. padding: 1.25rem 0.375rem;
  211. .el-input {
  212. width: 20%;
  213. margin-right: 40rpx;
  214. }
  215. }
  216. }
  217. </style>