index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="`${mainData.billno}`"
  6. :editData="mainData"
  7. :mainAreaData="mainAreaData"
  8. turnPageId="20221122132804"
  9. idname="sa_logisticsid"
  10. ownertable="sa_logistics"
  11. delApiId="20221122132904"
  12. tags=""
  13. :tabs="['基础信息','物流单明细','装箱信息','物流信息']"
  14. @pageChange="pageChange"
  15. @onEditSuccess="queryMainData($route.query.id)">
  16. <div slot="tags">
  17. </div>
  18. <div slot="customOperation" >
  19. <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update')" :data="mainData" @onSuccess="queryMainData(),$refs.dispatch.listData()"/>
  20. <el-button type="primary" size="mini" v-if="tool.checkAuth($route.name,'confirmRec')" :disabled="mainData.status !== '收货'" @click="onConfimRec">确认收货</el-button>
  21. <el-button class="inline-16" type="primary" size="mini" v-if="tool.checkAuth($route.name,'check')" :disabled="mainData.status !== '收货'" @click="onCheck">{{mainData.status === '审核'?'反审':'审核'}}</el-button>
  22. </div>
  23. <div slot="slot0" >
  24. <defalutInfo :mainData="mainData" ref="info"></defalutInfo>
  25. </div>
  26. <div slot="slot1" >
  27. <dispatchTable ref="dispatch" @onInit="onInit" @rowClick="rowClick" :needQuery="true"></dispatchTable>
  28. <dismx ref="dismx"></dismx>
  29. </div>
  30. <div slot="slot2">
  31. <addBox v-if="tool.checkAuth($route.name,'boxInfo')" class="mt-10" @onSuccess="onBoxSuccess"></addBox>
  32. <boxlist v-if="tool.checkAuth($route.name,'addBoxInfo')" ref="boxlist"></boxlist>
  33. <el-empty description="暂无查询权限" v-else></el-empty>
  34. </div>
  35. <div slot="slot3">
  36. <courierRecords></courierRecords>
  37. </div>
  38. </basicDetails>
  39. </div>
  40. </template>
  41. <script>
  42. import Edit from '../modules/edit'
  43. import defalutInfo from '../modules/defaultInfo.vue'
  44. import dispatchTable from '../modules/dispatchTable.vue'
  45. import dismx from '../modules/productlist.vue'
  46. import addBox from './tabs/logisticsBox/add.vue'
  47. import boxlist from './tabs/logisticsBox/logisticsBox.vue'
  48. import courierRecords from './tabs/courierRecords.vue'
  49. export default {
  50. name: "detail",
  51. data() {
  52. return {
  53. mainData:{},
  54. mainAreaData:{}
  55. }
  56. },
  57. components:{
  58. defalutInfo,
  59. dispatchTable,
  60. dismx,
  61. addBox,
  62. boxlist,
  63. courierRecords,
  64. Edit
  65. },
  66. methods:{
  67. async queryMainData(id) {
  68. const res = await this.$api.requested({
  69. "id": 20221204201804,
  70. "content": {
  71. "sa_logisticsid":this.$route.query.id
  72. }
  73. })
  74. this.mainData = res.data[0]
  75. console.log(this.mainData);
  76. this.changeDataStructure()
  77. /* this.$refs.info.style(this.mainData.status)*/
  78. },
  79. changeDataStructure() {
  80. let that = this
  81. this.mainAreaData = [
  82. {
  83. label:'物流编号',
  84. value:this.mainData.billno
  85. },
  86. {
  87. label:'单据日期',
  88. value:this.mainData.billdate
  89. },
  90. {
  91. label:'车牌号',
  92. value:this.mainData.carnum
  93. },
  94. {
  95. label:'物流联系人',
  96. value:this.mainData.logiscontact
  97. },
  98. {
  99. label:'物流电话',
  100. value:this.mainData.logisphone
  101. },
  102. {
  103. label:'运费',
  104. value:this.mainData.freightamount
  105. },
  106. {
  107. label:'收货人',
  108. value:this.mainData.name
  109. },
  110. {
  111. label:'寄件方式',
  112. value:this.mainData.paytype
  113. },
  114. {
  115. label:'状态',
  116. value:this.mainData.status,
  117. style:function () {
  118. let style = {}
  119. switch (that.mainData.status) {
  120. case '新建':
  121. style = {color:"#000000"}
  122. break;
  123. case '审核':
  124. style = {color:"#d90a0a"}
  125. break;
  126. case '收货':
  127. style = {color:"#52C41A"}
  128. break;
  129. default:
  130. break;
  131. }
  132. return style
  133. }
  134. },
  135. {
  136. label:'经销商编码',
  137. value:this.mainData.agentnum
  138. },
  139. {
  140. label:'经销商简称',
  141. value:this.mainData.enterprisename
  142. },
  143. ]
  144. },
  145. // 监听切换数据,上一页,下一页
  146. pageChange (id,rowindex,tabIndex) {
  147. this.flag = false
  148. tabIndex = this.$route.query.tabIndex
  149. this.$router.replace({path:'/logisticsdetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
  150. this.queryMainData(id)
  151. },
  152. onSuccess(){
  153. this.visible = false
  154. this.queryMainData(this.$route.query.id)
  155. this.$emit('onSuccess')
  156. },
  157. onCheck () {
  158. this.$confirm(`确定${this.mainData.status === '审核'?'反审核':'审核'}该发货单`, '提示', {
  159. confirmButtonText: '确定',
  160. cancelButtonText: '取消',
  161. type: 'warning'
  162. }).then(async () => {
  163. const res = await this.$api.requested({
  164. "id":20221122133104,
  165. "version":1,
  166. "content": {
  167. "sa_logisticsid":this.$route.query.id
  168. }
  169. })
  170. this.tool.showMessage(res,()=>{
  171. this.queryMainData()
  172. })
  173. }).catch(() => {
  174. this.$message({
  175. type: 'info',
  176. message: '已取消'
  177. });
  178. });
  179. },
  180. onConfimRec () {
  181. this.$confirm(`确认收货吗`, '提示', {
  182. confirmButtonText: '确定',
  183. cancelButtonText: '取消',
  184. type: 'warning'
  185. }).then(async () => {
  186. const res = await this.$api.requested({
  187. "id": "20221122133204",
  188. "content": {
  189. "sa_logisticsid":this.$route.query.id
  190. }
  191. })
  192. this.tool.showMessage(res,()=>{
  193. this.queryMainData()
  194. })
  195. }).catch(() => {
  196. this.$message({
  197. type: 'info',
  198. message: '已取消'
  199. });
  200. });
  201. },
  202. rowClick (row) {
  203. this.$refs['dismx'].listData(row.sa_dispatchid)
  204. },
  205. onBoxSuccess () {
  206. this.$refs['boxlist'].listData()
  207. },
  208. onInit (data) {
  209. this.$refs.dismx.listData(data.sa_dispatchid)
  210. }
  211. },
  212. mounted () {
  213. this.queryMainData(this.$route.query.id)
  214. },
  215. created() {
  216. }
  217. }
  218. </script>
  219. <style scoped>
  220. </style>