deliveryAttorney.vue 5.2 KB

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