index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="`${mainData.sonum}`"
  6. :editData="mainData"
  7. :mainAreaData="mainAreaData"
  8. turnPageId="20221111145202"
  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();$refs.prod && $refs.prod.listData()" />
  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="slot1">
  24. <default-info :mainData="mainData"></default-info>
  25. </div>
  26. <div slot="slot0">
  27. <product-list :data="mainData" @onSuccess="queryMainData($route.query.id)" ref="prod">
  28. <div slot="operation">
  29. <!-- <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" :errorUrl="errorUrl" @onSuccess="bindImportOrder"></importFile> -->
  30. </div>
  31. </product-list>
  32. </div>
  33. <div slot="slot2">
  34. <orderprogress ref="prod"></orderprogress>
  35. </div>
  36. <div slot="slot3">
  37. <rebat></rebat>
  38. </div>
  39. <div slot="slot4">
  40. <dispatch></dispatch>
  41. </div>
  42. <div slot="slot5">
  43. <logistics></logistics>
  44. </div>
  45. <div slot="slot6">
  46. <invoiceTable></invoiceTable>
  47. </div>
  48. <div slot="slot7">
  49. <revenue :data="mainData"></revenue>
  50. </div>
  51. </basicDetails>
  52. <el-dialog append-to-body title="退回原因" :visible.sync="dialogVisible" width="400px">
  53. <el-input v-model="backreason" type="textarea" placeholder="请输入退回原因"></el-input>
  54. <span slot="footer" class="dialog-footer">
  55. <el-button @click="dialogVisible = false" size="small">取 消</el-button>
  56. <el-button type="primary" @click="onRebanck" size="small">确 定</el-button>
  57. </span>
  58. </el-dialog>
  59. </div>
  60. </template>
  61. <script>
  62. import Edit from '../modules/edit'
  63. import defaultInfo from './tabs/defaultInfo.vue'
  64. import productList from '../modules/productlist.vue'
  65. import rebat from './tabs/rebatesettlement.vue'
  66. import orderprogress from './tabs/orderpProgress.vue'
  67. import logistics from './tabs/logistics.vue'
  68. import dispatch from './tabs/dispatch.vue'
  69. import invoiceTable from './tabs/invoiceTable.vue'
  70. import revenue from './tabs/revenueAndExp.vue'
  71. import importFile from '../modules/importFile.vue'
  72. export default {
  73. name: "detail",
  74. data() {
  75. return {
  76. mainData:{},
  77. mainAreaData:{},
  78. backreason:'',
  79. dialogVisible:false,
  80. errorUrl:null
  81. }
  82. },
  83. provide () {
  84. return {
  85. thisDetail:() => this
  86. }
  87. },
  88. components:{
  89. Edit,
  90. defaultInfo,
  91. productList,
  92. rebat,
  93. orderprogress,
  94. dispatch,
  95. logistics,
  96. invoiceTable,
  97. revenue,
  98. importFile
  99. },
  100. methods:{
  101. async queryMainData(id) {
  102. return new Promise(async (re,rj) => {
  103. const res = await this.$api.requested({
  104. "id":'20221108151302',
  105. "content": {
  106. "nocache":true,
  107. "sa_orderid": this.$route.query.id
  108. }
  109. })
  110. this.mainData = res.data
  111. this.changeDataStructure()
  112. re()
  113. })
  114. },
  115. changeDataStructure() {
  116. let that = this
  117. this.mainAreaData = [
  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:"#e09a1a"}
  132. break;
  133. case '交期确认':
  134. style = {color:"#3874f6"}
  135. break;
  136. case '审核':
  137. style = {color:"#52C41A"}
  138. break;
  139. case '关闭':
  140. style = {color:"#b2c0ea"}
  141. break;
  142. default:
  143. break;
  144. }
  145. return style
  146. }
  147. },
  148. {
  149. label:'订单类型',
  150. value:this.mainData.type
  151. },
  152. {
  153. label:'明细分类',
  154. value:this.mainData.typemx
  155. },
  156. {
  157. label:'单据日期',
  158. value:this.mainData.createdate
  159. },
  160. {
  161. label:'企业名称',
  162. value:this.mainData.enterprisename
  163. },
  164. {
  165. label:'订单总金额',
  166. value:this.mainData.defaultamount,
  167. style:function () {
  168. let style = {color:"#ff0000"}
  169. return style
  170. }
  171. },
  172. {
  173. label:'折后总金额',
  174. value:this.tool.formatAmount(this.mainData.amount,2),
  175. style:function () {
  176. let style = {color:"#ff0000"}
  177. return style
  178. }
  179. },
  180. {
  181. label:'合计数量',
  182. value:this.mainData.qty,
  183. style:function () {
  184. let style = {color:"#ff0000"}
  185. return style
  186. }
  187. },
  188. /* {
  189. label:'合计数量',
  190. value:this.mainData.qty,
  191. style:function () {
  192. let style = {color:"#ff0000"}
  193. return style
  194. }
  195. },
  196. {
  197. label:'合计金额',
  198. value:this.mainData.amount,
  199. style:function () {
  200. let style = {color:"#ff0000"}
  201. return style
  202. }
  203. },
  204. {
  205. label:'折前金额',
  206. value:this.mainData.defaultamount,
  207. style:function () {
  208. let style = {color:"#ff0000"}
  209. return style
  210. }
  211. },*/
  212. /*{
  213. label:'企业名称',
  214. value:this.mainData.enterprisename
  215. },*/
  216. // {
  217. // label:'收货地址',
  218. // value:`${this.mainData.province}-${this.mainData.city}-${this.mainData.county}-${this.mainData.address}`
  219. // },
  220. {
  221. label:'品牌',
  222. value:this.mainData.brandname
  223. },
  224. {
  225. label:'领域',
  226. value:this.mainData.tradefield
  227. },
  228. {
  229. label:'领域明细',
  230. value:this.mainData.tradefieldmx
  231. },
  232. {
  233. label:'评审类型',
  234. value:this.mainData.optiontyperemarks?this.mainData.reviewtype + '-' + this.mainData.optiontyperemarks : this.mainData.reviewtype
  235. },
  236. {
  237. label:'业务员',
  238. value:this.mainData.saler_name
  239. },
  240. {
  241. label:'项目信息',
  242. value:this.mainData.contract_title
  243. },
  244. {
  245. label:'销售分类',
  246. value:this.mainData.saletype
  247. },
  248. {
  249. label:'运费状态',
  250. value:this.mainData.freightstatus
  251. },
  252. {
  253. label:'备注',
  254. value:this.mainData.remarks
  255. },
  256. {
  257. label:'退回原因',
  258. value:this.mainData.backreason
  259. },
  260. {
  261. label:'核销状态',
  262. value:this.mainData.writeoffstatus
  263. },
  264. {
  265. label:'开票状态',
  266. value:this.mainData.invoicestatus
  267. },
  268. {
  269. label:'项目备注',
  270. value:this.mainData.projectnote
  271. }
  272. ]
  273. },
  274. // 监听切换数据,上一页,下一页
  275. pageChange (id,rowindex,tabIndex) {
  276. this.$router.replace({path:'/orderdetail',query:{id:id,rowindex:rowindex}})
  277. this.queryMainData(id)
  278. },
  279. // 提交审核订单
  280. onSubmit (type) {
  281. this.$confirm(`是否${type}该订单`, '提示', {
  282. confirmButtonText: '确定',
  283. cancelButtonText: '取消',
  284. type: 'warning'
  285. }).then(async () => {
  286. const res = await this.$api.requested({
  287. "id": type === '审核'?20221108153502:20221108153402,
  288. "content": {
  289. "sa_orderid": this.mainData.sa_orderid,
  290. "sys_enterpriseid": this.mainData.sys_enterpriseid,
  291. "sa_accountclassid": this.mainData.accountclass.sa_accountclassid
  292. },
  293. })
  294. this.tool.showMessage(res,async ()=>{
  295. this.queryMainData()
  296. })
  297. }).catch((err) => {
  298. this.$message({
  299. type: 'info',
  300. message: err
  301. });
  302. });
  303. },
  304. // 反审核订单
  305. onReturnCheck () {
  306. this.$confirm(`是否反审核该订单`, '提示', {
  307. confirmButtonText: '确定',
  308. cancelButtonText: '取消',
  309. type: 'warning'
  310. }).then(async () => {
  311. const res = await this.$api.requested({
  312. "id": 20230102141502,
  313. "content": {
  314. "sa_orderid": this.mainData.sa_orderid,
  315. },
  316. })
  317. this.tool.showMessage(res,()=>{
  318. this.queryMainData()
  319. })
  320. }).catch((err) => {
  321. this.$message({
  322. type: 'info',
  323. message: err
  324. });
  325. });
  326. },
  327. async onRebanck () {
  328. const res = await this.$api.requested({
  329. "id": 20221108161902,
  330. "content": {
  331. "sys_enterpriseid":this.mainData.sys_enterpriseid,
  332. "sa_accountclassid":this.mainData.accountclass.sa_accountclassid,
  333. "sa_orderid": this.mainData.sa_orderid,
  334. "backreason": this.backreason //退回原因,可选
  335. },
  336. })
  337. this.tool.showMessage(res,()=>{
  338. this.queryMainData()
  339. this.dialogVisible = false
  340. })
  341. },
  342. async closeOrder () {
  343. const res = await this.$api.requested({
  344. "id": 20221108164502,
  345. "content": {
  346. "sa_orderids":[this.$route.query.id]
  347. },
  348. })
  349. this.tool.showMessage(res,()=>{
  350. this.queryMainData()
  351. this.dialogVisible = false
  352. })
  353. },
  354. async confirmdate () {
  355. const res = await this.$api.requested({
  356. "id": 20221230094802,
  357. "content": {
  358. "sa_orderid": this.$route.query.id
  359. }
  360. })
  361. this.tool.showMessage(res,()=>{
  362. this.queryMainData()
  363. })
  364. },
  365. async onCopy () {
  366. const res = await this.$api.requested({
  367. "id": 20230102144502,
  368. "content": {
  369. "sa_orderid": this.$route.query.id
  370. }
  371. })
  372. this.tool.showMessage(res,()=>{
  373. this.tool.showMessage(res)
  374. })
  375. },
  376. async bindImportOrder (id) {
  377. const res = await this.$api.requested({
  378. "id": 20230227194803,
  379. "content": {
  380. "sa_orderid":this.$route.query.id,
  381. "attachmentid":id
  382. }
  383. })
  384. this.$refs['prod'].listData()
  385. if (res.data !== '成功') {
  386. this.errorUrl = res.data
  387. }
  388. }
  389. },
  390. mounted () {
  391. this.queryMainData(this.$route.query.id)
  392. },
  393. created() {
  394. }
  395. }
  396. </script>
  397. <style scoped>
  398. </style>