orderNumber.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <section>
  3. <div id="setting" >
  4. <div id="Attribute">
  5. <div style="color: red;font-weight: bolder;text-align: center;font-size: 14px;">单号</div>
  6. <table :title="form && form.id ? '编辑' : '新增' " :model="form">
  7. <tr>
  8. <td>名称</td>
  9. <td colspan="3"><input type="text" v-model="form_copy.name"/></td>
  10. </tr>
  11. <tr>
  12. <td>字体</td>
  13. <td>
  14. <select v-model="form_copy.fontFamily" style="width:80px;border: #0342c5 1px solid;">
  15. <option value="黑体">黑体</option>
  16. <option value="楷体">楷体</option>
  17. <option value="微软雅黑">微软雅黑</option>
  18. <option value="宋体">宋体</option>
  19. </select>
  20. </td>
  21. <td>字高</td>
  22. <td><input type="text" v-model="form_copy.fontSize"/></td>
  23. </tr>
  24. <tr>
  25. <td>单号</td>
  26. <td colspan="3"><input type="text" v-model="form_copy.content" /></td>
  27. </tr>
  28. <tr>
  29. <td colspan="4">
  30. <label>着色 <input type="color" v-model="form_copy.color" style="width: 40px;"/></label>
  31. &nbsp;
  32. <button type="primary" @click="fittingPreview">预览</button>
  33. &nbsp;
  34. <button type="primary" @click="fittingSave">提交</button>
  35. </td>
  36. </tr>
  37. </table>
  38. </div>
  39. <div id="fitting">
  40. <div style="margin-top:70px" :style="{fontFamily:form.fontFamily,fontSize:form.fontSize+'px',color:form.color}">{{form.content}}</div>
  41. </div>
  42. </div>
  43. </section>
  44. </template>
  45. <script>
  46. let findAll = function() {
  47. this.$axios.get("/api/accessories/orderNumber/findAll").then(response => {
  48. if (response.data.code == 0) {
  49. this.rows = response.data.list;
  50. }
  51. })
  52. .catch(error => {
  53. console.log(error);
  54. this.message = error;
  55. });
  56. };
  57. let fittingSave = function(){
  58. this.$axios.post('/api/accessories/orderNumber/saveOrUpdate', this.form).then(response => {
  59. if (response.data.code == 0) {
  60. this.findAll()
  61. this.form = {}
  62. }
  63. })
  64. .catch(error => {
  65. console.log(error);
  66. this.message = error;
  67. });
  68. }
  69. let fittingEdit = function(index){
  70. this.form = this.rows[index]
  71. }
  72. let settingShow = function(){
  73. this.form = {}
  74. }
  75. let fittingPreview = function(){
  76. this.form = Object.assign({}, this.form_copy)
  77. }
  78. export default {
  79. data() {
  80. return {
  81. rows: [],
  82. form: {},
  83. form_copy: {}
  84. };
  85. },
  86. mounted: function() {
  87. this.findAll();
  88. },
  89. methods: {
  90. findAll,
  91. fittingSave,
  92. fittingEdit,
  93. settingShow,
  94. fittingPreview
  95. }
  96. };
  97. </script>
  98. <style scoped>
  99. #Attribute {
  100. padding: 30px 55px;
  101. }
  102. </style>