remarks.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible">
  3. <div v-if="remarkList.length>0">
  4. <div v-for="item in remarkList" :key="item.id + 'remarks'" class="info">
  5. <div class="clearfix">
  6. <span class="title">{{ item.sysUserName + '【' + item.no + '】' }}</span>
  7. <time class="time">{{ new Date(item.createDate) | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</time>
  8. </div>
  9. <p class="content">{{ item.remarks }}</p>
  10. </div>
  11. </div>
  12. <div v-else class="info">
  13. <p class="title">暂无信息,有需要请备注!</p>
  14. </div>
  15. <!--<el-form label-position="left" label-width="100px">
  16. <el-form-item label="备注" prop="remark">
  17. <el-input v-model="remark" type="textarea" />
  18. </el-form-item>
  19. </el-form>-->
  20. <div slot="footer" class="dialog-footer">
  21. <el-button @click="dialogFormVisible = false">关闭</el-button>
  22. <!--<el-button type="primary" @click="submitRemark">确认</el-button>-->
  23. </div>
  24. </el-dialog>
  25. </template>
  26. <script>
  27. import { saveRemarks } from '@/api/order'
  28. export default {
  29. props: {
  30. dialogTitle: {
  31. type: String,
  32. default: '备注'
  33. },
  34. isVisible: {
  35. type: Boolean,
  36. default: false
  37. },
  38. orderId: {
  39. type: Number,
  40. default: 0
  41. },
  42. remarkList: {
  43. type: Array,
  44. default() {
  45. return []
  46. }
  47. }
  48. },
  49. data: function() {
  50. return {
  51. listLoading: true,
  52. remark: ''
  53. }
  54. },
  55. computed: {
  56. dialogFormVisible: {
  57. get() {
  58. return this.isVisible
  59. },
  60. set(val) {
  61. this.$emit('update:isVisible', val)
  62. }
  63. }
  64. },
  65. created() {
  66. },
  67. methods: {
  68. submitRemark() {
  69. if (this.remark) {
  70. saveRemarks({ remarks: this.remark, orderID: this.orderId }).then(response => {
  71. this.$notify({
  72. title: response.code * 1 === 1 ? 'Success' : 'Error',
  73. message: response.msg,
  74. type: response.code * 1 === 1 ? 'success' : 'error',
  75. duration: 2000
  76. })
  77. this.dialogFormVisible = false
  78. })
  79. } else {
  80. this.dialogFormVisible = false
  81. }
  82. }
  83. }
  84. }
  85. </script>
  86. <style scoped>
  87. .clearfix:before,
  88. .clearfix:after {
  89. display: table;
  90. content: "";
  91. }
  92. .clearfix:after {
  93. clear: both
  94. }
  95. .info{
  96. margin-bottom: 20px;
  97. border-bottom: 1px dashed #DCDFE6;
  98. }
  99. .time {
  100. font-size: 13px;
  101. color: #999;
  102. float: right;
  103. }
  104. .title {
  105. line-height: 12px;
  106. color: blue;
  107. }
  108. .content{
  109. margin-top: 13px;
  110. }
  111. </style>