maillist.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <el-col :span="4">
  5. <div class="grid-content bg-purple">
  6. <el-input
  7. placeholder="输入部门名称"
  8. v-model="filterText">
  9. </el-input>
  10. <el-tree
  11. class="filter-tree"
  12. :data="data"
  13. :props="defaultProps"
  14. default-expand-all
  15. :filter-node-method="filterNode"
  16. ref="tree">
  17. </el-tree>
  18. </div>
  19. </el-col>
  20. <el-col :span="20">
  21. <div class="grid-content bg-purple">
  22. <el-form :inline="true" size="small" :model="formInline" class="demo-form-inline">
  23. <el-form-item label="姓名">
  24. <el-input size="small" v-model="formInline.user" placeholder="姓名"></el-input>
  25. </el-form-item>
  26. <el-form-item label="移动电话">
  27. <el-input size="small" v-model="formInline.user" placeholder="移动电话"></el-input>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-button type="primary" size="mini" @click="onSubmit">查询</el-button>
  31. </el-form-item>
  32. </el-form>
  33. <el-row :gutter="10" style="margin-bottom:8px;">
  34. <el-col :span="1.5">
  35. <el-button
  36. type="primary"
  37. icon="el-icon-user"
  38. size="mini"
  39. :disabled="single"
  40. @click="dialogFormVisible = true"
  41. >新增</el-button>
  42. </el-col>
  43. <el-col :span="1.5" >
  44. <el-button
  45. type="danger"
  46. icon="el-icon-delete"
  47. size="mini"
  48. :disabled="multiple"
  49. @click="handleDelete"
  50. >删除</el-button>
  51. </el-col>
  52. </el-row>
  53. <el-table
  54. :data="tableData" border
  55. style="width: 100%">
  56. <el-table-column type="selection" width="55" align="center" />
  57. <el-table-column
  58. type="index"
  59. label="序号"
  60. width="60" align="center">
  61. </el-table-column>
  62. <el-table-column
  63. label="姓名"
  64. prop="id">
  65. </el-table-column>
  66. <el-table-column
  67. label="部门"
  68. prop="name">
  69. </el-table-column>
  70. <el-table-column
  71. label="移动电话"
  72. prop="category">
  73. </el-table-column>
  74. <el-table-column
  75. label="办公电话"
  76. prop="desc">
  77. </el-table-column>
  78. <el-table-column label="操作" width="150" align="center" class-name="small-padding fixed-width">
  79. <template slot-scope="scope">
  80. <el-button
  81. size="small"
  82. type="text"
  83. icon="el-icon-edit"
  84. @click="handleUpdate1(scope.row)"
  85. v-hasPermi="['system:info:edit']"
  86. >修改</el-button>
  87. <el-button
  88. size="small"
  89. type="text"
  90. icon="el-icon-delete"
  91. @click="handleDelete(scope.row)"
  92. v-hasPermi="['system:info:remove']"
  93. >删除</el-button>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. </div>
  98. </el-col>
  99. </el-row>
  100. <el-dialog title="新增用户" :visible.sync="dialogFormVisible">
  101. <el-form :model="form">
  102. <el-form-item label="姓名" :label-width="formLabelWidth">
  103. <el-input style="width: 200px;" v-model="form.name" autocomplete="off"></el-input>
  104. </el-form-item>
  105. <el-form-item label="部门" :label-width="formLabelWidth">
  106. <el-select v-model="form.region" placeholder="请选择活动区域">
  107. <el-option label="局长" value="shanghai"></el-option>
  108. <el-option label="副局长" value="beijing"></el-option>
  109. <el-option label="办公室" value="beijing"></el-option>
  110. <el-option label="审批一科" value="beijing"></el-option>
  111. </el-select>
  112. </el-form-item>
  113. <el-form-item label="移动电话" :label-width="formLabelWidth">
  114. <el-input v-model="form.name" autocomplete="off"></el-input>
  115. </el-form-item>
  116. <el-form-item label="主要办公电话" :label-width="formLabelWidth">
  117. <el-input v-model="form.name" autocomplete="off"></el-input>
  118. </el-form-item>
  119. <el-form-item label="次要办公电话" :label-width="formLabelWidth">
  120. <el-input v-model="form.name" autocomplete="off"></el-input>
  121. </el-form-item>
  122. </el-form>
  123. <div slot="footer" class="dialog-footer">
  124. <el-button @click="dialogFormVisible = false">取 消</el-button>
  125. <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
  126. </div>
  127. </el-dialog>
  128. </div>
  129. </template>
  130. <script>
  131. import {listList, getList, addList, updateList, delList } from "@/api/system/addresslist/addresslist";
  132. export default {
  133. name: 'maillist',
  134. data() {
  135. return {
  136. dialogFormVisible: false,
  137. form: {
  138. name: '',
  139. region: '',
  140. date1: '',
  141. date2: '',
  142. delivery: false,
  143. type: [],
  144. resource: '',
  145. desc: ''
  146. },
  147. formLabelWidth: '100px',
  148. filterText: '',
  149. data: [{
  150. id: 1,
  151. label: '通讯录',
  152. children: [{
  153. id: 4,
  154. label: '局长',
  155. },
  156. {
  157. id: 5,
  158. label: '副局长',
  159. },
  160. {
  161. id: 6,
  162. label: '办公室',
  163. },
  164. {
  165. id: 7,
  166. label: '政务服务管理科',
  167. },
  168. {
  169. id: 8,
  170. label: '政策法规科',
  171. },
  172. {
  173. id: 9,
  174. label: '现场勘验科',
  175. },
  176. {
  177. id: 10,
  178. label: '审批一科',
  179. },
  180. ]
  181. }, ],
  182. defaultProps: {
  183. children: 'children',
  184. label: 'label'
  185. },
  186. formInline: {
  187. user: '',
  188. region: ''
  189. },
  190. tableData: [{
  191. index:0,
  192. id: '李大',
  193. name: '办公室',
  194. category: '12345678910',
  195. desc: '0311-86125678',
  196. address: [
  197. '12号窗口:85537672(社会事务)',
  198. '13号窗口:855537672(交通涉农)',
  199. '14号窗口:85501239(市场服务)',
  200. '15号窗口:85501239(市场服务)',
  201. '16号窗口:85501239(安全环保)',
  202. '制证窗口01:85537650',
  203. '制证窗口02:85537650',
  204. '制证窗口03:85537650',
  205. '制证窗口04:85537650',
  206. '综合出征:85501127',
  207. '邮寄送达:85501127',
  208. '档案查询:85501127'
  209. ],
  210. shop: '王小虎夫妻店',
  211. shopId: '10333'
  212. }, {
  213. index:1,
  214. id: '王二',
  215. name: '政策法规科',
  216. category: '12345678910',
  217. desc: '0311-86125678',
  218. address: [
  219. '12号窗口:85537672(社会事务)',
  220. '13号窗口:855537672(交通涉农)',
  221. '14号窗口:85501239(市场服务)',
  222. '15号窗口:85501239(市场服务)',
  223. '16号窗口:85501239(安全环保)',
  224. '制证窗口01:85537650',
  225. '制证窗口02:85537650',
  226. '制证窗口03:85537650',
  227. '制证窗口04:85537650',
  228. '综合出征:85501127',
  229. '邮寄送达:85501127',
  230. '档案查询:85501127'
  231. ],
  232. shop: '王小虎夫妻店',
  233. shopId: '10333'
  234. }, {
  235. index:2,
  236. id: '张三',
  237. name: '现场勘验科',
  238. category: '12345678910',
  239. desc: '0311-86125678',
  240. address: [
  241. '12号窗口:85537672(社会事务)',
  242. '13号窗口:855537672(交通涉农)',
  243. '14号窗口:85501239(市场服务)',
  244. '15号窗口:85501239(市场服务)',
  245. '16号窗口:85501239(安全环保)',
  246. '制证窗口01:85537650',
  247. '制证窗口02:85537650',
  248. '制证窗口03:85537650',
  249. '制证窗口04:85537650',
  250. '综合出征:85501127',
  251. '邮寄送达:85501127',
  252. '档案查询:85501127'
  253. ],
  254. shop: '王小虎夫妻店',
  255. shopId: '10333'
  256. }, {
  257. index:3,
  258. id: '李四',
  259. name: '审批一科',
  260. category: '12345678910',
  261. desc: '0311-86125678',
  262. address: [
  263. '12号窗口:85537672(社会事务)',
  264. '13号窗口:855537672(交通涉农)',
  265. '14号窗口:85501239(市场服务)',
  266. '15号窗口:85501239(市场服务)',
  267. '16号窗口:85501239(安全环保)',
  268. '制证窗口01:85537650',
  269. '制证窗口02:85537650',
  270. '制证窗口03:85537650',
  271. '制证窗口04:85537650',
  272. '综合出征:85501127',
  273. '邮寄送达:85501127',
  274. '档案查询:85501127'
  275. ],
  276. shop: '王小虎夫妻店',
  277. shopId: '10333'
  278. }],
  279. inputVisible: false,
  280. inputValue: ''
  281. }
  282. },
  283. methods: {
  284. handleClose(item,i,s) {
  285. alert(i)
  286. let u = s + 1;
  287. this.tableData[i].address.splice(this.tableData[i].address.indexOf(s), 1);
  288. },
  289. filterNode(value, data) {
  290. if (!value) return true;
  291. return data.label.indexOf(value) !== -1;
  292. },
  293. showInput(i) {
  294. this.inputVisible= true;
  295. document.getElementsByClassName("input-new-tag")[i].style.display = "none";
  296. this.$nextTick(_ => {
  297. this.$refs.saveTagInput.$refs.input.focus();
  298. });
  299. },
  300. handleInputConfirm(i) {
  301. let inputValue = this.inputValue;
  302. if (inputValue) {
  303. this.tableData[i].address.push(inputValue);
  304. }
  305. this.inputVisible = false;
  306. this.inputValue = '';
  307. }
  308. },
  309. watch: {
  310. filterText(val) {
  311. this.$refs.tree.filter(val);
  312. }
  313. },
  314. }
  315. </script>
  316. <style scoped>
  317. .demo-table-expand {
  318. font-size: 0;
  319. }
  320. .demo-table-expand label {
  321. width: 90px;
  322. color: #99a9bf;
  323. }
  324. .demo-table-expand .el-form-item {
  325. margin-right: 0;
  326. margin-bottom: 0;
  327. }
  328. .demo-table-expand .el-form-item span{
  329. padding-left: 15px;
  330. margin-bottom: 15px;
  331. font-size: 16px;
  332. }
  333. .input-new-tag{
  334. width: 200px;
  335. margin-left: 15px;
  336. }
  337. .button-new-tag{
  338. margin-left: 15px;
  339. }
  340. </style>