您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

132 行
9.3 KiB

  1. <template>
  2. <a-modal title="调整价格" :visible="showAlt" :confirm-loading="confirmSubmit" @ok="fnSetOrderMoney" @cancel="fnHideAlt" width="700px" :footer='false'>
  3. <a-spin :spinning="confirmSubmit">
  4. <a-form-model :model="form" :rules="rules" v-bind="layout" ref="ruleForm">
  5. <template v-if="sourceType==2">
  6. <a-row v-if="form">
  7. <a-col :span="12"><a-form-model-item label="工程费"><a-input :disabled="!isEdit" type="number" v-model="form.costCostruction" /></a-form-model-item></a-col>
  8. <a-col :span="12"><a-form-model-item label="加急费"><a-input :disabled="!isEdit" type="number" v-model="form.costJiaJi" /></a-form-model-item></a-col>
  9. <a-col :span="12"><a-form-model-item label="工程费"><a-input :disabled="!isEdit" type="number" v-model="form.costCostruction"/></a-form-model-item></a-col>
  10. <a-col :span="12"><a-form-model-item label="加急费"><a-input :disabled="!isEdit" type="number" v-model="form.costJiaJi"/></a-form-model-item></a-col>
  11. <a-col :span="12"><a-form-model-item label="浮动金额"><a-input :disabled="!isEdit" type="number" v-model="form.orderPreferentialMoney"/></a-form-model-item></a-col>
  12. <a-col :span="12"><a-form-model-item label="锣程费"><a-input :disabled="!isEdit" type="number" v-model="form.routLengthMoney"/></a-form-model-item></a-col>
  13. <a-col :span="12"><a-form-model-item label="孔费"><a-input :disabled="!isEdit" type="number" v-model="form.holeMoney"/></a-form-model-item></a-col>
  14. <a-col :span="12"><a-form-model-item label="板费"><a-input :disabled="!isEdit" type="number" v-model="form.costBoard"/></a-form-model-item></a-col>
  15. <a-col :span="12"><a-form-model-item label="测试费"><a-input :disabled="!isEdit" type="number" v-model="form.costTest"/></a-form-model-item></a-col>
  16. <a-col :span="12"><a-form-model-item label="拼版费"><a-input :disabled="!isEdit" type="number" v-model="form.costPinBan"/></a-form-model-item></a-col>
  17. <a-col :span="12"><a-form-model-item label="表面处理费"><a-input :disabled="!isEdit" type="number" v-model="form.costMetallize"/></a-form-model-item></a-col>
  18. <a-col :span="12"><a-form-model-item label="菲林费"><a-input :disabled="!isEdit" type="number" v-model="form.costFilm"/></a-form-model-item></a-col>
  19. <a-col :span="12"><a-form-model-item label="颜料费"><a-input :disabled="!isEdit" type="number" v-model="form.costColor"/></a-form-model-item></a-col>
  20. <a-col :span="12"><a-form-model-item label="成型费"><a-input :disabled="!isEdit" type="number" v-model="form.costShap"/></a-form-model-item></a-col>
  21. <a-col :span="12"><a-form-model-item label="其他费"><a-input :disabled="!isEdit" type="number" v-model="form.costOther"/></a-form-model-item></a-col>
  22. <a-col :span="12"><a-form-model-item label="产品费"><a-input :disabled="!isEdit" type="number" v-model="form.orderTotalMoney"/></a-form-model-item></a-col>
  23. <a-col :span="12"><a-form-model-item label="税费"><a-input :disabled="!isEdit" type="number" v-model="form.orderTaxMoney"/></a-form-model-item></a-col>
  24. <a-col :span="12"><a-form-model-item label="运费"><a-input :disabled="!isEdit" type="number" v-model="form.orderShipMoney"/></a-form-model-item></a-col>
  25. <a-col :span="12"><a-form-model-item label="会员优惠券优惠金额"><a-input :disabled="!isEdit" type="number" v-model="form.memberCouponMoney"/></a-form-model-item></a-col>
  26. </a-row>
  27. </template>
  28. <template v-else-if="sourceType==4">
  29. <a-row v-if="form.orderPriceDetail">
  30. <a-col :span="12"><a-form-model-item label="产品费(含税)"><a-input disabled="disabled" type="number" v-model="form.totalPrice"/></a-form-model-item></a-col>
  31. <a-col :span="12"><a-form-model-item label="单片价格"><a-input disabled="disabled" type="number" v-model="form.singlePrice"/></a-form-model-item></a-col>
  32. <a-col :span="12"><a-form-model-item label="快递费"><a-input disabled="disabled" type="number" v-model="form.shipPrice"/></a-form-model-item></a-col>
  33. <a-col :span="24"><a-form-model-item label="其他费用明细" :label-col="{ span:4, offset: 0 }" :wrapper-col="{ span:20, offset:0 }"><a-input disabled="disabled" v-model="form.costOther"/></a-form-model-item></a-col>
  34. <a-col :span="12"><a-form-model-item label="板费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costBoard"/></a-form-model-item></a-col>
  35. <a-col :span="12"><a-form-model-item label="工程费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costCostruction"/></a-form-model-item></a-col>
  36. <a-col :span="12"><a-form-model-item label="菲林费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costFilm"/></a-form-model-item></a-col>
  37. <a-col :span="12"><a-form-model-item label="表面处理费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costMetallize"/></a-form-model-item></a-col>
  38. <a-col :span="12"><a-form-model-item label="其他费用"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costOther"/></a-form-model-item></a-col>
  39. <a-col :span="12"><a-form-model-item label="测试费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costTest"/></a-form-model-item></a-col>
  40. <a-col :span="12"><a-form-model-item label="孔费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.holeMoney"/></a-form-model-item></a-col>
  41. <a-col :span="12"><a-form-model-item label="拼版费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costPinBan"/></a-form-model-item></a-col>
  42. <a-col :span="12"><a-form-model-item label="加急费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costJiaJi"/></a-form-model-item></a-col>
  43. <a-col :span="12"><a-form-model-item label="颜料费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costColor"/></a-form-model-item></a-col>
  44. <a-col :span="12"><a-form-model-item label="成型费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.costShap"/></a-form-model-item></a-col>
  45. <a-col :span="12"><a-form-model-item label="锣程费"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.routLengthMoney"/></a-form-model-item></a-col>
  46. <a-col :span="12"><a-form-model-item label="浮动价格"><a-input disabled="disabled" type="number" v-model="form.orderPriceDetail.orderPreferentialMoney"/></a-form-model-item></a-col>
  47. <a-col :span="12"><a-form-model-item label="调整金额">
  48. <a-tooltip placement="topLeft" title="在原始调整金额上加减!">
  49. <a-input :disabled="!isEdit" type="number" v-model="form.adjustAmount"/>
  50. </a-tooltip>
  51. </a-form-model-item></a-col>
  52. <a-col :span="24"><a-form-model-item label="调整备注" :label-col="{ span:4, offset: 0 }" :wrapper-col="{ span:20, offset:0 }"><a-input :disabled="!isEdit" v-model="form.adjustRemark"/></a-form-model-item></a-col>
  53. </a-row>
  54. </template>
  55. <div class="bn">
  56. <a-space v-if="!isEdit"><a-button @click="fnHideAlt">关闭</a-button><a-button type="primary" @click="isEdit = true">编辑</a-button></a-space>
  57. <a-space v-else><a-button @click="fnGetOrderMoney">取消</a-button><a-button type="primary" @click="fnSetOrderMoney">提交保存</a-button></a-space>
  58. </div>
  59. </a-form-model>
  60. </a-spin>
  61. </a-modal>
  62. </template>
  63. <script>
  64. import {OrderMoney, OrderUpdateMoney} from "@/services/order/Order";
  65. export default {
  66. name: "orderMoney",
  67. props:['orderId','sourceType','showAlt','fnHiddenAlt'],
  68. data(){
  69. return{
  70. confirmSubmit:true,tabMoneyForm:['2','4'],isEdit:false,
  71. detail:{},
  72. form:{},
  73. rules:{},
  74. layout:{labelCol:{span:8},wrapperCol:{span:16},},
  75. }
  76. },
  77. watch:{
  78. showAlt(){
  79. if (this.showAlt) this.fnGetOrderMoney();
  80. }
  81. },
  82. methods:{
  83. fnGetOrderMoney(){
  84. if (this.tabMoneyForm.indexOf(this.sourceType)<0){
  85. this.$message.warn('暂无匹配的价格模板!');
  86. return false;
  87. }
  88. this.isEdit = false;
  89. this.confirmSubmit = true;
  90. OrderMoney(this.orderId).then(res=>{
  91. // console.log(this.sourceType,this.orderId);
  92. if (res.success){
  93. let db = JSON.parse(res.message);
  94. this.form = db;
  95. // let OST = this.sourceType;
  96. this.confirmSubmit = false;
  97. }else{
  98. this.$message.error(res.message);
  99. }
  100. }).finally(()=>{})
  101. },
  102. fnHideAlt(){
  103. this.fnHiddenAlt();
  104. },
  105. fnSetOrderMoney(){
  106. if(this.confirmSubmit) return false;
  107. let params = {
  108. id:this.orderId,
  109. keys:JSON.stringify(this.form)
  110. }
  111. this.confirmSubmit = true;
  112. OrderUpdateMoney(params).then(res=>{
  113. if (res.success){
  114. this.$message.success(res.message)
  115. }else this.$message.error(res.message);
  116. this.fnGetOrderMoney();
  117. }).finally(()=>{
  118. this.confirmSubmit = false;
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style scoped>
  125. /deep/ .ant-form-item-label>label{display:inline-block; line-height:1.2em}
  126. /deep/ .ant-form-item-label{white-space:pre-wrap}
  127. .ant-form-item{margin-bottom:5px}
  128. .bn{text-align:center; clear:both; padding:20px 0}
  129. </style>