sale_details.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template name="task">
  2. <view class="content">
  3. <u-form :model="form" ref="uForm">
  4. <u-form-item label-width='260' label="合同编号">
  5. <view @click="show = true">{{list.contractNo?list.contractNo:'请选择合同编号'}}</view>
  6. <u-select v-model="show" mode="single-column" :list="contractNoList" @confirm="confirm"></u-select>
  7. </u-form-item>
  8. <u-form-item label-width='260' label="采购计划">
  9. {{list.salePlan}}
  10. </u-form-item>
  11. <u-form-item label-width='260' label="客户">
  12. {{list.buyer}}
  13. </u-form-item>
  14. <u-form-item v-if='list.salePlanType=="现货"' label-width='260' label="单价(元/吨)">
  15. <u-input v-model="list.unitPrice" />
  16. </u-form-item>
  17. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="基差(元/吨)">
  18. {{list.basis}}
  19. </u-form-item>
  20. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="冻结定金(元)">
  21. {{list.freezingDeposit}}
  22. </u-form-item>
  23. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="拖欠定金(元)">
  24. {{list.defaultDeposit}}
  25. </u-form-item>
  26. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="卸车费(元/吨)">
  27. {{list.unloadingCharge}}
  28. </u-form-item>
  29. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="发票费(元/吨)">
  30. {{list.invoiceFee}}
  31. </u-form-item>
  32. <u-form-item label-width='260' label="合同重量(吨)">
  33. {{list.transactionsNumber}}
  34. </u-form-item>
  35. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="已出库量(吨)">
  36. {{list.stockOutQuantity}}
  37. </u-form-item>
  38. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="可平仓量(吨)">
  39. {{list.openPosition}}
  40. </u-form-item>
  41. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="已平仓量(吨)">
  42. {{list.closedPosition}}
  43. </u-form-item>
  44. <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="已成交量(吨)">
  45. {{list.cumulativeTurnover}}
  46. </u-form-item>
  47. <u-form-item label-width='260' label="发票类型">
  48. {{list.type}}
  49. </u-form-item>
  50. <u-form-item label-width='260' label="包装方式">
  51. {{list.packingType}}
  52. </u-form-item>
  53. <u-form-item label-width='260' label="状态">
  54. {{list.status}}
  55. </u-form-item>
  56. <u-form-item label-width='260' label="更新时间">
  57. {{list.updateDate}}
  58. </u-form-item>
  59. </u-form>
  60. <view style='padding:10px;' class='flex'><u-button v-if='list.status=="待审核"' @click='audit' type="success">审核</u-button></view>
  61. </view>
  62. </template>
  63. <script>
  64. import {
  65. mapState
  66. } from 'vuex';
  67. export default {
  68. name: "task",
  69. data() {
  70. return {
  71. show:false,
  72. id:0,
  73. form: {
  74. name: '',
  75. intro: '',
  76. sex: ''
  77. },
  78. list:{},
  79. radio: '',
  80. pcUserInfo:uni.getStorageSync('pcUserInfo'),
  81. switchVal: false,
  82. contractNoList:[]
  83. };
  84. },
  85. computed: {
  86. ...mapState(['hasLogin', 'userInfo'])
  87. },
  88. onLoad(options){
  89. console.log(options)
  90. this.id=options.id
  91. },
  92. onShow() {
  93. var that=this
  94. this.$nextTick(function(){
  95. that.getData()
  96. })
  97. // this.userInfo = uni.getStorageSync("userInfo")
  98. },
  99. methods: {
  100. getData(){
  101. var data=[]
  102. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList',
  103. {compId:this.pcUserInfo.compId,flag:3}).then(res => {
  104. if(res.data.code==200){
  105. for(var i=0;i<res.data.data.length;i++){
  106. data.push({value:res.data.data[i].contractNo,label:res.data.data[i].contractNo})
  107. }
  108. this.contractNoList=data
  109. }
  110. })
  111. this.$api.doRequest('get', '/saleOrder/getInfo', {id:this.id}).then(res => {
  112. if(res.data.code==200){
  113. this.list=res.data.data
  114. }
  115. })
  116. },
  117. confirm(item){
  118. this.list.contractNo=item[0].value
  119. },
  120. audit(){
  121. if (this.list.salePlanType == '期货') {
  122. this.list.freezingDeposit = this.list.transactionsNumber*this.list.customerInfo.depositRatio
  123. }
  124. var that=this
  125. uni.showModal({
  126. content: "审核通过后,将通知客户订单生效,是否确定通过审核?",
  127. showCancel: true,
  128. confirmText: '提交',
  129. success: function(res) {
  130. if (res.confirm) {
  131. that.$api.doRequest('post', '/saleOrder/api/editSaleOrder', that.list).then(res => {
  132. if (res.data.code == 200) {
  133. that.$api.doRequest('post', '/newWorkflow/api/handle', {
  134. taskId:that.list.taskId,
  135. approved: true,
  136. auditMind: '34',
  137. needReapply: false,
  138. }).then(res1 => {
  139. if (res1.data.code == 200) {
  140. that.$api.msg('审核成功');
  141. that.$nextTick(function(){
  142. uni.navigateBack(-1)
  143. })
  144. }else{
  145. that.$api.msg('系统异常,请联系管理员');
  146. }
  147. })
  148. }else{
  149. that.$api.msg('系统异常,请联系管理员');
  150. }
  151. })
  152. }
  153. }
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. page{
  161. background: #fff;
  162. }
  163. .content{
  164. padding:30px;
  165. }
  166. </style>