index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="`${mainData.sonum}`"
  6. :editData="mainData"
  7. :mainAreaData="mainAreaData"
  8. turnPageId="20221224180302"
  9. idname="sa_orderid"
  10. ownertable="sa_order"
  11. delApiId="20221108152102"
  12. tags=""
  13. :statusCheck="[{key:'status',value:'审核'},{key:'status',value:'提交'},{key:'status',value:'关闭'}]"
  14. :tabs="['基本信息','订单明细','订单进度','居间费明细','发货单','物流单','发票记录','收支明细']"
  15. @pageChange="pageChange"
  16. @onEditSuccess="queryMainData($route.query.id)">
  17. <div slot="customOperation" class="inline-16">
  18. <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && mainData.status == '新建'" :data="mainData" @onSuccess="queryMainData" />
  19. <el-button :disabled="mainData.status !== '交期待确认'" type="primary" size="mini" @click="confirmdate">确认交期</el-button>
  20. <el-button v-if="tool.checkAuth($route.name,'submit')" :disabled="mainData.status !== '新建'" type="primary" size="mini" @click="onSubmit('提交')">提 交</el-button>
  21. <el-button v-if="tool.checkAuth($route.name,'insert')" type="primary" size="mini" @click="onCopy">复 制</el-button>
  22. </div>
  23. <div slot="slot0">
  24. <default-info :mainData="mainData"></default-info>
  25. </div>
  26. <div slot="slot1">
  27. <product-list :data="mainData" ref="prod"></product-list>
  28. </div>
  29. <div slot="slot2">
  30. <orderprogress ref="prod"></orderprogress>
  31. </div>
  32. <div slot="slot3">
  33. <rebat></rebat>
  34. </div>
  35. <div slot="slot4">
  36. <dispatch></dispatch>
  37. </div>
  38. <div slot="slot5">
  39. <logistics></logistics>
  40. </div>
  41. <div slot="slot6">
  42. <invoiceTable></invoiceTable>
  43. </div>
  44. <div slot="slot7">
  45. <revenue :data="mainData"></revenue>
  46. </div>
  47. </basicDetails>
  48. <el-dialog append-to-body title="退回原因" :visible.sync="dialogVisible" width="400px">
  49. <el-input v-model="backreason" type="textarea" placeholder="请输入退回原因"></el-input>
  50. <span slot="footer" class="dialog-footer">
  51. <el-button @click="dialogVisible = false" size="small">取 消</el-button>
  52. <el-button type="primary" @click="onRebanck" size="small">确 定</el-button>
  53. </span>
  54. </el-dialog>
  55. </div>
  56. </template>
  57. <script>
  58. import Edit from '../modules/edit'
  59. import defaultInfo from './tabs/defaultInfo.vue';
  60. import productList from '../modules/productlist.vue'
  61. import rebat from './tabs/rebatesettlement.vue'
  62. import orderprogress from './tabs/orderpProgress.vue'
  63. import logistics from './tabs/logistics.vue'
  64. import dispatch from './tabs/dispatch.vue'
  65. import invoiceTable from './tabs/invoiceTable.vue'
  66. import revenue from './tabs/revenueAndExp.vue'
  67. export default {
  68. name: "detail",
  69. data() {
  70. return {
  71. mainData:{},
  72. mainAreaData:{},
  73. backreason:'',
  74. dialogVisible:false
  75. }
  76. },
  77. provide() {
  78. return {
  79. thisDetail: () => this
  80. }
  81. },
  82. components:{
  83. Edit,
  84. defaultInfo,
  85. productList,
  86. rebat,
  87. orderprogress,
  88. dispatch,
  89. logistics,
  90. invoiceTable,
  91. revenue
  92. },
  93. methods:{
  94. async queryMainData(id) {
  95. return new Promise(async (re,rj) => {
  96. const res = await this.$api.requested({
  97. "id":'20221108151302',
  98. "content": {
  99. "sa_orderid": this.$route.query.id
  100. }
  101. })
  102. this.mainData = res.data
  103. console.log(this.mainData);
  104. this.changeDataStructure()
  105. re()
  106. })
  107. },
  108. changeDataStructure() {
  109. let that = this
  110. this.mainAreaData = [
  111. {
  112. label:'订单类型',
  113. value:this.mainData.type
  114. },
  115. {
  116. label:'订单状态',
  117. value:this.mainData.status,
  118. style:function () {
  119. let style = {}
  120. switch (that.mainData.status) {
  121. case '新建':
  122. style = {color:"#000000"}
  123. break;
  124. case '提交':
  125. style = {color:"#d90a0a"}
  126. break;
  127. case '交期待确认':
  128. style = {color:"#e09a1a"}
  129. break;
  130. case '交期确认':
  131. style = {color:"#3874f6"}
  132. break;
  133. case '审核':
  134. style = {color:"#52C41A"}
  135. break;
  136. case '关闭':
  137. style = {color:"#b2c0ea"}
  138. break;
  139. default:
  140. break;
  141. }
  142. return style
  143. }
  144. },
  145. {
  146. label:'单据日期',
  147. value:this.mainData.createdate
  148. },
  149. {
  150. label:'合计数量',
  151. value:this.mainData.qty,
  152. style:function () {
  153. let style = {color:"#ff0000"}
  154. return style
  155. }
  156. },
  157. {
  158. label:'合计金额',
  159. value:this.mainData.amount,
  160. style:function () {
  161. let style = {color:"#ff0000"}
  162. return style
  163. }
  164. },
  165. {
  166. label:'折前金额',
  167. value:this.mainData.defaultamount,
  168. style:function () {
  169. let style = {color:"#ff0000"}
  170. return style
  171. }
  172. },
  173. {
  174. label:'企业名称',
  175. value:this.mainData.enterprisename
  176. },
  177. {
  178. label:'备注',
  179. value:this.mainData.remarks
  180. }
  181. ]
  182. },
  183. // 监听切换数据,上一页,下一页
  184. pageChange (id,rowindex,tabIndex) {
  185. this.$router.replace({path:'/orderdetail',query:{id:id,rowindex:rowindex}})
  186. this.queryMainData(id)
  187. },
  188. // 提交审核订单
  189. onSubmit (type) {
  190. this.$confirm(`是否${type}该订单`, '提示', {
  191. confirmButtonText: '确定',
  192. cancelButtonText: '取消',
  193. type: 'warning'
  194. }).then(async () => {
  195. const res = await this.$api.requested({
  196. "id": type === '审核'?20221108153502:20221108153402,
  197. "content": {
  198. "sa_orderid": this.mainData.sa_orderid,
  199. "sys_enterpriseid": this.mainData.sys_enterpriseid,
  200. "sa_accountclassid": this.mainData.accountclass.sa_accountclassid
  201. },
  202. })
  203. this.tool.showMessage(res,async ()=>{
  204. this.queryMainData()
  205. })
  206. }).catch((err) => {
  207. this.$message({
  208. type: 'info',
  209. message: err
  210. });
  211. });
  212. },
  213. // 反审核订单
  214. onReturnCheck () {
  215. this.$confirm(`是否反审核该订单`, '提示', {
  216. confirmButtonText: '确定',
  217. cancelButtonText: '取消',
  218. type: 'warning'
  219. }).then(async () => {
  220. const res = await this.$api.requested({
  221. "id": 20230102141502,
  222. "content": {
  223. "sa_orderid": this.mainData.sa_orderid,
  224. },
  225. })
  226. this.tool.showMessage(res,()=>{
  227. this.queryMainData()
  228. })
  229. }).catch((err) => {
  230. this.$message({
  231. type: 'info',
  232. message: err
  233. });
  234. });
  235. },
  236. async onRebanck () {
  237. const res = await this.$api.requested({
  238. "id": 20221108161902,
  239. "content": {
  240. "sys_enterpriseid":this.mainData.sys_enterpriseid,
  241. "sa_accountclassid":this.mainData.accountclass.sa_accountclassid,
  242. "sa_orderid": this.mainData.sa_orderid,
  243. "backreason": this.backreason //退回原因,可选
  244. },
  245. })
  246. this.tool.showMessage(res,()=>{
  247. this.queryMainData()
  248. this.dialogVisible = false
  249. })
  250. },
  251. async closeOrder () {
  252. const res = await this.$api.requested({
  253. "id": 20221108164502,
  254. "content": {
  255. "sa_orderids":[this.$route.query.id]
  256. },
  257. })
  258. this.tool.showMessage(res,()=>{
  259. this.queryMainData()
  260. this.dialogVisible = false
  261. })
  262. },
  263. async confirmdate () {
  264. const res = await this.$api.requested({
  265. "id": 20221230094802,
  266. "content": {
  267. "sa_orderid": this.$route.query.id
  268. }
  269. })
  270. this.tool.showMessage(res,()=>{
  271. this.queryMainData()
  272. })
  273. },
  274. async onCopy () {
  275. const res = await this.$api.requested({
  276. "id": 20230102144502,
  277. "content": {
  278. "sa_orderid": this.$route.query.id
  279. }
  280. })
  281. this.tool.showMessage(res,()=>{
  282. let route = this.$route
  283. if (route.path !== '/taskDetails') {
  284. this.oldRoute = {path:route.path,query:route.query}
  285. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  286. }
  287. this.$router.replace({path:'/agent_orderDetails',query:{id:res.data.sa_orderid,rowindex:res.data.rowindex}})
  288. this.queryMainData(this.$route.query.id)
  289. })
  290. },
  291. },
  292. mounted () {
  293. this.queryMainData(this.$route.query.id)
  294. },
  295. created() {
  296. }
  297. }
  298. </script>
  299. <style scoped>
  300. </style>