index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="`单号:${mainData.sonum}`"
  6. :editData="mainData"
  7. :mainAreaData="mainAreaData"
  8. turnPageId="20230114105002"
  9. idname="sa_orderid"
  10. ownertable="sa_order"
  11. delApiId="20230116100002"
  12. :statusCheck="[{key:'status',value:'审核'},{key:'status',value:'交期待确认'},{key:'status',value:'提交'},{key:'status',value:'交期确认'}]"
  13. :tabs="['借用单明细']"
  14. @pageChange="pageChange"
  15. @onEditSuccess="queryMainData($route.query.id)">
  16. <div slot="customOperation" class="inline-16">
  17. <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="queryMainData();$refs.tool.listData()"/>
  18. <el-button v-if="tool.checkAuth($route.name,'confirmDate')" :disabled="mainData.status !== '交期待确认'" type="primary" size="mini" @click="confirmdate">确认交期</el-button>
  19. <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'" type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
  20. </div>
  21. <div slot="slot0" >
  22. <toolList ref="tool"></toolList>
  23. </div>
  24. <div slot="slot1" >
  25. </div>
  26. </basicDetails>
  27. </div>
  28. </template>
  29. <script>
  30. import toolList from './tabs/toolList.vue'
  31. import confirmDate from '../modules/confirmDate.vue'
  32. import Edit from '../modules/edit'
  33. export default {
  34. name: "detail",
  35. data() {
  36. return {
  37. mainData:{},
  38. mainAreaData:{},
  39. options:[],
  40. value:''
  41. }
  42. },
  43. components:{
  44. Edit,
  45. toolList,
  46. confirmDate
  47. },
  48. methods:{
  49. async orderreviewtype () {
  50. const res = await this.$store.dispatch('optiontypeselect','orderreviewtype')
  51. this.options = res.data
  52. this.value = res.data[0].value
  53. },
  54. async queryMainData(id) {
  55. const res = await this.$api.requested({
  56. "id":20230114140402,
  57. "content": {
  58. "sa_orderid": this.$route.query.id
  59. }
  60. })
  61. this.mainData = res.data
  62. console.log(this.mainData);
  63. this.changeDataStructure()
  64. this.orderreviewtype()
  65. },
  66. changeDataStructure() {
  67. let that = this
  68. this.mainAreaData = [
  69. {
  70. label:'单据日期',
  71. value:this.mainData.billdate
  72. },
  73. {
  74. label:'经销商',
  75. value:this.mainData.enterprisename
  76. },
  77. {
  78. label:'状态',
  79. value:this.mainData.status,
  80. style:function () {
  81. let style = {}
  82. switch (that.mainData.status) {
  83. case '新建':
  84. style = {color:"#000000"}
  85. break;
  86. case '提交':
  87. style = {color:"#d90a0a"}
  88. break;
  89. case '交期待确认':
  90. style = {color:"#e09a1a"}
  91. break;
  92. case '交期确认':
  93. style = {color:"#3874f6"}
  94. break;
  95. case '审核':
  96. style = {color:"#52C41A"}
  97. break;
  98. case '关闭':
  99. style = {color:"#b2c0ea"}
  100. break;
  101. default:
  102. break;
  103. }
  104. return style
  105. }
  106. },
  107. {
  108. label:'合同',
  109. value:this.mainData.contract_title?this.mainData.contract_title:'无合同'
  110. },
  111. {
  112. label:'合计数量',
  113. value:this.mainData.qty * this.mainData.toolcount
  114. },
  115. {
  116. label:'金额',
  117. value:this.mainData.amount
  118. },
  119. {
  120. label:'收货人',
  121. value:this.mainData.name
  122. },
  123. {
  124. label:'收货地址',
  125. value:this.mainData.province + this.mainData.city + this.mainData.county + this.mainData.address
  126. },
  127. {
  128. label:'审核日期',
  129. value:this.mainData.checkdate
  130. },
  131. {
  132. label:'备注',
  133. value:this.mainData.remarks
  134. }
  135. ]
  136. },
  137. // 监听切换数据,上一页,下一页
  138. pageChange (id,rowindex,tabIndex) {
  139. this.$refs['details'].param.content.isManage = 0
  140. tabIndex = this.$route.query.tabIndex
  141. this.$router.replace({path:'/toolBorrowingDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
  142. this.queryMainData(id)
  143. },
  144. // 提交订单
  145. onSubmit (type) {
  146. this.$confirm(`是否${type}该订单`, '提示', {
  147. confirmButtonText: '确定',
  148. cancelButtonText: '取消',
  149. type: 'warning'
  150. }).then(async () => {
  151. const res = await this.$api.requested({
  152. "id": type === '审核'?20230114161402:20230114160002,
  153. "content": {
  154. "sa_orderid": this.mainData.sa_orderid,
  155. "sys_enterpriseid": this.mainData.sys_enterpriseid,
  156. "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
  157. "reviewtype":type === '审核'?this.value:''
  158. },
  159. })
  160. this.tool.showMessage(res,async ()=>{
  161. this.visible = false
  162. this.queryMainData()
  163. })
  164. }).catch((err) => {
  165. this.$message({
  166. type: 'info',
  167. message: '取消'
  168. });
  169. });
  170. },
  171. async confirmdate () {
  172. const res = await this.$api.requested({
  173. "id": 20230129154102,
  174. "content": {
  175. "sa_orderid": this.$route.query.id
  176. }
  177. })
  178. this.tool.showMessage(res,()=>{
  179. this.queryMainData()
  180. })
  181. },
  182. },
  183. mounted () {
  184. this.queryMainData(this.$route.query.id)
  185. },
  186. created() {
  187. }
  188. }
  189. </script>
  190. <style scoped>
  191. </style>