index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <template>
  2. <div class="content main levelSetting">
  3. <div class="search_bottom_tab">
  4. <div
  5. class="tab_list search"
  6. style="line-height: 60px;"
  7. >
  8. <el-radio-group
  9. v-model="chargeStatus"
  10. @change="changeRadio"
  11. class="zz-tab-button"
  12. >
  13. <el-radio-button label="1">员工服务统计</el-radio-button>
  14. <el-radio-button label="2">统计参数设置</el-radio-button>
  15. </el-radio-group>
  16. <el-input
  17. v-show="chargeStatus == 1 ? true : false"
  18. clearable
  19. placeholder="输入员工姓名/手机号"
  20. class="search-input"
  21. v-trim
  22. v-model="mixins_query.name"
  23. ></el-input>
  24. <el-date-picker
  25. v-show="chargeStatus == 1 ? true : false"
  26. type="date"
  27. placeholder="选择日期"
  28. value-format="yyyy-MM-dd"
  29. v-model="pickerTime"
  30. :editable="false"
  31. @change="timeToggle"
  32. >
  33. </el-date-picker>
  34. <el-button
  35. v-show="chargeStatus == 1 ? true : false"
  36. class="search-btn"
  37. type="primary"
  38. @click="mixins_search()"
  39. icon="el-icon-search"
  40. >查询</el-button>
  41. </div>
  42. <zz-table
  43. v-if="chargeStatus == 1 ? true : false"
  44. :settings="{ showIndex: true, stripe: true }"
  45. :cols="cols"
  46. :data="mixins_list"
  47. :pageset="mixins_pageset"
  48. @page-change="pageChange"
  49. :selectable="selectable"
  50. @selection-change="selectionChange"
  51. >
  52. <template
  53. slot-scope="scope"
  54. slot="opt"
  55. >
  56. <el-tooltip
  57. class="item"
  58. effect="light"
  59. placement="bottom"
  60. content="查看"
  61. >
  62. <i
  63. class="zoniot_font zoniot-icon-xiangqing"
  64. @click="lookDetails(scope.row)"
  65. ></i>
  66. </el-tooltip>
  67. </template>
  68. </zz-table>
  69. </div>
  70. <div
  71. class="organ-tree"
  72. v-if="chargeStatus == 1 ? false : true"
  73. >
  74. <el-input
  75. v-model="filterText"
  76. placeholder="请输入机构名称"
  77. suffix-icon="el-icon-search"
  78. ></el-input>
  79. <div class="tree-style-box">
  80. <el-scrollbar style="height: 100%">
  81. <el-tree
  82. class="tree-style"
  83. :data="organList"
  84. ref="tree"
  85. node-key="id"
  86. :highlight-current="true"
  87. :props="defaultProps"
  88. :expand-on-click-node="false"
  89. @node-click="treeClick"
  90. :default-expand-all="false"
  91. :filter-node-method="filterNode"
  92. >
  93. <span
  94. class="ellipsis"
  95. slot-scope="{ node }"
  96. >
  97. <span :title="node.label">{{ node.label }}</span>
  98. </span>
  99. </el-tree>
  100. </el-scrollbar>
  101. </div>
  102. </div>
  103. <div
  104. class="content-right"
  105. v-show="chargeStatus == 1 ? false : true"
  106. >
  107. <el-form
  108. ref="form"
  109. :model="formData"
  110. >
  111. <el-form-item>
  112. <div class="item-title">奖励基数:运维服务费 *
  113. <el-input
  114. v-model="formData.cardinality"
  115. oninput="value=value.replace(/[^0-9.]/g,'')"
  116. ></el-input>
  117. </div>
  118. </el-form-item>
  119. <div class="formContent-item_title">员工服务费</div>
  120. <el-form-item>
  121. <div class="item-title">评价等级(五星):奖励基数 *
  122. <el-input
  123. v-model="formData.fiveStar"
  124. oninput="value=value.replace(/[^0-9.]/g,'')"
  125. ></el-input>
  126. </div>
  127. </el-form-item>
  128. <el-form-item>
  129. <div class="item-title">评价等级(四星):奖励基数 *
  130. <el-input
  131. v-model="formData.fourStar"
  132. oninput="value=value.replace(/[^0-9.]/g,'')"
  133. ></el-input>
  134. </div>
  135. </el-form-item>
  136. <el-form-item>
  137. <div class="item-title">评价等级(三星):奖励基数 *
  138. <el-input
  139. v-model="formData.threeStar"
  140. oninput="value=value.replace(/[^0-9.]/g,'')"
  141. ></el-input>
  142. </div>
  143. </el-form-item>
  144. <el-form-item>
  145. <div class="item-title">评价等级(二星):奖励基数 *
  146. <el-input
  147. v-model="formData.twoStar"
  148. oninput="value=value.replace(/[^0-9.]/g,'')"
  149. ></el-input>
  150. </div>
  151. </el-form-item>
  152. <el-form-item>
  153. <div class="item-title">评价等级(一星):奖励基数 *
  154. <el-input
  155. v-model="formData.oneStar"
  156. oninput="value=value.replace(/[^0-9.]/g,'')"
  157. ></el-input>
  158. </div>
  159. </el-form-item>
  160. <el-form-item>
  161. <div class="item-title">评价等级(无评价):奖励基数 *
  162. <el-input
  163. v-model="formData.star"
  164. oninput="value=value.replace(/[^0-9.]/g,'')"
  165. ></el-input>
  166. </div>
  167. </el-form-item>
  168. <el-form-item>
  169. <div
  170. class="item-title"
  171. style="color:red"
  172. >注:员工服务费提成=奖励基数*评价等级
  173. </div>
  174. </el-form-item>
  175. </el-form>
  176. <el-form>
  177. <el-form-item style="text-align: right; position: absolute; bottom: 0; right: 40px;">
  178. <el-button
  179. type="primary"
  180. @click="submit"
  181. >保存</el-button>
  182. </el-form-item>
  183. </el-form>
  184. </div>
  185. </div>
  186. </template>
  187. <script>
  188. import list from '@utils/list';
  189. export default {
  190. mixins: [list],
  191. data () {
  192. return {
  193. chargeStatus: 1,
  194. organList: [],
  195. currentId: '',
  196. pickerTime: '',
  197. defaultProps: {
  198. children: 'orgs',
  199. label: 'orgName'
  200. },
  201. mixins_post: 'get',
  202. cols: [
  203. {
  204. label: '员工姓名',
  205. prop: 'username'
  206. },
  207. {
  208. label: '手机号',
  209. prop: 'phone'
  210. },
  211. {
  212. label: '所属公司',
  213. prop: 'companyOrgName'
  214. },
  215. {
  216. label: '所属部门',
  217. prop: 'deptOrgName'
  218. },
  219. {
  220. label: '月份',
  221. prop: 'month',
  222. format (val) {
  223. let res = val.toString();
  224. return (res).substr(0, 4) + '年' + (res).substr(4, 2) + '月'
  225. }
  226. },
  227. {
  228. label: '业主报修工单数',
  229. prop: 'workOrderNum'
  230. },
  231. {
  232. label: '服务费总金额(元)',
  233. prop: 'amount'
  234. },
  235. {
  236. label: '服务费提成金额(元)',
  237. prop: 'royalty'
  238. },
  239. {
  240. label: '操作',
  241. slot: 'opt'
  242. }
  243. ],
  244. formData: {
  245. companyOrgId: '',
  246. cardinality: '',
  247. fiveStar: '',
  248. fourStar: '',
  249. threeStar: '',
  250. twoStar: '',
  251. oneStar: '',
  252. star: ''
  253. }
  254. }
  255. },
  256. methods: {
  257. changeRadio () {
  258. if (this.chargeStatus == '1') {
  259. } else if (this.chargeStatus == '2') {
  260. this.getOrgTreeList();
  261. }
  262. },
  263. // 获得机构名称
  264. getOrgTreeList () {
  265. this.$http.postForm('/czc-user-center/org/getOrgTree', { orgType: 'company', id: '000' }).then(({ status, data, msg }) => {
  266. if (status === 0 && data) {
  267. this.organList = data;
  268. this.$nextTick().then(() => {
  269. const firstNode = document.querySelector('.el-tree-node');
  270. firstNode.click();
  271. });
  272. }
  273. });
  274. },
  275. filterNode (value, data) {
  276. if (!value) return true;
  277. return data.orgName.indexOf(value) !== -1;
  278. },
  279. treeClick (e) {
  280. if (e.id == 0) return;
  281. this.currentId = e.id;
  282. this.formData.companyOrgId = e.id;
  283. this.royaltyConfig();
  284. },
  285. timeToggle (e) {
  286. if (!!e) {
  287. this.mixins_query.month = e.substr(0, 4) + e.substr(5, 2);
  288. } else {
  289. this.mixins_query.month = ''
  290. }
  291. },
  292. lookDetails (row) {
  293. new Promise((resolve) => {
  294. this.$store.dispatch('addPopup', {
  295. url: '/workOrders/employeeServices/details.vue',
  296. width: '780px',
  297. height: '500px',
  298. props: {
  299. row,
  300. callback: resolve,
  301. },
  302. showConfirmButton: true,
  303. showCancelButton: true,
  304. hideStar: true,
  305. title: '任务详情'
  306. });
  307. }).then(() => {
  308. this.mixins_search();
  309. });
  310. },
  311. submit () {
  312. this.$http.post('/czc-community/royaltyConfig/save', this.formData).then(({ status, data, msg }) => {
  313. if (status == 0) {
  314. this.$message.success(msg);
  315. } else {
  316. this.$message.error(msg);
  317. }
  318. })
  319. },
  320. // /czc-community/royaltyConfig/find
  321. royaltyConfig () {
  322. this.$http.get('/czc-community/royaltyConfig/find', { companyOrgId: this.currentId }).then(({ status, data, msg }) => {
  323. if (status == 0) {
  324. this.formData.cardinality = data.cardinality;
  325. this.formData.fiveStar = data.fiveStar;
  326. this.formData.fourStar = data.fourStar;
  327. this.formData.threeStar = data.threeStar;
  328. this.formData.twoStar = data.twoStar;
  329. this.formData.oneStar = data.oneStar;
  330. this.formData.star = data.star;
  331. }
  332. })
  333. }
  334. },
  335. created () {
  336. this.mixins_dataUrl = '/czc-community/royalty/page';
  337. this.mixins_query = {};
  338. this.mixins_search();
  339. }
  340. }
  341. </script>
  342. <style lang="scss" scoped>
  343. @import '@assets/css/public-style.scss';
  344. .search_bottom_tab {
  345. height: 60px;
  346. // line-height: 60px;
  347. background: #ffffff;
  348. border-radius: 4px;
  349. margin-bottom: 20px;
  350. padding: 0 20px;
  351. box-sizing: border-box;
  352. .tab_list {
  353. display: inline-block;
  354. border-bottom: 2px solid transparent;
  355. cursor: pointer;
  356. color: #424656;
  357. &:not(:last-child) {
  358. margin-right: 40px;
  359. }
  360. &.active {
  361. color: $mainTextColor;
  362. border-color: $mainTextColor;
  363. }
  364. }
  365. }
  366. .search {
  367. padding: 0 !important;
  368. }
  369. .search {
  370. .zz-tab-button {
  371. margin-right: 20px;
  372. }
  373. .width120 {
  374. width: rem(120);
  375. }
  376. }
  377. .levelSetting {
  378. height: calc(100% - 80px);
  379. .organ-tree {
  380. width: 260px;
  381. height: 100%;
  382. background: #ffffff;
  383. padding: 20px;
  384. float: left;
  385. font-size: 14px;
  386. .tree-style-box {
  387. margin-top: 20px;
  388. }
  389. }
  390. }
  391. .content-right {
  392. background: white;
  393. font-size: 12px;
  394. padding: 20px;
  395. // height: calc(100% - 100px);
  396. height: 100%;
  397. .item-title {
  398. /deep/ .el-input {
  399. display: inline-block;
  400. width: 120px;
  401. margin: 0 10px;
  402. }
  403. }
  404. }
  405. </style>