index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="`${mainData.billno}`"
  6. :oldFormPath="{edit:'HDrpManagement/logistics/modules'}"
  7. :editData="mainData"
  8. :mainAreaData="mainAreaData"
  9. turnPageId="20221122132804"
  10. idname="sa_logisticsid"
  11. ownertable="sa_logistics"
  12. delApiId="20221122132904"
  13. tags=""
  14. :tabs="['基础信息','物流单明细','装箱信息','物流信息']"
  15. @pageChange="pageChange"
  16. @onEditSuccess="queryMainData($route.query.id)">
  17. <div slot="tags">
  18. </div>
  19. <div slot="customOperation" >
  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 @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 ref="boxlist"></boxlist>
  33. </div>
  34. <div slot="slot3">
  35. <courierRecords></courierRecords>
  36. </div>
  37. </basicDetails>
  38. </div>
  39. </template>
  40. <script>
  41. import defalutInfo from '../modules/defaultInfo.vue'
  42. import dispatchTable from '../modules/dispatchTable.vue'
  43. import dismx from '../modules/productlist.vue'
  44. import addBox from './tabs/logisticsBox/add.vue'
  45. import boxlist from './tabs/logisticsBox/logisticsBox.vue'
  46. import courierRecords from './tabs/courierRecords.vue'
  47. export default {
  48. name: "detail",
  49. data() {
  50. return {
  51. mainData:{},
  52. mainAreaData:{}
  53. }
  54. },
  55. components:{
  56. defalutInfo,
  57. dispatchTable,
  58. dismx,
  59. addBox,
  60. boxlist,
  61. courierRecords
  62. },
  63. methods:{
  64. async queryMainData(id) {
  65. const res = await this.$api.requested({
  66. "id": 20221204201804,
  67. "content": {
  68. "sa_logisticsid":this.$route.query.id
  69. }
  70. })
  71. this.mainData = res.data[0]
  72. console.log(this.mainData);
  73. this.changeDataStructure()
  74. /* this.$refs.info.style(this.mainData.status)*/
  75. },
  76. changeDataStructure() {
  77. let that = this
  78. this.mainAreaData = [
  79. {
  80. label:'物流编号',
  81. value:this.mainData.billno
  82. },
  83. {
  84. label:'单据日期',
  85. value:this.mainData.billdate
  86. },
  87. {
  88. label:'状态',
  89. value:this.mainData.status,
  90. style:function () {
  91. let style = {}
  92. switch (that.mainData.status) {
  93. case '新建':
  94. style = {color:"#000000"}
  95. break;
  96. case '审核':
  97. style = {color:"#d90a0a"}
  98. break;
  99. case '收货':
  100. style = {color:"#52C41A"}
  101. break;
  102. default:
  103. break;
  104. }
  105. return style
  106. }
  107. },
  108. {
  109. label:'经销商编码',
  110. value:this.mainData.agentnum
  111. },
  112. {
  113. label:'经销商简称',
  114. value:this.mainData.enterprisename
  115. },
  116. ]
  117. },
  118. // 监听切换数据,上一页,下一页
  119. pageChange (id,rowindex,tabIndex) {
  120. this.flag = false
  121. tabIndex = this.$route.query.tabIndex
  122. this.$router.replace({path:'/logisticsdetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
  123. this.queryMainData(id)
  124. },
  125. onSuccess(){
  126. this.visible = false
  127. this.queryMainData(this.$route.query.id)
  128. this.$emit('onSuccess')
  129. },
  130. onCheck () {
  131. this.$confirm(`确定${this.mainData.status === '审核'?'反审核':'审核'}该发货单`, '提示', {
  132. confirmButtonText: '确定',
  133. cancelButtonText: '取消',
  134. type: 'warning'
  135. }).then(async () => {
  136. const res = await this.$api.requested({
  137. "id":20221122133104,
  138. "version":1,
  139. "content": {
  140. "sa_logisticsid":this.$route.query.id
  141. }
  142. })
  143. this.tool.showMessage(res,()=>{
  144. this.queryMainData()
  145. })
  146. }).catch(() => {
  147. this.$message({
  148. type: 'info',
  149. message: '已取消'
  150. });
  151. });
  152. },
  153. onConfimRec () {
  154. this.$confirm(`确认收货吗`, '提示', {
  155. confirmButtonText: '确定',
  156. cancelButtonText: '取消',
  157. type: 'warning'
  158. }).then(async () => {
  159. const res = await this.$api.requested({
  160. "id": "20221122133204",
  161. "content": {
  162. "sa_logisticsid":this.$route.query.id
  163. }
  164. })
  165. this.tool.showMessage(res,()=>{
  166. this.queryMainData()
  167. })
  168. }).catch(() => {
  169. this.$message({
  170. type: 'info',
  171. message: '已取消'
  172. });
  173. });
  174. },
  175. rowClick (row) {
  176. this.$refs['dismx'].listData(row.sa_dispatchid)
  177. },
  178. onBoxSuccess () {
  179. this.$refs['boxlist'].listData()
  180. }
  181. },
  182. mounted () {
  183. this.queryMainData(this.$route.query.id)
  184. },
  185. created() {
  186. }
  187. }
  188. </script>
  189. <style scoped>
  190. </style>