inputDIalog.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class='input-dialog'>
  3. <div
  4. @click='show'
  5. style='color: #1F2429;cursor: pointer;position:absolute;z-index:9999;'
  6. :style='`right:${type === 1 ? "48px" : "12px"};top:${type === 1 ? "102px" : "0px"};`'
  7. >
  8. <img src='@/assets/imgs/select.png' />
  9. <span>筛选</span>
  10. </div>
  11. <div
  12. v-if='dialogFormVisible'
  13. style='width:280px;height:250px;background:rgba(255,255,255,1);margin-top:40px;
  14. box-shadow:0px 2px 10px 0px rgba(31,35,41,0.1);border:1px solid rgba(228,229,231,1);z-index:9999;
  15. position:absolute;'
  16. :style='`right:${type === 1 ? "40px" : "0"};`'
  17. >
  18. <el-form style=' padding:20px 24px;' v-if='type==1'>
  19. <p style='margin:0 0 8px 0'>生产厂商</p>
  20. <el-input
  21. placeholder='搜索生产厂商'
  22. style='width:232px;margin-right:12px'
  23. size='small'
  24. clearable
  25. prefix-icon='el-icon-search'
  26. v-model='inputForm.manufacturer'
  27. ></el-input>
  28. <p style='margin:16px 0 8px 0'>服务商</p>
  29. <el-input
  30. placeholder='搜索服务商'
  31. clearable
  32. style='width:232px;margin-right:12px'
  33. size='small'
  34. prefix-icon='el-icon-search'
  35. v-model='inputForm.fws'
  36. ></el-input>
  37. </el-form>
  38. <el-form style=' padding: 20px 24px;' v-if='type==2'>
  39. <p style='margin:0 0 8px 0'>任务编号</p>
  40. <el-input placeholder='搜索任务编号' clearable size='small' prefix-icon='el-icon-search' v-model='inputForm.gzglid' style='width:232px;'></el-input>
  41. </el-form>
  42. <el-form style=' padding: 20px 24px;' v-if='type==3'>
  43. <p style='margin:0 0 8px 0'>工单编号</p>
  44. <el-input placeholder='搜索工单编号' clearable size='small' prefix-icon='el-icon-search' v-model='inputForm.wonum' style='width:232px;'></el-input>
  45. </el-form>
  46. <el-form style=' padding: 20px 24px;' v-if='type==4'>
  47. <p style='margin:0 0 8px 0'>验收结果</p>
  48. <el-select v-model='inputForm.status' placeholder='请选择' size='small' style='width:232px'>
  49. <el-option v-for='item in statusOption' :key='item.id' :label='item.name' :value='item.id'></el-option>
  50. </el-select>
  51. <p style='margin:16px 0 8px 0'>验收日期</p>
  52. <el-date-picker
  53. style='width:232px'
  54. v-model='inputForm.yssjwcsj'
  55. value-format='yyyyMMdd'
  56. type='daterange'
  57. size='small'
  58. range-separator='-'
  59. start-placeholder
  60. end-placeholder
  61. ></el-date-picker>
  62. </el-form>
  63. <div style='position:absolute;bottom:24px;right:24px;z-index:9999'>
  64. <el-button @click='dialogFormVisible = false' size='small'>取 消</el-button>
  65. <el-button type='primary' @click='confirm' size='small'>确 定</el-button>
  66. </div>
  67. </div>
  68. </div>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. dialogFormVisible: false,
  75. form: {},
  76. formLabelWidth: '232px',
  77. inputForm: {
  78. fws: '',
  79. manufacturer: '',
  80. gzglid: '',
  81. wonum: '',
  82. ssfasm: '',
  83. status: '',
  84. yssjwcsj: ''
  85. }
  86. }
  87. },
  88. props: ['type', 'statusOption'],
  89. methods: {
  90. show() {
  91. this.dialogFormVisible = !this.dialogFormVisible
  92. },
  93. confirm() {
  94. if (this.type == 1) {
  95. this.$emit('confirm', this.inputForm.fws, this.inputForm.manufacturer)
  96. } else if (this.type == 2) {
  97. this.$emit('confirm', this.inputForm.gzglid)
  98. } else if (this.type == 3) {
  99. this.$emit('confirm', this.inputForm.wonum)
  100. } else if (this.type == 4) {
  101. this.$emit('confirm', this.inputForm.status, this.inputForm.yssjwcsj)
  102. }
  103. this.dialogFormVisible = false
  104. this.inputForm.status = ''
  105. this.inputForm.yssjwcsj = ''
  106. }
  107. },
  108. mounted() {}
  109. }
  110. </script>
  111. <style lang="less" scoped>
  112. .input-diadlog {
  113. position: relative;
  114. }
  115. </style>