transactionStatus.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div>
  3. <el-button size="mini" block @click="onshow">更改成交状态</el-button>
  4. <el-dialog title="" :visible.sync="dialogForm" width="400px" append-to-body>
  5. <div slot="title" style="font-size: 15px">
  6. 更改成交状态
  7. </div>
  8. <div>
  9. <el-row :gutter="20">
  10. <el-form :model="form" :rules="rules" ref="form" size="mini" label-position="top" label-width="90px">
  11. <el-col :span="24">
  12. <el-form-item prop="tradingstatus" label="成交状态:" >
  13. <el-select v-model="form.tradingstatus" placeholder="请选择成交状态" style="width: 100%">
  14. <el-option
  15. v-for="item in status"
  16. :key="item.value"
  17. :label="item.value"
  18. :value="item.value">
  19. </el-option>
  20. </el-select>
  21. </el-form-item>
  22. </el-col>
  23. </el-form>
  24. </el-row>
  25. </div>
  26. <div class="dialog-footer">
  27. <el-button size="small" @click="dialogForm = false" class="normal-btn-width">取 消</el-button>
  28. <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
  29. </div>
  30. </el-dialog>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. name: "transactionStatus",
  36. props:["id"],
  37. data(){
  38. return {
  39. dialogForm:false,
  40. form:{
  41. tradingstatus:""
  42. },
  43. rules:{
  44. tradingstatus: [
  45. { required: true, message: '未选择成交状态', trigger: 'change' },
  46. ],
  47. },
  48. status:[
  49. {
  50. label:'未成交',
  51. value:'未成交'
  52. },
  53. {
  54. label:'已成交',
  55. value:'已成交'
  56. },
  57. {
  58. label:'多次成交',
  59. value:'多次成交'
  60. }
  61. ]
  62. }
  63. },
  64. methods:{
  65. onshow(){
  66. this.dialogForm = true
  67. this.$emit("onshow")
  68. },
  69. onSubmit(){
  70. this.$refs['form'].validate(async (valid) => {
  71. if (!valid) return false
  72. const res = await this.$api.requested({
  73. "id": 20221012164102,
  74. "content": {
  75. "sa_customersids": [this.id],
  76. "tradingstatus": this.form.tradingstatus//(未成交、已成交、多次成交)
  77. },
  78. })
  79. this.tool.showMessage(res, ()=>{
  80. this.dialogForm = false
  81. this.$emit("shareSuccess")
  82. })
  83. })
  84. }
  85. }
  86. }
  87. </script>
  88. <style scoped>
  89. </style>