Supplierinfo.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div class="supplierinfo-all">
  3. <div class="supplierinfo-screen">
  4. <div class="supplierinfo-screen-ul">
  5. <div class="supplierinfo-screen-li">
  6. <div class="supplierinfoscreen-li-title">供应商类型:&nbsp;</div>
  7. <el-select size="small" v-model="value" filterable placeholder="请选择">
  8. <el-option
  9. v-for="item in options"
  10. :key="item.value"
  11. :label="item.label"
  12. :value="item.value">
  13. </el-option>
  14. </el-select>
  15. </div>
  16. <div class="supplierinfo-screen-li">
  17. <div class="supplierinfoscreen-li-title">供应商名称:&nbsp;</div>
  18. <el-input size="small" v-model="value" placeholder="请输入内容"></el-input>
  19. </div>
  20. <div class="supplierinfo-screen-li">
  21. <div class="supplierinfoscreen-li-title">供应商单位:&nbsp;</div>
  22. <el-input size="small" v-model="value" placeholder="请输入内容"></el-input>
  23. </div>
  24. <div class="supplierinfo-screen-li">
  25. <div class="supplierinfoscreen-li-title">供应商电话:&nbsp;</div>
  26. <el-input size="small" v-model="value" placeholder="请输入内容"></el-input>
  27. </div>
  28. <el-button size="small" type="primary">查询</el-button>
  29. </div>
  30. <el-button size="small" type="primary">新增数据</el-button>
  31. </div>
  32. <div class="supplierinfo-table">
  33. <el-table
  34. :data="tableData"
  35. border
  36. style="width: 100%">
  37. <el-table-column
  38. prop="date"
  39. label="日期"
  40. width="180">
  41. </el-table-column>
  42. <el-table-column
  43. prop="name"
  44. label="姓名"
  45. width="180">
  46. </el-table-column>
  47. <el-table-column
  48. prop="address"
  49. label="地址">
  50. </el-table-column>
  51. </el-table>
  52. <div class="block">
  53. <el-pagination
  54. @size-change="handleSizeChange"
  55. @current-change="handleCurrentChange"
  56. :current-page="currentPage4"
  57. :page-sizes="[100, 200, 300, 400]"
  58. :page-size="100"
  59. layout="total, sizes, prev, pager, next, jumper"
  60. :total="400">
  61. </el-pagination>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. export default {
  68. data () {
  69. return {
  70. options: [{
  71. value: '选项1',
  72. label: '黄金糕'
  73. }, {
  74. value: '选项2',
  75. label: '双皮奶'
  76. }, {
  77. value: '选项3',
  78. label: '蚵仔煎'
  79. }, {
  80. value: '选项4',
  81. label: '龙须面'
  82. }, {
  83. value: '选项5',
  84. label: '北京烤鸭'
  85. }],
  86. value: '',
  87. tableData: [{
  88. date: '2016-05-02',
  89. name: '王小虎',
  90. address: '上海市普陀区金沙江路 1518 弄'
  91. }, {
  92. date: '2016-05-04',
  93. name: '王小虎',
  94. address: '上海市普陀区金沙江路 1517 弄'
  95. }, {
  96. date: '2016-05-01',
  97. name: '王小虎',
  98. address: '上海市普陀区金沙江路 1519 弄'
  99. }, {
  100. date: '2016-05-03',
  101. name: '王小虎',
  102. address: '上海市普陀区金沙江路 1516 弄'
  103. }],
  104. currentPage4: 4
  105. }
  106. },
  107. methods:{
  108. handleSizeChange(val) {
  109. console.log(`每页 ${val} 条`);
  110. },
  111. handleCurrentChange(val) {
  112. console.log(`当前页: ${val}`);
  113. },
  114. testfun(){
  115. var kvArray = [["key1", "value1"], ["key2", "value2"]];
  116. // Map 构造函数可以将一个 二维 键值对数组转换成一个 Map 对象
  117. var myMap = new Map(kvArray);
  118. console.log(myMap)
  119. // 使用 Array.from 函数可以将一个 Map 对象转换成一个二维键值对数组
  120. var outArray = Array.from(myMap);
  121. console.log(outArray)
  122. var first = new Map([[1, 'one'], [2, 'two'], [3, 'three'],]);
  123. var second = new Map([[1, 'uno'], [2, 'dos']]);
  124. // 合并两个 Map 对象时,如果有重复的键值,则后面的会覆盖前面的,对应值即 uno,dos, three
  125. var merged = new Map([...first, ...second]);
  126. console.log(merged);
  127. let mySet = new Set();
  128. // mySet.add(1); // Set(1) {1}
  129. // mySet.add(5); // Set(2) {1, 5}
  130. // mySet.add(5); // Set(2) {1, 5} 这里体现了值的唯一性
  131. // mySet.add("some text");
  132. // Set(3) {1, 5, "some text"} 这里体现了类型的多样性
  133. var o = {a: 1, b: 2};
  134. mySet.add(o);
  135. // mySet.add({a: 1, b: 2});
  136. console.log(mySet);
  137. }
  138. },
  139. mounted(){
  140. this.testfun()
  141. }
  142. }
  143. </script>
  144. <style>
  145. .supplierinfo-all {
  146. background-color: #fff;
  147. padding: 10px;
  148. box-shadow: 0 0 5px #0005;
  149. border-radius: 10px;
  150. height: 100%;
  151. min-height: 840px;
  152. }
  153. .supplierinfo-screen{
  154. display: flex;
  155. justify-content: space-between;
  156. }
  157. .supplierinfo-screen-ul{
  158. display: flex;
  159. }
  160. .supplierinfo-screen-li{
  161. width: 280px;
  162. display: flex;
  163. align-items: center;
  164. }
  165. .supplierinfoscreen-li-title{
  166. width: 80px;
  167. text-align: end;
  168. font-size: 14px;
  169. color: #555;
  170. }
  171. .supplierinfo-screen-li .el-input{
  172. width: 184px;
  173. }
  174. .supplierinfo-screen-li .el-select{
  175. width: 184px;
  176. }
  177. .supplierinfo-table{
  178. margin-top: 15px;
  179. }
  180. .supplierinfo-table .block{
  181. margin-top: 20px;
  182. text-align: center;
  183. }
  184. </style>