statistics.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="公司名" prop="companyId">
  5. <el-select multiple filterable v-model="companyIdArr" placeholder="请选择公司名" clearable size="small">
  6. <el-option
  7. v-for="item in companys"
  8. :key="item.companyId"
  9. :label="item.companyName"
  10. :value="item.companyId"
  11. />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item >
  15. <treeselect style="width: 220px" :multiple="true" :clearable="false" @select="deptSelect" @deselect="deptCancelSelect" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
  16. </el-form-item>
  17. <!-- <el-form-item >
  18. <treeselect style="width: 220px" :clearable="false" v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
  19. </el-form-item>
  20. <el-form-item label="员工姓名" prop="userNickName">
  21. <el-input
  22. v-model="queryParams.userNickName"
  23. placeholder="请输入员工姓名"
  24. clearable
  25. size="small"
  26. @keyup.enter.native="handleQuery"
  27. />
  28. </el-form-item> -->
  29. <el-form-item label="所属档期" prop="scheduleId">
  30. <el-select filterable multiple style="width:205.4px" v-model="scheduleIdArr" placeholder="请选择档期" clearable size="small" >
  31. <el-option
  32. v-for="item in scheduleList"
  33. :key="item.id"
  34. :label="item.name"
  35. :value="item.id"
  36. />
  37. </el-select>
  38. </el-form-item>
  39. <!-- <el-form-item label="档期名称" prop="scheduleName">
  40. <el-input
  41. v-model="queryParams.name"
  42. placeholder="请输入档期名称"
  43. clearable
  44. size="small"
  45. @keyup.enter.native="handleQuery"
  46. />
  47. </el-form-item> -->
  48. <!-- <el-form-item label="档期状态" prop="scheduleStatus">
  49. <el-select v-model="queryParams.status" placeholder="请选择档期状态" clearable size="small">
  50. <el-option
  51. v-for="dict in statusOptions"
  52. :key="dict.dictValue"
  53. :label="dict.dictLabel"
  54. :value="dict.dictValue"
  55. />
  56. </el-select>
  57. </el-form-item> -->
  58. <el-form-item label="创建时间" prop="createTime">
  59. <el-date-picker
  60. style="width:225.4px"
  61. clearable size="small"
  62. v-model="dateRange"
  63. type="daterange"
  64. value-format="yyyy-MM-dd"
  65. start-placeholder="开始日期"
  66. end-placeholder="结束日期">
  67. </el-date-picker>
  68. </el-form-item>
  69. <el-form-item>
  70. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  71. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  72. </el-form-item>
  73. </el-form>
  74. <el-row :gutter="10" class="mb8">
  75. <el-col :span="1.5">
  76. <el-button
  77. type="warning"
  78. icon="el-icon-download"
  79. size="mini"
  80. @click="handleExport"
  81. v-hasPermi="['company:scheduleReport:export']"
  82. >导出</el-button>
  83. </el-col>
  84. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  85. </el-row>
  86. <!-- :span-method="objectSpanMethod" -->
  87. <el-table v-loading="loading" border :data="tcmScheduleReportList" @selection-change="handleSelectionChange">
  88. <!-- <el-table-column label="id" width="50" align="center" prop="id" /> -->
  89. <el-table-column fixed label="档期" align="center" prop="scheduleName" />
  90. <el-table-column fixed label="公司名称" width="100px" align="center" prop="companyName" />
  91. <!-- <el-table-column fixed label="所在部门" width="100px" align="center" prop="deptName" /> -->
  92. <!-- <el-table-column label="员工姓名" align="center" prop="userNickName" /> -->
  93. <el-table-column fixed label="团队总人数" width="90" align="center" prop="cuCount" >
  94. <template slot-scope="scope">
  95. {{!scope.row.cuCount?0:scope.row.cuCount}}
  96. </template>
  97. </el-table-column>
  98. <el-table-column fixed label="接线人数" width="80px" align="center" prop="connectionNum" />
  99. <el-table-column fixed label="总进线" width="60" align="center" prop="totalNum" />
  100. <el-table-column fixed label="人均受线" width="90" align="center" prop="preMoney" >
  101. <template slot-scope="scope">
  102. {{!scope.row.money?0:(scope.row.totalNum/scope.row.connectionNum).toFixed(2)}}
  103. </template>
  104. </el-table-column>
  105. <el-table-column fixed label="总消费" width="90" align="center" prop="money" >
  106. <template slot-scope="scope">
  107. {{!scope.row.money?0:(scope.row.money).toFixed(2)}}
  108. </template>
  109. </el-table-column>
  110. <el-table-column fixed label="注册数" width="60" align="center" prop="registerNum" />
  111. <el-table-column fixed label="上线数" width="60" align="center" prop="onlineNum" />
  112. <el-table-column fixed label="完课数" width="60" align="center" prop="finishNum" />
  113. <el-table-column label="注册率" align="center" prop="registerRate" >
  114. <template slot-scope="scope">
  115. {{ renderTotalVal(scope.row,0) }}
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="上线率" align="center" prop="onlineRate" >
  119. <template slot-scope="scope">
  120. {{ renderTotalVal(scope.row,1) }}
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="完课率" align="center" prop="finishRate" >
  124. <template slot-scope="scope">
  125. {{ renderTotalVal(scope.row,2) }}
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="创建时间" align="center" prop="createTime" width="100">
  129. <template slot-scope="scope">
  130. <span>{{ parseTime(scope.row.createTime) }}</span>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="最后更新时间" align="center" prop="updateTime" width="100">
  134. <template slot-scope="scope">
  135. <span>{{ parseTime(scope.row.updateTime) }}</span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column v-for='index in 36' :key='index' :label="renderLabel(index-1)" :width="(index-1)%4==2?'85':'72'" :prop="renderLabelProp(index)" align="center" >
  139. <template slot-scope="scope">
  140. {{ runderValue(scope.row,index-1) }}
  141. </template>
  142. </el-table-column>
  143. <el-table-column fixed="right" label="累计总业绩" width="90" align="center" prop="totalMoney" >
  144. <template slot-scope="scope">
  145. {{!scope.row.totalMoney?0:(scope.row.totalMoney).toFixed(2)}}
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="累计总单" width="80" align="center" prop="totalOrder" >
  149. <template slot-scope="scope">
  150. {{!scope.row.totalOrder?0:scope.row.totalOrder}}
  151. </template>
  152. </el-table-column>
  153. <el-table-column fixed="right" label="人均业绩" width="90" align="center" prop="targetRate" >
  154. <template slot-scope="scope">
  155. {{ renderTotalVal(scope.row,4) }}
  156. </template>
  157. </el-table-column>
  158. <el-table-column fixed="right" label="目标业绩" width="80" align="center" prop="targetMoney" >
  159. <template slot-scope="scope">
  160. {{!scope.row.targetMoney?0:(scope.row.targetMoney).toFixed(2)}}
  161. </template>
  162. </el-table-column>
  163. <el-table-column fixed="right" label="目标完成率" width="90" align="center" prop="targetRate" >
  164. <template slot-scope="scope">
  165. {{ renderTotalVal(scope.row,3) }}
  166. </template>
  167. </el-table-column>
  168. <el-table-column fixed="right" label="ZROI" width="90" align="center" prop="zroi" >
  169. <template slot-scope="scope">
  170. {{ renderTotalVal(scope.row,6) }}
  171. </template>
  172. </el-table-column>
  173. <el-table-column fixed="right" label="单线R值" width="90" align="center" prop="targetRate" >
  174. <template slot-scope="scope">
  175. {{ renderTotalVal(scope.row,5) }}
  176. </template>
  177. </el-table-column>
  178. <!--
  179. <el-table-column label="一轮业绩" width="72" align="center" prop="round1Money" >
  180. <template slot-scope="scope">
  181. {{!scope.row.round1Money?0:(scope.row.round1Money).toFixed(2)}}
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="一轮单数" width="72" align="center" prop="round1Order" ></el-table-column>
  185. <el-table-column label="一轮转化率" width="85" align="center" prop="round1Rate">
  186. <template slot-scope="scope">
  187. {{(scope.row.round1Rate*100).toFixed(2)+"%"}}
  188. </template>
  189. </el-table-column>
  190. <el-table-column label="一轮客单" width="72" align="center" prop="round1Unit">
  191. <template slot-scope="scope">
  192. {{(scope.row.round1Unit).toFixed(2)}}
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="二轮业绩" width="72" align="center" prop="round2Money" >
  196. <template slot-scope="scope">
  197. {{!scope.row.round2Money?0:(scope.row.round2Money).toFixed(2)}}
  198. </template>
  199. </el-table-column>
  200. <el-table-column label="二轮单数" width="72" align="center" prop="round2Order" ></el-table-column>
  201. <el-table-column label="二轮转化率" width="85" align="center" prop="round2Rate">
  202. <template slot-scope="scope">
  203. {{(scope.row.round2Rate*100).toFixed(2)+"%"}}
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="二轮客单" width="72" align="center" prop="round2Unit">
  207. <template slot-scope="scope">
  208. {{(scope.row.round2Unit).toFixed(2)}}
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="三轮业绩" width="72" align="center" prop="round3Money" >
  212. <template slot-scope="scope">
  213. {{!scope.row.round3Money?0:(scope.row.round3Money).toFixed(2)}}
  214. </template>
  215. </el-table-column>
  216. <el-table-column label="三轮单数" width="72" align="center" prop="round3Order" ></el-table-column>
  217. <el-table-column label="三轮转化率" width="85" align="center" prop="round3Rate">
  218. <template slot-scope="scope">
  219. {{(scope.row.round3Rate*100).toFixed(2)+"%"}}
  220. </template>
  221. </el-table-column>
  222. <el-table-column label="三轮客单" width="72" align="center" prop="round3Unit">
  223. <template slot-scope="scope">
  224. {{(scope.row.round3Unit).toFixed(2)}}
  225. </template>
  226. </el-table-column>
  227. <el-table-column label="四轮业绩" width="72" align="center" prop="round4Money" >
  228. <template slot-scope="scope">
  229. {{!scope.row.round4Money?0:(scope.row.round4Money).toFixed(2)}}
  230. </template>
  231. </el-table-column>
  232. <el-table-column label="四轮单数" width="72" align="center" prop="round4Order" ></el-table-column>
  233. <el-table-column label="四轮转化率" width="85" align="center" prop="round4Rate">
  234. <template slot-scope="scope1">
  235. {{(scope1.row.round4Rate*100).toFixed(2)+"%"}}
  236. </template>
  237. </el-table-column>
  238. <el-table-column label="四轮客单" width="72" align="center" prop="round4Unit">
  239. <template slot-scope="scope">
  240. {{(scope.row.round4Unit).toFixed(2)}}
  241. </template>
  242. </el-table-column>
  243. <el-table-column label="五轮业绩" width="72" align="center" prop="round5Money" >
  244. <template slot-scope="scope">
  245. {{!scope.row.round5Money?0:(scope.row.round5Money).toFixed(2)}}
  246. </template>
  247. </el-table-column>
  248. <el-table-column label="五轮单数" width="72" align="center" prop="round5Order" ></el-table-column>
  249. <el-table-column label="五轮转化率" width="85" align="center" prop="round5Rate">
  250. <template slot-scope="scope">
  251. {{(scope.row.round5Rate*100).toFixed(2)+"%"}}
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="五轮客单" width="72" align="center" prop="round5Unit">
  255. <template slot-scope="scope">
  256. {{(scope.row.round5Unit).toFixed(2)}}
  257. </template>
  258. </el-table-column>
  259. <el-table-column label="六轮业绩" width="72" align="center" prop="round6Money" >
  260. <template slot-scope="scope">
  261. {{!scope.row.round6Money?0:(scope.row.round6Money).toFixed(2)}}
  262. </template>
  263. </el-table-column>
  264. <el-table-column label="六轮单数" width="72" align="center" prop="round6Order" ></el-table-column>
  265. <el-table-column label="六轮转化率" width="85" align="center" prop="round6Rate">
  266. <template slot-scope="scope">
  267. {{(scope.row.round6Rate*100).toFixed(2)+"%"}}
  268. </template>
  269. </el-table-column>
  270. <el-table-column label="六轮客单" width="72" align="center" prop="round6Unit">
  271. <template slot-scope="scope">
  272. {{(scope.row.round6Unit).toFixed(2)}}
  273. </template>
  274. </el-table-column>
  275. <el-table-column label="七轮业绩" width="72" align="center" prop="round7Money" >
  276. <template slot-scope="scope">
  277. {{!scope.row.round7Money?0:(scope.row.round7Money).toFixed(2)}}
  278. </template>
  279. </el-table-column>
  280. <el-table-column label="七轮单数" width="72" align="center" prop="round7Order" ></el-table-column>
  281. <el-table-column label="七轮转化率" width="85" align="center" prop="round7Rate">
  282. <template slot-scope="scope">
  283. {{(scope.row.round7Rate*100).toFixed(2)+"%"}}
  284. </template>
  285. </el-table-column>
  286. <el-table-column label="七轮客单" width="72" align="center" prop="round7Unit">
  287. <template slot-scope="scope">
  288. {{(scope.row.round7Unit).toFixed(2)}}
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="八轮业绩" width="72" align="center" prop="round8Money" >
  292. <template slot-scope="scope">
  293. {{!scope.row.round8Money?0:(scope.row.round8Money).toFixed(2)}}
  294. </template>
  295. </el-table-column>
  296. <el-table-column label="八轮单数" width="72" align="center" prop="round8Order" ></el-table-column>
  297. <el-table-column label="八轮转化率" width="85" align="center" prop="round8Rate">
  298. <template slot-scope="scope">
  299. {{(scope.row.round8Rate*100).toFixed(2)+"%"}}
  300. </template>
  301. </el-table-column>
  302. <el-table-column label="八轮客单" width="72" align="center" prop="round8Unit">
  303. <template slot-scope="scope">
  304. {{(scope.row.round8Unit).toFixed(2)}}
  305. </template>
  306. </el-table-column>
  307. <el-table-column label="九轮业绩" width="72" align="center" prop="round9Money" >
  308. <template slot-scope="scope">
  309. {{!scope.row.round9Money?0:(scope.row.round9Money).toFixed(2)}}
  310. </template>
  311. </el-table-column>
  312. <el-table-column label="九轮单数" width="72" align="center" prop="round9Order" ></el-table-column>
  313. <el-table-column label="九轮转化率" width="85" align="center" prop="round9Rate">
  314. <template slot-scope="scope">
  315. {{(scope.row.round9Rate*100).toFixed(2)+"%"}}
  316. </template>
  317. </el-table-column>
  318. <el-table-column label="九轮客单" width="72" align="center" prop="round9Unit">
  319. <template slot-scope="scope">
  320. {{(scope.row.round9Unit).toFixed(2)}}
  321. </template>
  322. </el-table-column> -->
  323. <el-table-column fixed="right" label="操作" width="80px" align="center" class-name="small-padding fixed-width">
  324. <template slot-scope="scope">
  325. <el-button size="mini" type="text" @click="handleLook(scope.row)">查看</el-button>
  326. </template>
  327. </el-table-column>
  328. </el-table>
  329. <pagination
  330. v-show="total>0"
  331. :total="total"
  332. :page.sync="queryParams.pageNum"
  333. :limit.sync="queryParams.pageSize"
  334. @pagination="getList"
  335. />
  336. <el-dialog :title="companyScheduleList.title" :visible.sync="companyScheduleList.open" width="1400px" append-to-body>
  337. <company-schedule ref="companyScheduleList" @close="closeCompanyScheduleList"></company-schedule >
  338. </el-dialog>
  339. </div>
  340. </template>
  341. <script>
  342. import { treeselect } from "@/api/company/companyDept";
  343. import Treeselect from "@riophae/vue-treeselect";
  344. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  345. import { listTcmStatisticsReport, exportStatisticsScheduleReport,listAllSchedule } from "@/api/company/scheduleReport";
  346. import { getCompanyList } from "@/api/company/company";
  347. import companySchedule from '../components/companySchedule.vue';
  348. export default {
  349. watch: {
  350. // 监听companyIdArr
  351. 'companyIdArr':'companyChange'
  352. },
  353. name: "TcmScheduleStatistics",
  354. components: { Treeselect,companySchedule },
  355. data() {
  356. return {
  357. companyScheduleList:{
  358. title:"团队档期报表",
  359. open:false,
  360. },
  361. // 遮罩层
  362. loading: true,
  363. // 选中数组
  364. ids: [],
  365. // 非单个禁用
  366. single: true,
  367. // 非多个禁用
  368. multiple: true,
  369. // 显示搜索条件
  370. showSearch: true,
  371. // 总条数
  372. total: 0,
  373. // 中医档期业绩报表表格数据
  374. tcmScheduleReportList: [],
  375. scheduleList:[],
  376. companyIdArr:[],
  377. scheduleIdArr:[],
  378. deptIds:[],
  379. // 弹出层标题
  380. title: "",
  381. // 是否显示弹出层
  382. open: false,
  383. dateRange: [],
  384. companyId:undefined,
  385. companys:[],
  386. roundArr:["一轮","二轮","三轮","四轮","五轮","六轮","七轮","八轮","九轮"],
  387. // 查询参数
  388. queryParams: {
  389. pageNum: 1,
  390. pageSize: 10,
  391. scheduleId: null,
  392. deptId:null,
  393. deptIdStr:"",
  394. userId: null,
  395. companyId: null,
  396. totalNum: null,
  397. registerNum: null,
  398. onlineNum: null,
  399. finishNum: null,
  400. registerRate: null,
  401. onlineRate: null,
  402. finishRate: null,
  403. totalMoney: null,
  404. },
  405. users:[],
  406. singleColumnArrs:[],
  407. // 部门树选项
  408. deptOptions: [],
  409. // 部门名称
  410. deptName: undefined,
  411. // 表单参数
  412. form: {},
  413. // 表单校验
  414. rules: {
  415. }
  416. };
  417. },
  418. created() {
  419. getCompanyList().then(response => {
  420. this.companys = response.data;
  421. if(this.companys!=null&&this.companys.length>0){
  422. this.companyId=this.companys[0].companyId;
  423. this.getTreeselect();
  424. }
  425. });
  426. this.getListSchedule();
  427. this.getList();
  428. },
  429. methods: {
  430. getTreeselect() {
  431. var param={companyId:this.companyId}
  432. treeselect(param).then((response) => {
  433. this.deptOptions = response.data;
  434. });
  435. },
  436. companyChange(val){
  437. var companyIdArr=this.companyIdArr;
  438. if(companyIdArr.length>0){
  439. this.companyId=companyIdArr[companyIdArr.length-1];
  440. }else{
  441. delete this.queryParams.deptId;
  442. this.companyId=this.companys[0].companyId;
  443. }
  444. this.getTreeselect();
  445. },
  446. deptSelect(node,instanceId){
  447. console.log(node, instanceId, 'deptSelect');
  448. this.deptIds.push(node.id);
  449. if(node.children){
  450. node.children.forEach(item => {
  451. console.log("qxj item:"+JSON.stringify(item));
  452. this.deptIds.push(item.id);
  453. });
  454. }
  455. this.queryParams.deptIdStr=this.deptIds.toString();
  456. //console.log('deptIdStr:'+this.queryParams.deptIdStr);
  457. this.getList();
  458. },
  459. deptCancelSelect(node,instanceId){
  460. console.log(node, instanceId, 'delete');
  461. for (let i = 0;i<this.deptIds.length;i++){
  462. if(node.id == this.deptIds[i]){
  463. this.deptIds.splice(i,1);
  464. }
  465. if(node.children){
  466. node.children.forEach(item => {
  467. if(item.id == this.deptIds[i]){
  468. var index=this.deptIds.indexOf(item.id);
  469. this.deptIds.splice(index,1);
  470. }
  471. });
  472. }
  473. }
  474. this.queryParams.deptIdStr=this.deptIds.toString();
  475. console.log('deptIdStr:'+this.queryParams.deptIdStr);
  476. this.getList();
  477. },
  478. getListSchedule() {
  479. this.loading = true;
  480. listAllSchedule().then(response => {
  481. this.scheduleList = response.rows;
  482. });
  483. },
  484. /** 查询中医档期业绩报表列表 */
  485. getList() {
  486. this.queryParams.scheduleId="";
  487. this.queryParams.companyId="";
  488. if(this.scheduleIdArr.length>0){
  489. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  490. }
  491. if(this.companyIdArr.length>0){
  492. this.queryParams.companyId=this.companyIdArr.toString();
  493. }
  494. this.loading = true;
  495. listTcmStatisticsReport(this.addDateRange(this.queryParams,this.dateRange)).then(response => {
  496. this.tcmScheduleReportList = response.rows;
  497. this.total = response.total;
  498. this.loading = false;
  499. this.calcFilterData();
  500. });
  501. },
  502. // 取消按钮
  503. cancel() {
  504. this.open = false;
  505. this.reset();
  506. },
  507. /** 搜索按钮操作 */
  508. handleQuery() {
  509. this.queryParams.pageNum = 1;
  510. this.getList();
  511. },
  512. /** 重置按钮操作 */
  513. resetQuery() {
  514. this.resetForm("queryForm");
  515. this.handleQuery();
  516. },
  517. // 多选框选中数据
  518. handleSelectionChange(selection) {
  519. this.ids = selection.map(item => item.id)
  520. this.single = selection.length!==1
  521. this.multiple = !selection.length
  522. },
  523. handleLook(row){
  524. this.companyScheduleList.open=true;
  525. var that=this;
  526. setTimeout(() => {
  527. that.$refs.companyScheduleList.getData(row);
  528. }, 200);
  529. },
  530. closeCompanyScheduleList(){
  531. this.companyScheduleList.open=false;
  532. this.getList();
  533. },
  534. /** 导出按钮操作 */
  535. handleExport() {
  536. this.queryParams.scheduleId="";
  537. this.queryParams.companyId="";
  538. if(this.scheduleIdArr.length>0){
  539. this.queryParams.scheduleId=this.scheduleIdArr.toString();
  540. }
  541. if(this.companyIdArr.length>0){
  542. this.queryParams.companyId=this.companyIdArr.toString();
  543. }
  544. this.queryParams=this.addDateRange(this.queryParams,this.dateRange);
  545. const queryParams = this.queryParams;
  546. this.$confirm('是否确认导出中医报表统计数据项?', "警告", {
  547. confirmButtonText: "确定",
  548. cancelButtonText: "取消",
  549. type: "warning"
  550. }).then(function() {
  551. return exportStatisticsScheduleReport(queryParams);
  552. }).then(response => {
  553. this.download(response.msg);
  554. }).catch(function() {});
  555. },
  556. renderLabel(index){
  557. var colls=parseInt(index/4);
  558. var cell=parseInt(index%4);
  559. var str=this.roundArr[colls];
  560. if(cell==0){
  561. str+="业绩"
  562. }
  563. else if(cell==1){
  564. str+="单数"
  565. }
  566. else if(cell==2){
  567. str+="转化率"
  568. }
  569. else if(cell==3){
  570. str+="客单"
  571. }
  572. return str;
  573. },
  574. renderLabelProp(index){
  575. var colls=parseInt(index/4)+1;
  576. var str=this.roundArr[colls];
  577. if(colls==1){
  578. str="round"+colls+"Money";
  579. }
  580. else if(colls==2){
  581. str="round"+colls+"Order";
  582. }
  583. else if(colls==3){
  584. str="round"+colls+"Rate";
  585. }
  586. else if(colls==4){
  587. str="round"+colls+"Unit";
  588. }
  589. return str;
  590. },
  591. runderValue(row,index){ //注册率=注册数/总进线 上线率=上线数/注册数 完课率=完课数/注册数 目标完成率=累计业绩/目标业绩 单线R值=累计业绩/总进线
  592. var colls=parseInt(index/4)+1;
  593. var cell=parseInt(index%4);
  594. var value=0;
  595. if(cell==0){ //业绩
  596. value=!row["round"+colls+"Money"]?0:(row["round"+colls+"Money"]).toFixed(2);
  597. }
  598. else if(cell==1){ //订单数
  599. value=row["round"+colls+"Order"];
  600. }
  601. else if(cell==2){ //转化率 =成单数/总进线
  602. value=(row["round"+colls+"Order"]/row["totalNum"]*100.0).toFixed(2)+"%";
  603. //value=(row["round"+colls+"Rate"]*100).toFixed(2)+"%";
  604. }
  605. else if(cell==3){ //客单=成交金额/成交单数
  606. var roundMoney=row["round"+colls+"Money"];
  607. var roundOrder=row["round"+colls+"Order"];
  608. if(!!roundMoney && !!roundOrder){
  609. value=(roundMoney/roundOrder*1.0).toFixed(2);
  610. }
  611. }
  612. return value;
  613. },
  614. renderTotalVal(row,index){
  615. var value=0;
  616. if(index==0){ //注册率=注册数/总进线
  617. value=(row["registerNum"]/row["totalNum"]*100.0).toFixed(3)+"%";
  618. }
  619. else if(index==1){ //上线率=上线数/注册数
  620. value=(row["onlineNum"]/row["totalNum"]*100.0).toFixed(3)+"%";
  621. }
  622. else if(index==2){ //完课率=完课数/注册数
  623. value=(row["finishNum"]/row["totalNum"]*100.0).toFixed(3)+"%";
  624. }
  625. else if(index==3){ //目标完成率=累计业绩/目标业绩
  626. if(row.targetMoney>0){
  627. value=(row.totalMoney/row.targetMoney*100.0).toFixed(3)+"%";
  628. }else{
  629. value="0%";
  630. }
  631. }
  632. else if(index==4){ //人均业绩=总业绩/接线人数
  633. value=(row["totalMoney"]/row["connectionNum"]*1.0).toFixed(3);
  634. }
  635. else if(index==5){ //单线R值=累计业绩/总进线
  636. value=(row["targetMoney"]/row["totalNum"]*1.0).toFixed(3);
  637. }
  638. else if(index==6){ //zori=总业绩/总消耗
  639. if(row.money>0){
  640. value=(row.totalMoney/row.money*1.0).toFixed(3);
  641. }else{
  642. value="0%";
  643. }
  644. }
  645. return value;
  646. },
  647. calcFilterData(){
  648. var that=this;
  649. that.singleColumnArrs=[];
  650. let arr1 = this.tcmScheduleReportList.map(item => item["companyId"]);
  651. let arrFilter=arr1.filter(function(id,index){
  652. if(arr1.indexOf(id)==index){
  653. that.singleColumnArrs.push(index);
  654. return true;
  655. }
  656. return false
  657. });
  658. },
  659. objectSpanMethod({row,column,rowIndex,columnIndex }) {
  660. //console.log("qxj singleColumnArrs:"+JSON.stringify(this.singleColumnArrs)+" rowIndex:"+rowIndex+" columnIndex:"+columnIndex);
  661. if (columnIndex === 0) {
  662. if (this.singleColumnArrs.indexOf(rowIndex)!=-1) {
  663. if(this.singleColumnArrs.length<this.tcmScheduleReportList.length){
  664. return {
  665. rowspan: 2,
  666. colspan: 1
  667. };
  668. }else{
  669. return {
  670. rowspan: 1,
  671. colspan: 1
  672. };
  673. }
  674. }
  675. else {
  676. return {
  677. rowspan: 0,
  678. colspan: 0
  679. };
  680. }
  681. }
  682. }
  683. }
  684. };
  685. </script>