index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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') && mainData.status =='审核'" :disabled="mainData.status == '收货'" @click="onConfimRec">确认收货</el-button>
  21. <el-button class="inline-16" type="primary" size="mini" v-if="tool.checkAuth($route.name,'check')" @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,'addBoxInfo')" class="mt-10" @onSuccess="onBoxSuccess"></addBox>
  32. <boxlist :data="mainData" v-if="tool.checkAuth($route.name,'boxInfo') && mainData" 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.projectName
  105. },
  106. {
  107. label:'运费',
  108. value:this.mainData.freightamount
  109. },
  110. {
  111. label:'收货人',
  112. value:this.mainData.name
  113. },
  114. {
  115. label:'寄件方式',
  116. value:this.mainData.paytype
  117. },
  118. {
  119. label:'状态',
  120. value:this.mainData.status,
  121. style:function () {
  122. let style = {}
  123. switch (that.mainData.status) {
  124. case '新建':
  125. style = {color:"#000000"}
  126. break;
  127. case '审核':
  128. style = {color:"#d90a0a"}
  129. break;
  130. case '收货':
  131. style = {color:"#52C41A"}
  132. break;
  133. default:
  134. break;
  135. }
  136. return style
  137. }
  138. },
  139. {
  140. label:'经销商编码',
  141. value:this.mainData.agentnum
  142. },
  143. {
  144. label:'经销商简称',
  145. value:this.mainData.enterprisename
  146. },
  147. {
  148. label:'订单类型',
  149. value:this.mainData.type
  150. },
  151. {
  152. label:'回签单',
  153. value:this.mainData.signbackstatus
  154. },
  155. {
  156. label:'备注',
  157. value:this.mainData.remarks
  158. },
  159. ]
  160. },
  161. // 监听切换数据,上一页,下一页
  162. pageChange (id,rowindex,tabIndex) {
  163. this.flag = false
  164. tabIndex = this.$route.query.tabIndex
  165. this.$router.replace({path:'/logisticsdetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
  166. this.queryMainData(id)
  167. },
  168. onSuccess(){
  169. this.visible = false
  170. this.queryMainData(this.$route.query.id)
  171. this.$emit('onSuccess')
  172. },
  173. onCheck () {
  174. this.$confirm(`确定${this.mainData.status === '审核'?'反审核':'审核'}该物流单`, '提示', {
  175. confirmButtonText: '确定',
  176. cancelButtonText: '取消',
  177. type: 'warning'
  178. }).then(async () => {
  179. const res = await this.$api.requested({
  180. "id":20221122133104,
  181. "version":1,
  182. "content": {
  183. "sa_logisticsid":this.$route.query.id
  184. }
  185. })
  186. this.tool.showMessage(res,()=>{
  187. this.queryMainData()
  188. })
  189. }).catch(() => {
  190. this.$message({
  191. type: 'info',
  192. message: '已取消'
  193. });
  194. });
  195. },
  196. onConfimRec () {
  197. this.$confirm(`确认收货吗`, '提示', {
  198. confirmButtonText: '确定',
  199. cancelButtonText: '取消',
  200. type: 'warning'
  201. }).then(async () => {
  202. const res = await this.$api.requested({
  203. "id": "20221122133204",
  204. "content": {
  205. "sa_logisticsid":this.$route.query.id
  206. }
  207. })
  208. this.tool.showMessage(res,()=>{
  209. this.queryMainData()
  210. })
  211. }).catch(() => {
  212. this.$message({
  213. type: 'info',
  214. message: '已取消'
  215. });
  216. });
  217. },
  218. rowClick (row) {
  219. this.$refs['dismx'].listData(row.sa_dispatchid)
  220. },
  221. onBoxSuccess () {
  222. this.$refs['boxlist'].listData()
  223. },
  224. onInit (data) {
  225. this.$refs.dismx.listData(data.sa_dispatchid)
  226. }
  227. },
  228. mounted () {
  229. this.queryMainData(this.$route.query.id)
  230. },
  231. created() {
  232. }
  233. }
  234. </script>
  235. <style scoped>
  236. </style>