You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

301 lines
8.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <section>
  3. <el-dialog fullscreen :title="dialogTitle" append-to-body modal-append-to-body width="80%" top="20px" :visible.sync="visible">
  4. <el-row :gutter="5">
  5. <el-col :span="18"> <div>
  6. <div class="main" id="iterationMenuDayAccumulate"
  7. style="width:100%;height:600px;margin:0 auto;"></div>
  8. </div>
  9. </el-col>
  10. <el-col :span="6" class="border padding">
  11. <el-form :model="filters">
  12. <el-form-item label="归属产品" >
  13. <xm-product-select v-if="!xmProductCpd || !xmProductCpd.id" ref="xmProductSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClear"></xm-product-select>
  14. <span v-else>{{xmProductCpd.id}} <span v-if="xmProductCpd.productName"><br/>{{ xmProductCpd.productName }} </span> </span>
  15. </el-form-item>
  16. <el-form-item label="归属迭代" v-if="xmIteration && xmIteration.id">
  17. <span> {{xmIteration.id}}
  18. <span v-if="xmIteration.iterationName"><br/>{{ xmIteration.iterationName }} </span>
  19. </span>
  20. </el-form-item>
  21. <el-form-item label="归属迭代" v-else-if="filters.product && filters.product.id">
  22. <xm-iteration-select ref="xmIterationSelect" :auto-select="false" :product-id="filters.product?filters.product.id:null" :link-project-id="xmProject?xmProject.id:null" placeholder="迭代" @row-click="onIterationSelected" @clear="onIterationClear"></xm-iteration-select>
  23. </el-form-item>
  24. <el-form-item label="日期区间">
  25. <br>
  26. <mdp-date-range v-model="filters" value-format="yyyy-MM-dd" start-key="startBizDate" end-key="endBizDate"></mdp-date-range>
  27. </el-form-item>
  28. <el-form-item>
  29. <el-button type="primary" icon="el-icon-search" @click="listXmIterationStateHis">查询</el-button>
  30. </el-form-item>
  31. </el-form>
  32. </el-col>
  33. </el-row>
  34. </el-dialog>
  35. </section>
  36. </template>
  37. <script>
  38. import util from '@/common/js/util';//全局公共库
  39. import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询
  40. import { mapGetters } from 'vuex'
  41. import { listXmIterationStateHis } from '@/api/xm/core/xmIterationStateHis';
  42. import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//产品选择界面
  43. import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect';//迭代选择界面
  44. export default {
  45. components: {
  46. XmIterationSelect,XmProductSelect,
  47. },
  48. props:['xmProduct','xmProject','xmIteration'],
  49. computed: {
  50. ...mapGetters([
  51. 'userInfo','roles'
  52. ]),
  53. datesCpd(){
  54. if(this.xmProductStateHiss.length==0){
  55. return []
  56. }else{
  57. return this.xmProductStateHiss.map(i=>i.bizDate)
  58. }
  59. },
  60. menuCloseCntCpd(){
  61. if(this.xmProductStateHiss.length==0){
  62. return []
  63. }else{
  64. return this.xmProductStateHiss.map(i=>i.menuCloseCnt)
  65. }
  66. },
  67. menuUnstartCntCpd(){
  68. if(this.xmProductStateHiss.length==0){
  69. return []
  70. }else{
  71. return this.xmProductStateHiss.map(i=> i.menuUnstartCnt)
  72. }
  73. },
  74. menuExecCntCpd(){
  75. if(this.xmProductStateHiss.length==0){
  76. return []
  77. }else{
  78. return this.xmProductStateHiss.map(i=> i.menuExecCnt)
  79. }
  80. },
  81. menuFinishCntCpd(){
  82. if(this.xmProductStateHiss.length==0){
  83. return []
  84. }else{
  85. return this.xmProductStateHiss.map(i=>i.menuFinishCnt)
  86. }
  87. },
  88. dialogTitle(){
  89. if(this.xmIteration && this.xmIteration.id){
  90. return (this.xmIteration?'迭代【'+this.xmIteration.iterationName+'】':'')+'需求每日累积图'
  91. }else {
  92. return (this.filters.product?'产品【'+this.filters.product.productName+'】':'')+'需求每日累积图'
  93. }
  94. },
  95. xmProductCpd(){
  96. if(this.xmIteration && this.xmIteration.id){
  97. return {id:this.xmIteration.productId,productName:this.xmIteration.productName}
  98. }
  99. if(this.xmProduct && this.xmProduct.id){
  100. return this.xmProduct
  101. }
  102. return null;
  103. }
  104. },
  105. watch: {
  106. datesCpd(){
  107. this.$nextTick(()=>{
  108. this.drawCharts();
  109. })
  110. }
  111. },
  112. data() {
  113. return {
  114. filters:{
  115. category:'',
  116. product:null,
  117. project:null,
  118. iteration:null,
  119. },
  120. dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]}
  121. load:{ list: false, edit: false, del: false, add: false },//查询中...
  122. dateRanger:[],
  123. maxTableHeight:300,
  124. visible:false,
  125. xmProductStateHiss:[],
  126. }//end return
  127. },//end data
  128. methods: {
  129. listXmIterationStateHis(){
  130. if(!this.filters.product){
  131. this.$notify({position:'bottom-left',showClose:true,message:'请先选中产品',type:'warning'})
  132. return;
  133. }
  134. if(!this.filters.iteration){
  135. this.$notify({position:'bottom-left',showClose:true,message:'请先选中迭代',type:'warning'})
  136. return;
  137. }
  138. var params={productId:this.filters.product.id,iterationId:this.filters.iteration.id,orderBy:'biz_date asc'}
  139. if(this.filters.startBizDate && this.filters.endBizDate){
  140. params.startBizDate=this.filters.startBizDate;
  141. params.endBizDate=this.filters.endBizDate;
  142. }
  143. listXmIterationStateHis(params).then(res=>{
  144. this.xmProductStateHiss=res.data.tips.isOk?res.data.data:this.xmProductStateHiss;
  145. })
  146. },
  147. open(params){
  148. this.visible=true;
  149. this.filters.product=params.xmProduct
  150. this.filters.project=params.xmProject
  151. this.filters.iteration=params.xmIteration
  152. this.xmProductStateHiss=[]
  153. if(this.$refs['xmProductSelect'])this.$refs['xmProductSelect'].clearSelect();
  154. if(this.$refs['xmIterationSelect'])this.$refs['xmIterationSelect'].clearSelect();
  155. this.$nextTick(()=>{
  156. this.listXmIterationStateHis();
  157. })
  158. },
  159. drawCharts() {
  160. this.myChart = this.$echarts.init(document.getElementById("iterationMenuDayAccumulate"));
  161. this.myChart.setOption(
  162. {
  163. title: {
  164. text: '需求累积图'
  165. },
  166. tooltip: {
  167. trigger: 'axis',
  168. axisPointer: {
  169. type: 'cross',
  170. label: {
  171. backgroundColor: '#6a7985'
  172. }
  173. }
  174. },
  175. legend: {
  176. data: ['未开始', '执行中', '已完成', '已关闭']
  177. },
  178. grid: {
  179. left: '3%',
  180. right: '4%',
  181. bottom: '3%',
  182. containLabel: true
  183. },
  184. toolbox: {
  185. feature: {
  186. saveAsImage: {}
  187. }
  188. },
  189. xAxis: {
  190. type: 'category',
  191. boundaryGap: false,
  192. data: this.datesCpd,
  193. },
  194. yAxis: {
  195. type: 'value'
  196. },
  197. series: [
  198. {
  199. name: '未开始',
  200. type: 'line',
  201. stack: 'Total',
  202. areaStyle: {},
  203. emphasis: {
  204. focus: 'series'
  205. },
  206. data: this.menuUnstartCntCpd
  207. },
  208. {
  209. name: '执行中',
  210. type: 'line',
  211. stack: 'Total',
  212. areaStyle: {},
  213. emphasis: {
  214. focus: 'series'
  215. },
  216. data: this.menuExecCntCpd,
  217. },
  218. {
  219. name: '已完成',
  220. type: 'line',
  221. stack: 'Total',
  222. areaStyle: {},
  223. emphasis: {
  224. focus: 'series'
  225. },
  226. data: this.menuFinishCntCpd,
  227. },
  228. {
  229. name: '已关闭',
  230. type: 'line',
  231. stack: 'Total',
  232. areaStyle: {},
  233. emphasis: {
  234. focus: 'series'
  235. },
  236. label: {
  237. show: true,
  238. position: 'top'
  239. },
  240. data: this.menuCloseCntCpd,
  241. }
  242. ]
  243. }
  244. )
  245. },
  246. onProductSelected(product){
  247. this.filters.product=product
  248. this.xmProductStateHiss=[];
  249. },
  250. onProductClear(){
  251. this.filters.product=null
  252. this.xmProductStateHiss=[];
  253. },
  254. onIterationSelected(iteration){
  255. this.filters.iteration=iteration
  256. this.xmProductStateHiss=[];
  257. },
  258. onIterationClear(){
  259. this.filters.iteration=null
  260. this.xmProductStateHiss=[];
  261. }
  262. },//end method
  263. mounted() {
  264. /**
  265. initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
  266. this.dicts=res.data.data;
  267. })
  268. */
  269. //this.charts();
  270. //this.drawCharts()
  271. }//end mounted
  272. }
  273. </script>
  274. <style scoped>
  275. .image {
  276. width: 100%;
  277. display: block;
  278. }
  279. </style>