index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="`${mainData.sonum}`"
  6. :editData="mainData"
  7. :mainAreaData="mainAreaData"
  8. turnPageId="20230105143002"
  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="['订单明细','基本信息','订单进度','居间费明细','发货单','物流单','发票记录','收支明细','核销记录','erp对接记录','变更记录']"
  15. @onTabClick="onTabClick"
  16. @pageChange="pageChange"
  17. @onEditSuccess="queryMainData($route.query.id)">
  18. <div slot="customOperation" v-if="Object.keys(mainData).length > 0">
  19. <!-- <Edit class="inline-16" v-if="tool.checkAuth($route.name,'update') && (mainData.status == '新建')" :data="mainData" @onSuccess="queryMainData();$refs.prod && $refs.prod.listData()" /> -->
  20. <Edit style="display: inline-block !important;" v-if="mainData.status === '新建'" :data="mainData" @onSuccess="queryMainData();$refs.prod && $refs.prod.listData()" />
  21. <!-- <Edit class="inline-16" v-if="mainData.status !== '新建' && mainData.status !== '关闭'" :data="mainData" @onSuccess="queryMainData();$refs.prod && $refs.prod.listData()" />-->
  22. <EditRemark style="margin-right: 20px !important;" :data="mainData" @onSuccess="queryMainData"></EditRemark>
  23. <changeSaler class="inline-16" style="margin-left: -10px" ref="saler" @selectRow="salerChange">
  24. <el-button v-if="tool.checkAuth($route.name,'changeSaler')" type="primary" slot="input" size="mini" @click="$refs.saler.visible=true;$refs.saler.listData()">{{$t(`变更业务员`)}}</el-button>
  25. </changeSaler>
  26. <el-button v-if="tool.checkAuth($route.name,'confirmDate') && mainData.status === '交期待确认'" class="inline-16" type="primary" size="mini" @click="confirmdate">{{$t(`确认交期`)}}</el-button>
  27. <el-button v-if="tool.checkAuth($route.name,'backconfirmDate') && mainData.status === '交期待确认' || mainData.status === '交期确认'" class="inline-16" type="primary" size="mini" @click="backconfirmdate">{{$t(`交期退回`)}}</el-button>
  28. <confirmDate v-if="tool.checkAuth($route.name,'replyDate')" class="inline-16" :data="mainData" @onSuccess="queryMainData();$refs.prod.listData()"></confirmDate>
  29. <el-popover
  30. placement="top"
  31. trigger="click">
  32. <p class="mt-10 normal-title">{{$t(`选择评审类型`)}}</p>
  33. <el-select class="mt-10" v-model="value" :placeholder="$t('请选择')" size="mini">
  34. <el-option
  35. v-for="item in options"
  36. :key="item.value "
  37. :label="$t(item.value) + '-' + $t(item.remarks)"
  38. :value="item.value">
  39. <span style="float: left">{{ $t(item.value) }}</span>
  40. <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?$t(item.remarks):$t('暂无描述') }}</span>
  41. </el-option>
  42. </el-select>
  43. <div style="text-align: right; margin: 0">
  44. <el-button type="primary" size="mini" @click="onSubmit('审核')">{{$t(`确定`)}}</el-button>
  45. </div>
  46. <el-button :disabled="mainData.status !== '提交' && mainData.status !== '交期确认'" class="inline-16" @click="visible=true" v-if="tool.checkAuth($route.name,'examine')" type="primary" size="mini" slot="reference">{{$t(`审 核`)}}</el-button>
  47. </el-popover>
  48. <el-button v-if="tool.checkAuth($route.name,'examine') && mainData.status === '审核'" type="primary" size="mini" @click="onReturnCheck">{{$t(`反审核`)}}</el-button>
  49. <el-button v-if="tool.checkAuth($route.name,'reback') && mainData.status === '提交'" type="primary" size="mini" @click="dialogVisible = true">{{$t('退 回')}}</el-button>
  50. <el-button v-if="tool.checkAuth($route.name,'submit') && mainData.status === '新建' " :disabled="mainData.qty === 0" type="primary" size="mini" @click="onSubmit('提交')">{{$t(`提 交`)}}</el-button>
  51. <el-button v-if="tool.checkAuth($route.name,'finishOrder') && mainData.status === '审核'" type="primary" size="mini" @click="closeOrder">{{$t(`结 案`)}}</el-button>
  52. <el-button v-if="tool.checkAuth($route.name,'insert')" class="inline-16" type="primary" size="mini" @click="onCopy">{{$t(`复 制`)}}</el-button>
  53. </div>
  54. <template #headerBottom>
  55. <div style="display:flex" v-if="Object.keys(mainData).length > 0">
  56. <div class="account_info">
  57. <div>
  58. <p class="normal-title" style="margin-bottom:10px">{{$t(`支付信息`)}}</p>
  59. </div>
  60. <div class="reveive__panel inline-16">
  61. <p class="flex-align-center"><small>{{$t(`结算企业`)}}:</small>&nbsp;<b>{{mainData.finance.enterprisename}}</b></p>
  62. <div class="flex-align-center">
  63. <p class="inline-16"><small>{{$t(`账户名称`)}}:&nbsp;</small>{{mainData.accountclass.accountname?$t(mainData.accountclass.accountname):$t('未选择账户')}}</p>
  64. <p class="inline-16"><small>{{$t(`账户余额`)}}:&nbsp;</small><b>¥{{tool.formatAmount(mainData.accountclass.balance?mainData.accountclass.balance:0,2)}}</b></p>
  65. <p><small>{{$t(`信用额度`)}}:&nbsp;</small>{{mainData.accountclass.creditquota ? tool.formatAmount(mainData.accountclass.creditquota,2) : tool.formatAmount(mainData.accountclass.creditquota)}}</p>&nbsp;
  66. <p><small>{{$t(`本单金额`)}}:&nbsp;</small>{{mainData.rebate_used ? tool.formatAmount(mainData.defaultamount - rebateamount,2) : tool.formatAmount(mainData.defaultamount)}}</p>
  67. </div>
  68. <div v-if="(mainData.type === '标准订单' || mainData.type === '特殊订单') && isusedrebate === 1">
  69. <div v-if="checked" class="flex-align-center">
  70. <p class="inline-16"><small>{{$t(`返利金余额`)}}:&nbsp;</small><b>{{tool.formatAmount(mainData.rebatebalance,2)}}</b></p>
  71. <p class="inline-16"><small>{{$t(`已使用返利金金额`)}}:&nbsp;</small><b>{{tool.formatAmount(mainData.rebateamount,2)}}</b></p>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="address_info">
  77. <div>
  78. <p class="normal-title" style="margin-bottom:10px">{{$t(`收货信息`)}}</p>
  79. </div>
  80. <div class="reveive__panel inline-16">
  81. <div>
  82. <p class="inline-16"><b>{{mainData.contactsEnterprise.enterprisename}}</b></p>
  83. <p class="inline-16"><span class="inline-16"><b>{{mainData.contacts.name}}</b></span><small>{{mainData.contacts.phonenumber}}</small></p>
  84. </div>
  85. <small>{{mainData.contacts.province?mainData.contacts.province:'--'}}{{mainData.contacts.city}}{{mainData.contacts.county}}{{mainData.contacts.address?mainData.contacts.address:''}}</small>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <div slot="slot1">
  91. <default-info :mainData="mainData"></default-info>
  92. </div>
  93. <div slot="slot0">
  94. <product-list @select="select" @onSuccess="queryMainData()" :data="mainData" ref="prod">
  95. <div slot="operation">
  96. <importFile v-if="mainData.status == '新建'" ref="importFile" class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" :ordertype="mainData.type" :errorUrl="errorUrl" @clearUrl="errorUrl = null" @onSuccess="bindImportOrder"></importFile>
  97. <changeOrderMx v-if="mainData.status === '审核'" :tableData="selection" class="inline-16" :data="mainData" @onSuccess="$refs['prod'].listData();queryMainData"></changeOrderMx>
  98. <el-button :disabled="mainData.status !== '审核' || selection.length === 0" size="small" type="primary" style="margin-bottom:12px" @click="adddispatch">{{$t(`一键发货`)}}</el-button>
  99. </div>
  100. </product-list>
  101. </div>
  102. <div slot="slot2">
  103. <orderprogress></orderprogress>
  104. </div>
  105. <div slot="slot3">
  106. <rebat></rebat>
  107. </div>
  108. <div slot="slot4">
  109. <dispatch></dispatch>
  110. </div>
  111. <div slot="slot5">
  112. <logistics></logistics>
  113. </div>
  114. <div slot="slot6">
  115. <invoiceTable></invoiceTable>
  116. </div>
  117. <div slot="slot7">
  118. <revenue :data="mainData"></revenue>
  119. </div>
  120. <div slot="slot8">
  121. <writeOff :data="mainData"></writeOff>
  122. </div>
  123. <div slot="slot9">
  124. <erpHistory :data="mainData"></erpHistory>
  125. </div>
  126. <div slot="slot10">
  127. <changeHistory :data="mainData"></changeHistory>
  128. </div>
  129. </basicDetails>
  130. <el-dialog append-to-body :title="$t(`退回原因`)" :visible.sync="dialogVisible" width="400px">
  131. <el-input v-model="backreason" type="textarea" :placeholder="$t(`请输入退回原因`)"></el-input>
  132. <span slot="footer" class="dialog-footer">
  133. <el-button @click="dialogVisible = false" size="small">{{$t('取 消')}}</el-button>
  134. <el-button type="primary" @click="onRebanck" size="small">{{$t('确 定')}}</el-button>
  135. </span>
  136. </el-dialog>
  137. <dialogTemplate ref="dialogRef" @daysSuccess="queryMainData" :data="mainData" ></dialogTemplate>
  138. </div>
  139. </template>
  140. <script>
  141. import Edit from '../modules/edit'
  142. import defaultInfo from './tabs/defaultInfo.vue';
  143. import productList from './tabs/productlist.vue'
  144. import confirmDate from '../modules/confirmDate.vue'
  145. import rebat from './tabs/rebatesettlement.vue'
  146. import orderprogress from './tabs/orderpProgress.vue'
  147. import dispatch from './tabs/dispatch.vue'
  148. import logistics from './tabs/logistics.vue'
  149. import invoiceTable from './tabs/invoiceTable.vue'
  150. import changeSaler from '@/template/selectSaler/index'
  151. import revenue from './tabs/revenueAndExp.vue'
  152. import changeOrderMx from './tabs/changeOrderMx.vue'
  153. import writeOff from './tabs/writeoff.vue'
  154. import erpHistory from './tabs/erpHistory.vue'
  155. import changeHistory from './tabs/changeHistory.vue'
  156. import importFile from './importFile.vue'
  157. import EditRemark from '../modules/EditRemark.vue'
  158. import dialogTemplate from "@/template/dialogTemplate/index";
  159. export default {
  160. name: "detail",
  161. data() {
  162. return {
  163. mainData:{},
  164. mainAreaData:{},
  165. backreason:'',
  166. options:[],
  167. dialogVisible:false,
  168. submitVisible:false,
  169. visible:false,
  170. value:'',
  171. selection:[],
  172. errorUrl:null,
  173. rebateamount:'',
  174. isusedrebate:'',
  175. checked:0,
  176. typeNew:'',
  177. fullscreenLoading:false,
  178. siteid:JSON.parse(sessionStorage.getItem('active_account')).siteid,
  179. tabNow:'tab0'
  180. }
  181. },
  182. provide () {
  183. return {
  184. thisDetail:() => this
  185. }
  186. },
  187. components:{
  188. Edit,
  189. defaultInfo,
  190. productList,
  191. confirmDate,
  192. rebat,
  193. orderprogress,
  194. dispatch,
  195. logistics,
  196. invoiceTable,
  197. changeSaler,
  198. revenue,
  199. changeOrderMx,
  200. writeOff,
  201. erpHistory,
  202. changeHistory,
  203. importFile,
  204. EditRemark,
  205. dialogTemplate
  206. },
  207. methods:{
  208. async orderreviewtype () {
  209. const res = await this.$store.dispatch('optiontypeselect','orderreviewtype')
  210. this.options = res.data
  211. this.value = res.data[0].value
  212. },
  213. async queryMainData() {
  214. if (this.typeNew == '提交'){
  215. const res = await this.$api.requested({
  216. "id": 20221108153402,
  217. "content": {
  218. "sa_orderid": this.mainData.sa_orderid,
  219. "sys_enterpriseid": this.mainData.sys_enterpriseid,
  220. "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
  221. "reviewtype":''
  222. },
  223. })
  224. this.tool.showMessage(res,async ()=>{
  225. this.typeNew = ''
  226. this.visible = false
  227. this.queryMainData()
  228. })
  229. }else {
  230. return new Promise(async (re,rj) => {
  231. const res = await this.$api.requested({
  232. "id":'20221108151302',
  233. "content": {
  234. "nocache":true,
  235. "sa_orderid": this.$route.query.id
  236. }
  237. })
  238. this.mainData = res.data
  239. this.checked = this.mainData.rebate_used
  240. if (this.mainData.rebateamount > this.mainData.defaultamount) {
  241. this.rebateamount = this.tool.formatAmount(+this.mainData.defaultamount / 2)
  242. } else {
  243. this.rebateamount = this.mainData.rebateamount
  244. }
  245. console.log(this.mainData);
  246. this.$refs.prod.listData(this.$refs.prod.param.content.pageNumber = 1)
  247. this.queryUsedrebate()
  248. this.changeDataStructure()
  249. this.orderreviewtype()
  250. re()
  251. })
  252. }
  253. },
  254. changeDataStructure() {
  255. let that = this
  256. this.mainAreaData = that.siteid == 'HY'?[
  257. {
  258. label:'订单状态',
  259. value:this.$t(this.mainData.status),
  260. style:function () {
  261. let style = that.tool.getStatusColor(that.mainData.status)
  262. return style
  263. }
  264. },
  265. {
  266. label:'订单类型',
  267. value:this.mainData.type
  268. },
  269. {
  270. label:'明细分类',
  271. value:this.mainData.typemx
  272. },
  273. {
  274. label:'单据日期',
  275. value:this.mainData.billdate
  276. },
  277. {
  278. label:'企业名称',
  279. value:this.mainData.enterprisename
  280. },
  281. {
  282. label:'订单总金额',
  283. value:this.tool.formatAmount(this.mainData.defaultamount,2),
  284. style:function () {
  285. let style = {color:"#ff0000"}
  286. return style
  287. }
  288. },
  289. {
  290. label:'折后总金额',
  291. value:this.tool.formatAmount(this.mainData.amount,2),
  292. style:function () {
  293. let style = {color:"#ff0000"}
  294. return style
  295. }
  296. },
  297. {
  298. label:'合计数量',
  299. value:this.mainData.qty,
  300. style:function () {
  301. let style = {color:"#ff0000"}
  302. return style
  303. }
  304. },
  305. {
  306. label:'品牌',
  307. value:this.mainData.brandname
  308. },
  309. {
  310. label:'领域',
  311. value:this.mainData.tradefield
  312. },
  313. {
  314. label:'领域明细',
  315. value:this.mainData.tradefieldmx
  316. },
  317. {
  318. label:'评审类型',
  319. value:this.mainData.optiontyperemarks?this.mainData.reviewtype + '-' + this.mainData.optiontyperemarks : this.mainData.reviewtype
  320. },
  321. {
  322. label:'业务员',
  323. value:this.mainData.saler_name
  324. },
  325. {
  326. label:'项目信息',
  327. value:this.mainData.projectname
  328. },
  329. {
  330. label:'销售分类',
  331. value:`${this.mainData.saletype}${this.mainData.saletyperemarks?'-':''}${this.mainData.saletyperemarks}`
  332. },
  333. {
  334. label:'运费状态',
  335. value:this.$t(this.mainData.freightstatus)
  336. },
  337. {
  338. label:'备注',
  339. value:this.mainData.remarks
  340. },
  341. /*{
  342. label:'返利金使用比例(%)',
  343. value:this.mainData.rebate_userate
  344. },*/
  345. {
  346. label:'退回原因',
  347. value:this.mainData.backreason
  348. },
  349. {
  350. label:'核销状态',
  351. value:this.mainData.writeoffstatus,
  352. style:function () {
  353. let style = that.tool.getStatusColor(that.mainData.writeoffstatus)
  354. return style
  355. }
  356. },
  357. {
  358. label:'开票状态',
  359. value:this.mainData.invoicestatus,
  360. style:function () {
  361. let style = that.tool.getStatusColor(that.mainData.invoicestatus)
  362. return style
  363. }
  364. },
  365. {
  366. label:'备货状态',
  367. value:this.$t(this.mainData.goodsstatus),
  368. style:function () {
  369. let style = that.tool.getStatusColor(that.mainData.goodsstatus)
  370. return style
  371. }
  372. },
  373. {
  374. label:'erp单号',
  375. value:this.mainData.erpbillno
  376. },
  377. {
  378. label:'回签单',
  379. value:this.mainData.signbackstatus
  380. },
  381. {
  382. label:'项目备注',
  383. value:this.mainData.projectnote
  384. },
  385. {
  386. label:'关联合同',
  387. value:this.mainData.contract_title
  388. }
  389. ]:[
  390. {
  391. label:'订单状态',
  392. value:this.$t(this.mainData.status),
  393. style:function () {
  394. let style = that.tool.getStatusColor(that.mainData.status)
  395. return style
  396. }
  397. },
  398. {
  399. label:'订单类型',
  400. value:this.mainData.type
  401. },
  402. {
  403. label:'明细分类',
  404. value:this.mainData.typemx
  405. },
  406. {
  407. label:'单据日期',
  408. value:this.mainData.billdate
  409. },
  410. {
  411. label:'企业名称',
  412. value:this.mainData.enterprisename
  413. },
  414. {
  415. label:'订单总金额',
  416. value:this.tool.formatAmount(this.mainData.defaultamount,2),
  417. style:function () {
  418. let style = {color:"#ff0000"}
  419. return style
  420. }
  421. },
  422. {
  423. label:'折后总金额',
  424. value:this.tool.formatAmount(this.mainData.amount,2),
  425. style:function () {
  426. let style = {color:"#ff0000"}
  427. return style
  428. }
  429. },
  430. {
  431. label:'合计数量',
  432. value:this.mainData.qty,
  433. style:function () {
  434. let style = {color:"#ff0000"}
  435. return style
  436. }
  437. },
  438. {
  439. label:'品牌',
  440. value:this.mainData.brandname
  441. },
  442. {
  443. label:'领域',
  444. value:this.mainData.tradefield
  445. },
  446. {
  447. label:'领域明细',
  448. value:this.mainData.tradefieldmx
  449. },
  450. {
  451. label:'评审类型',
  452. value:this.mainData.optiontyperemarks?this.mainData.reviewtype + '-' + this.mainData.optiontyperemarks : this.mainData.reviewtype
  453. },
  454. {
  455. label:'业务员',
  456. value:this.mainData.saler_name
  457. },
  458. {
  459. label:'项目信息',
  460. value:this.mainData.projectname
  461. },
  462. {
  463. label:'销售分类',
  464. value:`${this.mainData.saletype}${this.mainData.saletyperemarks?'-':''}${this.mainData.saletyperemarks}`
  465. },
  466. {
  467. label:'运费状态',
  468. value:this.$t(this.mainData.freightstatus)
  469. },
  470. {
  471. label:'备注',
  472. value:this.mainData.remarks
  473. },
  474. /*{
  475. label:'返利金使用比例(%)',
  476. value:this.mainData.rebate_userate
  477. },*/
  478. {
  479. label:'退回原因',
  480. value:this.mainData.backreason
  481. },
  482. {
  483. label:'核销状态',
  484. value:this.mainData.writeoffstatus,
  485. style:function () {
  486. let style = that.tool.getStatusColor(that.mainData.writeoffstatus)
  487. return style
  488. }
  489. },
  490. {
  491. label:'开票状态',
  492. value:this.mainData.invoicestatus,
  493. style:function () {
  494. let style = that.tool.getStatusColor(that.mainData.invoicestatus)
  495. return style
  496. }
  497. },
  498. {
  499. label:'erp单号',
  500. value:this.mainData.erpbillno
  501. },
  502. {
  503. label:'回签单',
  504. value:this.mainData.signbackstatus
  505. },
  506. {
  507. label:'项目备注',
  508. value:this.mainData.projectnote
  509. },
  510. {
  511. label:'关联合同',
  512. value:this.mainData.contract_title
  513. }
  514. ]
  515. },
  516. // 监听切换数据,上一页,下一页
  517. pageChange (id,rowindex,tabIndex) {
  518. /*this.$router.replace({path:'/orderdetail',query:{id:id,rowindex:rowindex}})*/
  519. this.queryMainData(id)
  520. },
  521. // 查询站点是否使用返利金
  522. async queryUsedrebate () {
  523. const res = await this.$api.requested({
  524. "classname": "webmanage.site.site",
  525. "method": "querySite_Parameter",
  526. "content": {
  527. }
  528. })
  529. this.isusedrebate = res.data.order_rebate_used
  530. },
  531. /* 变更业务员 */
  532. salerChange (data) {
  533. console.log(data);
  534. this.$confirm(`${this.$t(`确定把`)} ${data.name} ${this.$t(`设置为业务员吗`)}`,this.$t('提示'),{
  535. confirmButtonText:this.$t('确定'),
  536. cancelButtonText:this.$t('取消')
  537. }).then(async () => {
  538. let res = await this.$api.requested({
  539. "id":20230213154802,
  540. "content": {
  541. saler_hrid:data.hrid,
  542. sa_orderid:this.$route.query.id
  543. }
  544. })
  545. console.log(res);
  546. this.tool.showMessage(res,() => {
  547. this.$refs.saler.visible = false
  548. this.queryMainData()
  549. })
  550. })
  551. },
  552. onTabClick(val){
  553. console.log(val,'tabs当前')
  554. this.tabNow = val
  555. },
  556. // 提交审核订单
  557. onSubmit (type) {
  558. if (type == '提交' && (this.siteid == 'HY' || this.siteid == 'YOSTEST1')){
  559. this.$refs.dialogRef.dialogVisible = true
  560. this.$refs.dialogRef.form.reminddays = this.mainData.contract_reminddays ? this.mainData.contract_reminddays : 7
  561. }else {
  562. this.$confirm(`${this.$t(`是否`)} ${this.$t(type)} ${this.$t(`该订单`)}`, this.$t('提示'), {
  563. confirmButtonText: this.$t('确定'),
  564. cancelButtonText: this.$t('取消'),
  565. type: 'warning'
  566. }).then(async () => {
  567. if (this.tabNow != 'tab0' || this.$refs.prod.time == null){
  568. const res = await this.$api.requested({
  569. "id": type === '审核'?20221108153502:20221108153402,
  570. "content": {
  571. "sa_orderid": this.mainData.sa_orderid,
  572. "sys_enterpriseid": this.mainData.sys_enterpriseid,
  573. "sa_accountclassid": this.mainData.accountclass.sa_accountclassid,
  574. "reviewtype":type === '审核'?this.value:''
  575. },
  576. })
  577. this.tool.showMessage(res,async ()=>{
  578. this.visible = false
  579. this.queryMainData()
  580. })
  581. }else {
  582. this.typeNew = type
  583. }
  584. }).catch((err) => {
  585. this.$message({
  586. type: 'info',
  587. message: this.$t('已取消')
  588. });
  589. });
  590. }
  591. },
  592. // 反审核订单
  593. onReturnCheck () {
  594. this.$confirm(this.$t(`是否反审核该订单`), this.$t('提示'), {
  595. confirmButtonText: this.$t('确定'),
  596. cancelButtonText: this.$t('取消'),
  597. type: 'warning'
  598. }).then(async () => {
  599. const res = await this.$api.requested({
  600. "id": 20230102141502,
  601. "content": {
  602. "sa_orderid": this.mainData.sa_orderid,
  603. },
  604. })
  605. this.tool.showMessage(res,()=>{
  606. this.$store.dispatch('changeDetailDrawer',false)
  607. })
  608. }).catch((err) => {
  609. this.$message({
  610. type: 'info',
  611. message: this.$t('已取消')
  612. });
  613. });
  614. },
  615. async onRebanck () {
  616. const res = await this.$api.requested({
  617. "id": 20221108161902,
  618. "content": {
  619. "sys_enterpriseid":this.mainData.sys_enterpriseid,
  620. "sa_accountclassid":this.mainData.accountclass.sa_accountclassid,
  621. "sa_orderid": this.mainData.sa_orderid,
  622. "backreason": this.backreason //退回原因,可选
  623. },
  624. })
  625. this.tool.showMessage(res,()=>{
  626. // this.queryMainData()
  627. this.dialogVisible = false
  628. this.$store.dispatch('changeDetailDrawer',false)
  629. })
  630. },
  631. async closeOrder () {
  632. const res = await this.$api.requested({
  633. "id": 20221108164502,
  634. "content": {
  635. "sa_orderid":this.$route.query.id
  636. },
  637. })
  638. this.tool.showMessage(res,()=>{
  639. this.queryMainData()
  640. this.dialogVisible = false
  641. })
  642. },
  643. async confirmdate () {
  644. const res = await this.$api.requested({
  645. "id": 20221230094802,
  646. "content": {
  647. "sa_orderid": this.$route.query.id
  648. }
  649. })
  650. this.tool.showMessage(res,()=>{
  651. this.queryMainData()
  652. })
  653. },
  654. async backconfirmdate () {
  655. const res = await this.$api.requested({
  656. "id": 20230227160002,
  657. "content": {
  658. "sa_orderid": this.$route.query.id
  659. }
  660. })
  661. this.tool.showMessage(res,()=>{
  662. this.queryMainData()
  663. })
  664. },
  665. async onCopy () {
  666. const res = await this.$api.requested({
  667. "id": 20230102144502,
  668. "content": {
  669. "sa_orderid": this.$route.query.id
  670. }
  671. })
  672. this.tool.showMessage(res,()=>{
  673. /*this.tool.showMessage(res)*/
  674. /* this.$store.dispatch('changeDetailDrawer',false)
  675. this.$store.dispatch('changeDetailDrawer',true)
  676. this.$router.push({path:'/orderdetail',query:{id:res.data.sa_orderid,rowindex:res.data.rowindex}})*/
  677. this.$store.dispatch('changeDetailDrawer',false)
  678. setTimeout(()=>{
  679. this.$router.replace({
  680. path:'/orderdetail',
  681. query:{
  682. id:res.data.sa_orderid
  683. }
  684. })
  685. this.$store.dispatch('changeDetailDrawer',true)
  686. },500)
  687. })
  688. },
  689. select (data) {
  690. this.selection = data
  691. },
  692. async adddispatch () {
  693. const res = await this.$api.requested({
  694. "id": "20230220100604",
  695. "content": {
  696. "sa_orderid":this.mainData.sa_orderid,
  697. "sa_orderitemsids": this.selection.map(e=>{
  698. return e.sa_orderitemsid
  699. })
  700. }
  701. })
  702. this.tool.showMessage(res,()=>{
  703. let route = this.$route
  704. this.oldRoute = {path:route.path,query:route.query}
  705. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  706. this.$router.replace({path:'/dispatchdetail',query:{id:res.data.sa_dispatchid,rowindex:res.data.rowindex}})
  707. })
  708. },
  709. async bindImportOrder (id) {
  710. const res = await this.$api.requested({
  711. "id": this.$refs.importFile.orderType == 1?20230308155803:20230227194803,
  712. "content": {
  713. "sa_orderid":this.$route.query.id,
  714. "attachmentid":id
  715. }
  716. })
  717. this.$refs['prod'].listData()
  718. if (res.data !== '成功') {
  719. this.errorUrl = res.data
  720. }
  721. this.queryMainData()
  722. }
  723. },
  724. mounted () {
  725. this.queryMainData(this.$route.query.id)
  726. },
  727. created() {
  728. }
  729. }
  730. </script>
  731. <style scoped>
  732. .reveive__panel{
  733. font-size: 16px;
  734. line-height: 30px;
  735. padding: 0 10px;
  736. background: #d9ecff;
  737. border: 1px dashed #0676e7;
  738. }
  739. .account__panel small,.reveive__panel small{
  740. color:#888
  741. }
  742. </style>