points.vue 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124
  1. <template>
  2. <basic-container>
  3. <div class="tabStyle" v-loading="pageLoading">
  4. <avue-crud
  5. :data="tableData"
  6. :option="option"
  7. :page.sync="page"
  8. :table-loading="tableLoading"
  9. @on-load="getList"
  10. @size-change="sizeChange"
  11. @current-change="currentChange"
  12. @search-change="searchVal"
  13. @search-reset="searchReset"
  14. >
  15. <!-- 左侧操作菜单 -->
  16. <template slot="menuLeft">
  17. <el-button v-if="addShowFlag" type="primary" icon="el-icon-plus" size="small" @click.stop="addBtn()">新增 </el-button>
  18. <el-button type="primary" size="small" @click="exportBtnFn">导 出</el-button>
  19. <el-button v-if="importShowFlag" type="primary" size="small" @click="importBtn">导 入</el-button>
  20. </template>
  21. <!-- 分配日期搜索 -->
  22. <template slot="allocationDateSearch">
  23. <el-date-picker
  24. v-model="dateTime"
  25. type="daterange"
  26. range-separator="至"
  27. start-placeholder="开始日期"
  28. end-placeholder="结束日期"
  29. value-format="yyyy-MM-dd"
  30. @change="startDateBtn"
  31. >
  32. </el-date-picker>
  33. </template>
  34. <!-- 操作菜单 -->
  35. <template slot="menu" slot-scope="scope">
  36. <template v-if="showRestart(scope.row)">
  37. <el-button type="text" size="small" icon="el-icon-view" @click="restartFn(scope.row, scope.index)">重启 </el-button>
  38. </template>
  39. <template v-else>
  40. <el-button type="text" size="small" icon="el-icon-view" @click="viewBtn(scope.row, scope.index)">查看 </el-button>
  41. <el-button
  42. v-if="addShowFlag"
  43. type="text"
  44. size="small"
  45. icon="el-icon-setting"
  46. @click="updateBtn(scope.row, scope.index)"
  47. :disabled="scope.row.packageFinishStatus === '2' || scope.row.packageFinishStatus === '1'"
  48. >编辑
  49. </el-button>
  50. <el-button type="text" v-if="false" size="small" icon="el-icon-close" @click="suspendBtn(scope.row, scope.index)">
  51. 终止
  52. </el-button>
  53. <!-- <el-button
  54. type="text"
  55. size="small"
  56. icon="el-icon-document"
  57. @click="taskStatisticsFn(scope.row, scope.index)"
  58. >
  59. 服务统计
  60. </el-button> -->
  61. <el-button type="text" size="small" icon="el-icon-folder-checked" :disabled="scope.row.ysh == 0 || scope.row.ysh == null" @click="exportBtn(scope.row, scope.index)">
  62. 导出
  63. <!-- 合同下载 -->
  64. </el-button>
  65. <!-- :disabled="scope.row.ysh == 0 || scope.row.ysh == null" -->
  66. <el-button v-if="scope.row.contract" type="text" size="small" icon="el-icon-folder-checked" @click="exportFile(scope.row, scope.index)">
  67. 合同下载
  68. </el-button>
  69. </template>
  70. </template>
  71. </avue-crud>
  72. <!-- 新增 -->
  73. <el-dialog :title="showTitle" :visible.sync="showDig" center width="80%" :before-close="handleClose">
  74. <el-form v-if="showDig" :model="distributionForm" :disabled="allNot" :rules="rules" ref="distributionForm" label-width="140px" class="demo-ruleForm">
  75. <el-row>
  76. <el-col :span="12">
  77. <el-form-item label="执行包名称" prop="scorePackageName">
  78. <el-input v-model="distributionForm.scorePackageName"></el-input>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="12">
  82. <el-form-item label="所属月份" prop="belongDate">
  83. <el-date-picker disabled v-model="distributionForm.belongDate" type="month" placeholder="选择日期" format="yyyy-MM" value-format="yyyy-MM" style="width: 100%">
  84. </el-date-picker>
  85. </el-form-item>
  86. </el-col>
  87. </el-row>
  88. <el-row>
  89. <el-col :span="12">
  90. <el-form-item label="关联服务企业" prop="relatedService">
  91. <el-select
  92. v-model="distributionForm.relatedService"
  93. placeholder="请选择"
  94. @change="RelatedServiceChange"
  95. style="width: 100%"
  96. :disabled="relatedAble || editDisabled"
  97. >
  98. <el-option v-for="item in fwqyOptions" :key="item.deptId" :label="item.name" :value="item.deptId"> </el-option>
  99. </el-select>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="12">
  103. <el-form-item label="关联执行包名称" prop="relationScoreId">
  104. <el-select
  105. v-model="distributionForm.relationScoreId"
  106. placeholder="请选择"
  107. @change="scoreNameChange"
  108. style="width: 100%"
  109. v-bind:disabled="scoreAble || editDisabled"
  110. >
  111. <el-option v-for="item in gljfbOptions" :key="item.id" :label="item.relationScoreName" :value="item.id"> </el-option>
  112. </el-select>
  113. </el-form-item>
  114. </el-col>
  115. </el-row>
  116. <el-row>
  117. <el-col :span="12">
  118. <el-form-item label="服务目标" prop="planId">
  119. <el-select v-model="distributionForm.planId" style="width: 100%" @change="planIdChange" :disabled="planIdDisabled">
  120. <el-option v-for="item in planList" :key="item.planId" :label="item.planName" :value="item.planId"> </el-option>
  121. </el-select>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="12">
  125. <el-form-item label="承接对象" prop="acceptSug">
  126. <el-select v-model="distributionForm.acceptSug" placeholder="请选择" style="width: 100%" disabled>
  127. <el-option v-for="item in jbdxOptions" :key="item.id" disabled :label="item.gsmc" :value="item.id"> </el-option>
  128. </el-select>
  129. </el-form-item>
  130. </el-col>
  131. </el-row>
  132. <el-row>
  133. <el-col :span="12">
  134. <el-form-item label="生效日期" prop="startTime">
  135. <el-date-picker
  136. disabled
  137. class="w100"
  138. v-model="distributionForm.startTime"
  139. format="yyyy-MM-dd"
  140. value-format="yyyy-MM-dd"
  141. type="date"
  142. @input="$forceUpdate()"
  143. placeholder="选择日期"
  144. >
  145. </el-date-picker>
  146. </el-form-item>
  147. </el-col>
  148. <el-col :span="12">
  149. <el-form-item label="截止日期" prop="endTimeValue">
  150. <el-date-picker
  151. disabled
  152. class="w100"
  153. v-model="distributionForm.endTimeValue"
  154. format="yyyy-MM-dd"
  155. value-format="yyyy-MM-dd"
  156. type="date"
  157. @input="$forceUpdate()"
  158. placeholder="选择日期"
  159. >
  160. </el-date-picker>
  161. </el-form-item>
  162. </el-col>
  163. </el-row>
  164. <el-row>
  165. <el-col :span="12">
  166. <el-form-item label="可分配积分值" prop="kfpjfz">
  167. <el-input v-model="kfpjfz" :disabled="kfpjfVal"></el-input>
  168. </el-form-item>
  169. </el-col>
  170. <el-col :span="12">
  171. <el-form-item label="执行包总值" prop="score">
  172. <el-input disabled v-model="distributionForm.score"></el-input>
  173. </el-form-item>
  174. </el-col>
  175. </el-row>
  176. <el-row>
  177. <el-col :span="12">
  178. <el-form-item label="推广产品" prop="drugtable">
  179. <el-select v-model="distributionForm.drugtable" placeholder="默认全选" style="width: 100%" disabled multiple>
  180. <el-option v-for="(item, index) in drugList" :key="index" :label="item.drug_name" :value="item.drug_id"> </el-option>
  181. </el-select>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="12">
  185. <el-form-item label="服务区域" prop="provAbbr" v-if="IS_DLS">
  186. <el-select v-model="distributionForm.provAbbr" placeholder="请选择服务区域" style="width: 100%" :disabled="!distributionForm.acceptSug">
  187. <el-option v-for="(item, index) in provAbbrList" :key="index" :label="item" :value="item"></el-option>
  188. </el-select>
  189. </el-form-item>
  190. </el-col>
  191. <!-- <el-col :span="12">
  192. <el-form-item label="B端服务上限(%)" prop="entTaskLimit">
  193. <el-input-number
  194. disabled
  195. v-model="distributionForm.entTaskLimit"
  196. controls-position="right"
  197. :min="0"
  198. :max="100"
  199. class="input-num-box w100"
  200. />
  201. </el-form-item>
  202. </el-col> -->
  203. <el-col :span="12">
  204. <el-form-item label="测试试卷" v-if="false">
  205. <el-select v-model="distributionForm.quizIds" placeholder="选择试卷,支持多选" style="width: 100%" multiple>
  206. <el-option v-for="item in quizList" :key="item.quizId" :label="item.title" :value="item.quizId"> </el-option>
  207. </el-select>
  208. </el-form-item>
  209. </el-col>
  210. </el-row>
  211. <el-row v-if="false">
  212. <el-col :span="12">
  213. <el-form-item label="审核管理费比例(%)" prop="auditManagementFeeRates">
  214. <el-input-number v-model="distributionForm.auditManagementFeeRates" controls-position="right" :min="0" :max="100" class="input-num-box w100" />
  215. </el-form-item>
  216. </el-col>
  217. </el-row>
  218. <el-row v-if="!IS_DLS">
  219. <el-col :span="24">
  220. <el-form-item label="有效服务类型" required>
  221. <div>
  222. <div class="treeBox">
  223. <el-tree
  224. disabled
  225. ref="tree1"
  226. :data="tree1"
  227. :filter-node-method="filterNode"
  228. :default-checked-keys="checkedDsScope"
  229. show-checkbox
  230. node-key="taskTypeId"
  231. :props="defaultProps"
  232. @check-change="getNodeData"
  233. >
  234. </el-tree>
  235. </div>
  236. <div class="treeBox">
  237. <el-tree
  238. disabled
  239. ref="tree2"
  240. :data="tree2"
  241. :filter-node-method="filterNode"
  242. :default-checked-keys="checkedDsScope"
  243. show-checkbox
  244. node-key="taskTypeId"
  245. :props="defaultProps"
  246. @check-change="getNodeData"
  247. >
  248. </el-tree>
  249. </div>
  250. <div class="treeBox treeBox3">
  251. <el-tree
  252. disabled
  253. ref="tree3"
  254. :data="tree3"
  255. :filter-node-method="filterNode"
  256. :default-checked-keys="checkedDsScope"
  257. show-checkbox
  258. node-key="taskTypeId"
  259. :props="defaultProps"
  260. @check-change="getNodeData"
  261. >
  262. </el-tree>
  263. </div>
  264. </div>
  265. </el-form-item>
  266. </el-col>
  267. </el-row>
  268. <el-row v-else>
  269. <el-col :span="24">
  270. <el-form-item label="有效服务类型" required>
  271. <dismantleTable ref="dismantleTableRef" :propsTableData="planItem" />
  272. </el-form-item>
  273. </el-col>
  274. </el-row>
  275. <el-row>
  276. <el-col :span="24">
  277. <el-form-item label="描述">
  278. <el-input type="textarea" :rows="3" v-model="distributionForm.description"></el-input>
  279. </el-form-item>
  280. </el-col>
  281. </el-row>
  282. </el-form>
  283. <span slot="footer" class="dialog-footer">
  284. <el-button @click="handleClose('form')">取 消</el-button>
  285. <el-button type="primary" @click="submitForm('distributionForm')" :loading="buttonLoading" v-show="addShow">确 定</el-button>
  286. </span>
  287. </el-dialog>
  288. <el-dialog title="导出" :visible.sync="exportDig" width="40%" center>
  289. <!-- 第一次导出 -->
  290. <template>
  291. <div class="down-item">
  292. <div class="btn">
  293. <span>word格式:</span>
  294. <template v-if="checkRow && checkRow.reportOpt.status === 'NOT_GENERATE'">
  295. <el-button class="first" @click="taskExport('word')" :loading="wordLoading">生成报告</el-button>
  296. </template>
  297. <template v-else-if="checkRow && checkRow.reportOpt.status === 'GENERATING'">
  298. <el-button class="first" :loading="true">报告生成中...</el-button>
  299. </template>
  300. <template v-else-if="checkRow && (checkRow.reportOpt.status === 'GENERATED' || checkRow.reportOpt.status === 'ERROR')">
  301. <el-button @click="taskExport('word')">重新导出</el-button>
  302. <el-button @click="downloadTask('word')" v-if="checkRow.reportOpt.status === 'GENERATED'">下载报告</el-button>
  303. <el-button disabled :title="checkRow.reportOpt.errorMsg" v-else-if="checkRow.reportOpt.status === 'ERROR'">导出失败</el-button>
  304. </template>
  305. </div>
  306. <div class="title-msg">
  307. <p v-if="checkRow && checkRow.reportOpt.status === 'GENERATED'">下载截止日期:{{ checkRow.reportOpt.ttl }}</p>
  308. <p v-if="checkRow && checkRow.reportOpt.status === 'ERROR'">本次导出失败:{{ checkRow.reportOpt.errorMsg }}</p>
  309. </div>
  310. </div>
  311. <div class="down-item">
  312. <div class="btn">
  313. <span>excel格式:</span>
  314. <template v-if="checkRow && checkRow.excelReportOpt.status === 'NOT_GENERATE'">
  315. <el-button class="first" @click="taskExport('excel')" :loading="excelLoading">生成报告</el-button>
  316. </template>
  317. <template v-if="checkRow && checkRow.excelReportOpt.status === 'GENERATING'">
  318. <el-button class="first" :loading="true">报告生成中...</el-button>
  319. </template>
  320. <template v-else-if="checkRow && (checkRow.excelReportOpt.status === 'GENERATED' || checkRow.excelReportOpt.status === 'ERROR')">
  321. <el-button @click="taskExport('excel')">重新导出</el-button>
  322. <el-button @click="downloadTask('excel')" v-if="checkRow.excelReportOpt.status === 'GENERATED'">下载报告</el-button>
  323. <el-button disabled :title="checkRow.excelReportOpt.errorMsg" v-else-if="checkRow.excelReportOpt.status === 'ERROR'">导出失败</el-button>
  324. </template>
  325. </div>
  326. <div class="title-msg">
  327. <p v-if="checkRow && checkRow.excelReportOpt.status === 'GENERATED'">下载截止日期:{{ checkRow.excelReportOpt.ttl }}</p>
  328. <p v-if="checkRow && checkRow.excelReportOpt.status === 'ERROR'">本次导出失败:{{ checkRow.excelReportOpt.errorMsg }}</p>
  329. </div>
  330. </div>
  331. </template>
  332. <el-divider></el-divider>
  333. <!-- 新版导出 -->
  334. <template>
  335. <div class="down-item">
  336. <div class="btn">
  337. <span>word格式(新版):</span>
  338. <template v-if="checkRow && checkRow.newReportOpt.status === 'NOT_GENERATE'">
  339. <el-button class="first" @click="taskNewExport('word')" :loading="newWordLoading">生成报告</el-button>
  340. </template>
  341. <template v-else-if="checkRow && checkRow.newReportOpt.status === 'GENERATING'">
  342. <el-button class="first" :loading="true">报告生成中...</el-button>
  343. </template>
  344. <template v-else-if="checkRow && (checkRow.newReportOpt.status === 'GENERATED' || checkRow.newReportOpt.status === 'ERROR')">
  345. <el-button @click="taskNewExport('word')">重新导出</el-button>
  346. <el-button @click="downloadNewTask('word')" v-if="checkRow.newReportOpt.status === 'GENERATED'">下载报告</el-button>
  347. <el-button disabled :title="checkRow.newReportOpt.errorMsg" v-else-if="checkRow.newReportOpt.status === 'ERROR'">导出失败</el-button>
  348. </template>
  349. </div>
  350. <div class="title-msg">
  351. <p v-if="checkRow && checkRow.newReportOpt.status === 'GENERATED'">下载截止日期:{{ checkRow.newReportOpt.ttl }}</p>
  352. <p v-if="checkRow && checkRow.newReportOpt.status === 'ERROR'">本次导出失败:{{ checkRow.newReportOpt.errorMsg }}</p>
  353. </div>
  354. </div>
  355. <div class="down-item">
  356. <div class="btn">
  357. <span>excel格式(新版):</span>
  358. <template v-if="checkRow && checkRow.newExcelReportOpt.status === 'NOT_GENERATE'">
  359. <el-button class="first" @click="taskNewExport('excel')" :loading="newExcelLoading">生成报告</el-button>
  360. </template>
  361. <template v-if="checkRow && checkRow.newExcelReportOpt.status === 'GENERATING'">
  362. <el-button class="first" :loading="true">报告生成中...</el-button>
  363. </template>
  364. <template v-else-if="checkRow && (checkRow.newExcelReportOpt.status === 'GENERATED' || checkRow.newExcelReportOpt.status === 'ERROR')">
  365. <el-button @click="taskNewExport('excel')">重新导出</el-button>
  366. <el-button @click="downloadNewTask('excel')" v-if="checkRow.newExcelReportOpt.status === 'GENERATED'">下载报告</el-button>
  367. <el-button disabled :title="checkRow.newExcelReportOpt.errorMsg" v-else-if="checkRow.newExcelReportOpt.status === 'ERROR'">导出失败</el-button>
  368. </template>
  369. </div>
  370. <div class="title-msg">
  371. <p v-if="checkRow && checkRow.newExcelReportOpt.status === 'GENERATED'">下载截止日期:{{ checkRow.newExcelReportOpt.ttl }}</p>
  372. <p v-if="checkRow && checkRow.newExcelReportOpt.status === 'ERROR'">本次导出失败:{{ checkRow.newExcelReportOpt.errorMsg }}</p>
  373. </div>
  374. </div>
  375. </template>
  376. <span slot="footer" class="dialog-footer">
  377. 注意: 1.报告将于24小时之内生成完毕,请注意下载。<br />
  378. <i style="margin-left:62px"></i>2.报告汇总为封面+任务数据汇总+任务列表明细。
  379. <br />
  380. <i style="margin-left:10px"></i>3.报告详情为每条任务的任务详情+图片。
  381. </span>
  382. </el-dialog>
  383. <!-- 终止任务 -->
  384. <el-dialog title="终止任务" :visible.sync="enableFlagDig" width="50%" center>
  385. <el-form :model="enableForm" :rules="enableRule" ref="enableForm" label-width="150px" class="demo-ruleForm">
  386. <el-row v-if="!isShengyu">
  387. <el-col :span="24">
  388. <el-form-item label="请选择积分收回方式" prop="enableFlag">
  389. <el-radio-group v-model="enableForm.enableFlag">
  390. <el-radio label="1">全部收回</el-radio>
  391. <el-radio label="2">剩余收回</el-radio>
  392. </el-radio-group>
  393. </el-form-item>
  394. </el-col>
  395. </el-row>
  396. <p class="tc" v-if="suspendData.stopStatus === 'NOTHING' && isShengyu" style="color: red;">
  397. 由于({{ suspendData.score - suspendData.kfpjf }})积分已被下级分派,您将回收({{ suspendData.kfpjf }})积分,是否继续?
  398. </p>
  399. </el-form>
  400. <span slot="footer" class="dialog-footer">
  401. <el-button @click="stopcancelBtn()">取 消</el-button>
  402. <el-button type="primary" @click="enableFlagBtn('enableForm')">确 定</el-button>
  403. </span>
  404. </el-dialog>
  405. </div>
  406. <!-- 任务审核 -->
  407. <taskStatistics :taskStatisticsShow.sync="taskStatisticsShow" :currentId.sync="currentId" />
  408. <!-- 重启积分包 -->
  409. <el-dialog title="重启积分包" :visible.sync="restartVisible" center width="45%" :before-close="restartVisibleClose">
  410. <el-form :model="restartForm" :rules="restartFormRef" ref="restartForm">
  411. <el-form-item label="截止日期" prop="endTimeValue">
  412. <el-date-picker style="width:500px" v-model="restartForm.endTimeValue" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"> </el-date-picker>
  413. </el-form-item>
  414. </el-form>
  415. <span slot="footer" class="dialog-footer">
  416. <el-button @click="restartVisible = false">取 消</el-button>
  417. <el-button type="primary" @click="restartSubmit">确 定</el-button>
  418. </span>
  419. </el-dialog>
  420. <!-- 批量上传 -->
  421. <el-dialog title="批量导入" :visible.sync="importDialogVisible" width="60%" :before-close="importClose" center>
  422. <div class="import-content" v-loading="importLoading">
  423. <el-upload
  424. :action="uploadUrl"
  425. :headers="headers"
  426. :before-upload="beforeFileUpload"
  427. :limit="1"
  428. :on-remove="handleRemove"
  429. :on-exceed="handleExceed"
  430. :on-error="handleError"
  431. accept=".xls,.xlsx"
  432. :show-file-list="false"
  433. :on-success="handleSuccess"
  434. :file-list="fileList"
  435. >
  436. <el-button size="small" type="primary">导入执行包(*.xlsx,*.xls)</el-button>
  437. </el-upload>
  438. <el-button type="text" @click="dowmTemplateFn">下载模板</el-button>
  439. </div>
  440. <span slot="footer" class="dialog-footer">
  441. <el-button @click="importDialogVisible = false">取 消</el-button>
  442. </span>
  443. </el-dialog>
  444. <!-- 导入存在失败 -->
  445. <el-dialog title="上传失败" width="60%" :close-on-click-modal="false" @close="importErrorDialogShow = false" :visible.sync="importErrorDialogShow" center>
  446. <div>
  447. <el-table :data="importErrorTableData" border style="width: 100%">
  448. <el-table-column prop="idx" label="行号" width="180" />
  449. <el-table-column prop="errorMsg" label="错误信息" />
  450. </el-table>
  451. </div>
  452. <span slot="footer" class="dialog-footer">
  453. <el-button @click="importErrorDialogShow = false">关 闭</el-button>
  454. </span>
  455. </el-dialog>
  456. </basic-container>
  457. </template>
  458. <script>
  459. import dismantleTable from './components/dismantleTable.vue';
  460. import {templateDownload} from '@/api/assignPoints/currency/manList';
  461. import {pointsData} from '@/const/crud/points';
  462. import {tree1, tree2, tree3, tree7, pFlist} from '@/const/crud/taskTypeTree/index';
  463. import store from '@/store';
  464. import {
  465. selectWmScorePackageLists,
  466. saves,
  467. updateByIds,
  468. updateStatusByIds,
  469. stopWmScorePackage,
  470. lists,
  471. selectKfpjf,
  472. selectWmScorePackage,
  473. listCso, // 展示关联积分包
  474. remote,
  475. scoreTasktype,
  476. showTask,
  477. listCsoById,
  478. selectRelationScoreId,
  479. getTaskTree,
  480. taskExportNbqybg,
  481. taskExportExcelNbqybg,
  482. taskNewExportNbqybg,
  483. taskExportNewExcelNbqybg,
  484. settleSave,
  485. getSysFileApi,
  486. getListAncestorApi,
  487. pkgInfoExportApi
  488. } from '@/api/taskManagement/points.js';
  489. import {getDrugProducerList, getListDrugApi, getTaskTypeTree, updateEnable, exportInfoApi, restartApi} from '@/api/assignPoints/currency/index';
  490. // import Form from "../../gen/form.vue";
  491. import {mapGetters} from 'vuex';
  492. import {getAvailQuizList} from '@/api/test';
  493. import {getPlanListApi} from '@/api/wmdeptbudget/plan.js';
  494. import taskStatistics from './components/taskStatistics.vue';
  495. export default {
  496. name: 'points',
  497. data() {
  498. return {
  499. pageLoading: false,
  500. addShowFlag: true,
  501. importShowFlag: false,
  502. IS_DLS: false,
  503. planItem: [],
  504. currentSelect: null,
  505. taskStatisticsShow: false,
  506. planIdDisabled: true,
  507. currentId: '',
  508. loadingTxt: '......',
  509. taskExportLoading: false,
  510. wordLoading: false,
  511. excelLoading: false,
  512. newWordLoading: false,
  513. newExcelLoading: false,
  514. exportDig: false,
  515. checkRow: '', // 导出选中值
  516. buttonLoading: false,
  517. tree1: tree1,
  518. tree2: tree2,
  519. tree3: tree3,
  520. tree7: tree7,
  521. checkedDsScope: [],
  522. listQuerys: {
  523. taskTypeName: undefined
  524. },
  525. TreeData: [],
  526. defaultProps: {
  527. children: 'children',
  528. label: 'taskTypeName',
  529. disabled: this.disabledFn
  530. },
  531. getNodeVal: [],
  532. //承接对象
  533. isAble: false,
  534. //关联积分包
  535. scoreAble: false,
  536. relatedAble: false,
  537. kfpjfVal: true,
  538. kfpjfz: '',
  539. relationScoreId: '',
  540. belongDate: '',
  541. showTitle: '',
  542. showDig: false,
  543. allNot: false,
  544. addShow: false,
  545. drugList: [],
  546. provAbbrList: [],
  547. editDisabled: false,
  548. distributionForm: {
  549. provAbbr: '',
  550. scorePackageName: '',
  551. score: '',
  552. relatedService: '',
  553. relationScoreId: '',
  554. description: '',
  555. acceptSug: '',
  556. packageFinishStatus: '',
  557. belongDate: '',
  558. drugtable: [],
  559. startTime: '',
  560. endTimeValue: '',
  561. quizIds: [],
  562. planId: ''
  563. },
  564. pickerOptions: {
  565. disabledDate(time) {
  566. // 禁用当前日期之前
  567. const currentDate = new Date();
  568. return time.getTime() < currentDate.getTime();
  569. }
  570. },
  571. rules: {
  572. scorePackageName: [{required: true, message: '请输入执行包名称', trigger: 'blur'}],
  573. acceptSug: [{required: true, message: '请选择承接对象', trigger: 'blur'}],
  574. provAbbr: [{required: true, message: '请选择服务区域', trigger: 'blur'}],
  575. relationScoreId: [
  576. {
  577. required: true,
  578. message: '请选择关联执行包名称',
  579. trigger: 'change'
  580. }
  581. ],
  582. score: [{required: true, message: '请输入执行包总值', trigger: 'blur'}, {pattern: /^[0-9]*$/, message: '请输入正确的执行包总值'}],
  583. planId: [{required: true, message: '请选择服务目标', trigger: 'change'}],
  584. packageType1: [
  585. {
  586. required: true,
  587. message: '请选择积分包任务类型',
  588. trigger: 'change'
  589. }
  590. ],
  591. wmScoreTaskTypeList: [
  592. {
  593. required: true,
  594. message: '请选择有效服务类型',
  595. trigger: 'blur'
  596. }
  597. ],
  598. relatedService: [{required: true, message: '请选择关联服务企业', trigger: 'blur'}],
  599. belongDate: [{required: true, message: '请选择所属月份', trugger: 'blur'}],
  600. startTime: [
  601. {
  602. required: true,
  603. message: '请选择日期',
  604. trigger: 'blur'
  605. }
  606. ],
  607. endTimeValue: [
  608. {
  609. required: true,
  610. message: '请选择日期',
  611. trigger: 'blur'
  612. }
  613. ]
  614. },
  615. restartVisible: false,
  616. currentRow: {},
  617. restartForm: {
  618. endTimeValue: ''
  619. },
  620. restartFormRef: {
  621. endTimeValue: [
  622. {
  623. required: true,
  624. message: '请选择日期',
  625. trigger: 'blur'
  626. }
  627. ]
  628. },
  629. socreYjwc: 0,
  630. socreShtg: 0,
  631. socreShtgRate: 0,
  632. scorePay: 0,
  633. tableData: [],
  634. option: pointsData,
  635. page: {
  636. total: 0, // 总页数
  637. currentPage: 1, // 当前页数
  638. pageSize: 10 // 每页显示多少条
  639. },
  640. tableLoading: false,
  641. searchForm: {},
  642. gljfbOptions: [
  643. {
  644. relationScoreName: '无',
  645. id: '-1'
  646. }
  647. ],
  648. jbdxOptions: [],
  649. fwqyOptions: [],
  650. scoreIdVal: '',
  651. relatedServiceVal: '',
  652. idVal: '',
  653. packageIsConductVal: '',
  654. packageType1: [],
  655. dateOptions: [],
  656. checkedId: '',
  657. relationScoreIdVal: '',
  658. validShow: true,
  659. wmScoreTaskTypeListVal: [],
  660. taskTypeList1val: [],
  661. typeList: false,
  662. packsgeType: false,
  663. returnVal: [],
  664. oldStars: [],
  665. packsgeTypedifference: true,
  666. packageType1Val: '',
  667. lookValue: '',
  668. dialogType: 'add',
  669. dateTime: '', // 查询时间
  670. allocationDate: '', // 开始时间
  671. endLabelDate: '', // 结束时间
  672. id: '',
  673. drugProducerList: [],
  674. drugProducerListCopy: [],
  675. settleTableVisible: false,
  676. form: {},
  677. gridData: [],
  678. settleButtonShow: false,
  679. textareaDisabled: false,
  680. suspendData: {},
  681. enableFlagDig: false,
  682. enableForm: {},
  683. enableRule: {
  684. enableFlag: [{required: true, message: '请选择积分回收方式', trigger: 'change'}]
  685. },
  686. isShengyu: false, // 是否剩余
  687. quizList: [], // 测试试卷列表
  688. planList: [],
  689. importDialogVisible: false,
  690. importLoading: false,
  691. uploadUrl: '/admin/wmscorepackage/batch/create',
  692. headers: {
  693. Authorization: 'Bearer ' + store.getters.access_token
  694. },
  695. importErrorDialogShow: false,
  696. importErrorTableData: [],
  697. fileList: [],
  698. fileTypeLimit: [
  699. // excel
  700. 'application/vnd.ms-excel',
  701. 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  702. ] // 支持上传的文件类型
  703. };
  704. },
  705. components: {taskStatistics, dismantleTable},
  706. mounted() {
  707. if (this.userInfo.roles.includes(39)) {
  708. this.addShowFlag = false;
  709. }
  710. if (this.userInfo.roles.includes(3)) {
  711. this.planIdDisabled = false;
  712. }
  713. if (this.userInfo.roles.includes(4)) {
  714. this.IS_DLS = true;
  715. }
  716. // const oneYearLater = new Date();
  717. // oneYearLater.setFullYear(oneYearLater.getFullYear() + 1);
  718. // // 获取一年后日期的时间戳
  719. // this.distributionForm.endTimeValue = oneYearLater.getTime();
  720. this.loading();
  721. // this.acceptSugChoose();
  722. // this.scoreNameChoose();
  723. // this.getTaskTree();
  724. // this.showRemote(); // 积分包任务类型展示
  725. // this.showTaskType(); // 有效服务类型展示
  726. // this.showRelatedService(); // 关联服务企业
  727. this.getDrugProducerList(); // 推广产品企业
  728. this.getAvailQuizListFn();
  729. this.getListDrug();
  730. },
  731. computed: {
  732. ...mapGetters(['website', 'keyCollapse', 'userInfo'])
  733. },
  734. methods: {
  735. importBtn() {
  736. this.importDialogVisible = true;
  737. },
  738. async exportBtnFn() {
  739. this.pageLoading = true;
  740. const res = await pkgInfoExportApi();
  741. try {
  742. let url = window.URL.createObjectURL(new Blob([res.data]));
  743. let link = document.createElement('a');
  744. link.style.display = 'none';
  745. link.href = url;
  746. link.setAttribute('download', '执行包信息.xlsx');
  747. document.body.appendChild(link);
  748. link.click();
  749. document.body.removeChild(link);
  750. this.pageLoading = false;
  751. } catch (err) {
  752. this.pageLoading = false;
  753. }
  754. },
  755. importClose() {
  756. this.fileList = [];
  757. this.importDialogVisible = false;
  758. },
  759. dowmTemplateFn() {
  760. this.importLoading = true;
  761. templateDownload({
  762. fileName: 'ent_pkg_batch_create_tmpl.xlsx'
  763. })
  764. .then(response => {
  765. this.importLoading = false;
  766. let url = window.URL.createObjectURL(new Blob([response.data]));
  767. let link = document.createElement('a');
  768. link.style.display = 'none';
  769. link.href = url;
  770. link.setAttribute('download', '批量导入执行包模板.xlsx');
  771. document.body.appendChild(link);
  772. link.click();
  773. document.body.removeChild(link);
  774. })
  775. .catch(() => {
  776. this.importLoading = false;
  777. });
  778. },
  779. beforeFileUpload(file) {
  780. this.importLoading = true;
  781. if (!this.fileTypeLimit.includes(file.type)) {
  782. this.$message.warning('不支持的文件格式');
  783. return false;
  784. }
  785. },
  786. handleExceed(files, fileList) {
  787. this.$message.warning('最多上传一个文件');
  788. },
  789. handleError(err) {
  790. this.$message.error('上传失败!');
  791. this.importLoading = false;
  792. },
  793. importClose() {
  794. this.fileList = [];
  795. this.importDialogVisible = false;
  796. },
  797. handleRemove(file, fileList) {},
  798. handleSuccess(res, file, fileList) {
  799. this.fileList = [];
  800. this.importLoading = false;
  801. if (res.code == 0) {
  802. if (res.data.length == 0) {
  803. this.$message.success('上传成功!');
  804. this.importClose();
  805. this.getList(this.page);
  806. } else {
  807. this.importErrorTableData = res.data;
  808. this.importErrorDialogShow = true;
  809. }
  810. }
  811. },
  812. async getPlanList(pkgId, planId) {
  813. const res = await getPlanListApi('QRT', pkgId);
  814. this.planList = res.data.data;
  815. this.planList.forEach(item => {
  816. item.planName = item.planName + `(${item.planIssue} ~ ${item.planExpiry})`;
  817. });
  818. // 编辑
  819. if (this.dialogType == 'edit') {
  820. this.planIdChange(planId);
  821. }
  822. },
  823. // 任务统计
  824. taskStatisticsFn(row) {
  825. this.taskStatisticsShow = true;
  826. this.currentId = row.id;
  827. },
  828. // 获取产品
  829. async getListDrug() {
  830. const res = await getListDrugApi();
  831. // this.drugList = res.data.data;
  832. },
  833. // 获取可用的试卷
  834. async getAvailQuizListFn() {
  835. const res = await getAvailQuizList();
  836. if (res.data.code === 0) {
  837. this.quizList = res.data.data || [];
  838. }
  839. },
  840. loading() {
  841. setInterval(() => {
  842. if (this.loadingTxt.length == 6) {
  843. this.loadingTxt = '.';
  844. }
  845. if (this.loadingTxt.length < 6) {
  846. this.loadingTxt += '.';
  847. }
  848. }, 300);
  849. },
  850. // 推广产品企业
  851. getDrugProducerList() {
  852. getDrugProducerList({deptId: this.$store.getters.userInfo.deptId}).then(res => {
  853. this.drugProducerListCopy = res.data.data;
  854. });
  855. },
  856. gettreenode() {
  857. //获取选中属性节点
  858. console.log(this.$refs.tree.getCheckedKeys());
  859. },
  860. async taskExport(type) {
  861. let row = this.checkRow;
  862. var obj = {
  863. id: row.id
  864. };
  865. let res;
  866. if (type === 'word') {
  867. this.wordLoading = true;
  868. res = await taskExportNbqybg(obj);
  869. } else if (type === 'excel') {
  870. this.excelLoading = true;
  871. res = await taskExportExcelNbqybg(obj);
  872. }
  873. if (res.data) {
  874. this.$message.success(res.data.data);
  875. this.exportDig = false;
  876. this.getList(this.page);
  877. this.wordLoading = false;
  878. this.excelLoading = false;
  879. } else {
  880. this.$message.error('导出失败');
  881. }
  882. },
  883. async taskNewExport(type) {
  884. try {
  885. let row = this.checkRow;
  886. var obj = {
  887. id: row.id
  888. };
  889. let res;
  890. if (type === 'word') {
  891. this.newWordLoading = true;
  892. res = await taskNewExportNbqybg(obj);
  893. } else if (type === 'excel') {
  894. this.newExcelLoading = true;
  895. res = await taskExportNewExcelNbqybg(obj);
  896. }
  897. if (res.data) {
  898. this.$message.success(res.data.data);
  899. this.exportDig = false;
  900. this.getList(this.page);
  901. } else {
  902. this.$message.error('导出失败');
  903. }
  904. this.newWordLoading = false;
  905. this.newExcelLoading = false;
  906. } catch (err) {
  907. this.newWordLoading = false;
  908. this.newExcelLoading = false;
  909. }
  910. },
  911. // 导出按钮
  912. exportBtn(row) {
  913. this.exportDig = true;
  914. this.checkRow = row;
  915. },
  916. // 报告下载
  917. async exportFile(row) {
  918. var timestamp = Date.parse(new Date());
  919. let filename = `市场服务包合同${timestamp}.pdf`;
  920. const res = await getSysFileApi(row.contract.fileId);
  921. let url = window.URL.createObjectURL(new Blob([res.data]));
  922. let link = document.createElement('a');
  923. link.style.display = 'none';
  924. link.href = url;
  925. link.setAttribute('download', filename);
  926. document.body.appendChild(link);
  927. link.click();
  928. document.body.removeChild(link);
  929. },
  930. // 下载报告
  931. downloadTask(type) {
  932. let latestUrl;
  933. if (type === 'word') {
  934. latestUrl = this.checkRow.reportOpt.latestUrl;
  935. } else if (type === 'excel') {
  936. latestUrl = this.checkRow.excelReportOpt.latestUrl;
  937. }
  938. let a = document.createElement('a');
  939. a.href = latestUrl;
  940. a.click();
  941. this.$message.success('导出汇总报告成功');
  942. this.exportDig = false;
  943. },
  944. // 下载新版报告
  945. downloadNewTask(type) {
  946. let latestUrl;
  947. if (type === 'word') {
  948. latestUrl = this.checkRow.newReportOpt.latestUrl;
  949. } else if (type === 'excel') {
  950. latestUrl = this.checkRow.newExcelReportOpt.latestUrl;
  951. }
  952. let a = document.createElement('a');
  953. a.href = latestUrl;
  954. a.click();
  955. this.$message.success('导出汇总报告成功');
  956. this.exportDig = false;
  957. },
  958. rightClick(event, data, node, obj) {
  959. this.currentId = data.id;
  960. this.form.deptId = data.id;
  961. this.form.name = data.name;
  962. this.form.parentId = data.parentId;
  963. this.form.sort = data.sort;
  964. this.levelCheck = node.level;
  965. this.showRightMenu = false; // 先把模态框关死,目的是:第二次或者第n次右键鼠标的时候 它默认的是true
  966. this.showRightMenu = true;
  967. if (!data.isLock) {
  968. //判断是几级菜单
  969. //let level=data.
  970. let menu = document.querySelector('#menu');
  971. menu.style.left = event.clientX - 200 + 'px';
  972. menu.style.top = event.clientY - 140 + 'px';
  973. // 给整个document添加监听鼠标事件,点击任何位置执行closeRightMenu方法,及时将菜单关闭
  974. document.addEventListener('click', this.closeRightMenu);
  975. } else {
  976. this.showRightMenu = false;
  977. document.removeEventListener('click', this.closeRightMenu);
  978. }
  979. },
  980. filterNode(value, data) {
  981. if (!value) return true;
  982. return data.label.indexOf(value) !== -1;
  983. },
  984. // 获取选中的值
  985. getNodeData(data, checked) {
  986. this.getNodeVal = this.$refs.tree1.getCheckedNodes();
  987. },
  988. getTaskTree() {
  989. this.distributionForm.wmScoreTaskTypeList = [];
  990. getTaskTree().then(response => {
  991. this.distributionForm.wmScoreTaskTypeList = response.data.data;
  992. });
  993. },
  994. getCheckedNodes() {
  995. console.log(this.$refs.tree1.getCheckedNodes());
  996. },
  997. getCheckedKeys() {
  998. console.log(this.$refs.tree1.getCheckedKeys());
  999. },
  1000. showRelatedService(type) {
  1001. let obj = {
  1002. onlySelf: ''
  1003. };
  1004. if (this.importShowFlag) {
  1005. obj.onlySelf = true;
  1006. }
  1007. getListAncestorApi(obj)
  1008. .then(response => {
  1009. console.log('response', response);
  1010. // debugger
  1011. this.fwqyOptions = response.data.data;
  1012. // 当发包对象为药企管理员
  1013. let roles = this.userInfo.roles;
  1014. if (roles.includes(3)) {
  1015. this.distributionForm.relatedService = this.fwqyOptions[0].deptId;
  1016. this.distributionForm.relationScoreId = '-1';
  1017. this.scoreNameChange('-1');
  1018. this.scoreAble = true;
  1019. this.relatedAble = true;
  1020. }
  1021. })
  1022. .catch(() => {
  1023. this.tableLoading = false;
  1024. });
  1025. },
  1026. // 有效服务类型展示
  1027. showTaskType(type) {
  1028. // this.distributionForm.wmScoreTaskTypeList = []
  1029. let arg = {
  1030. description: '1'
  1031. };
  1032. getTaskTypeTree(arg).then(response => {
  1033. // this.distributionForm.wmScoreTaskTypeList = response.data.data.treeList
  1034. if (type == '1') {
  1035. this.checkedDsScope = response.data.data.keys;
  1036. // this.getNodeVal = response.data.data.treeList
  1037. }
  1038. });
  1039. },
  1040. // showTaskType() {
  1041. // scoreTasktype("score_task_type").then((response) => {
  1042. // response.data.data.forEach((item) => {
  1043. // const addnew = {
  1044. // key: item.value,
  1045. // label: item.label,
  1046. // value: item.description,
  1047. // };
  1048. //
  1049. // this.dateOptions.push(addnew);
  1050. // });
  1051. // });
  1052. // },
  1053. // 积分包任务类型展示
  1054. showRemote() {
  1055. remote('packsge_type1').then(response => {
  1056. response.data.data.forEach(item => {
  1057. const addnew = {
  1058. value: item.value,
  1059. label: item.label
  1060. };
  1061. this.packageType1.push(addnew);
  1062. });
  1063. });
  1064. },
  1065. // 初始化页面
  1066. getList(page, params) {
  1067. this.tableLoading = true;
  1068. selectWmScorePackageLists(
  1069. Object.assign(
  1070. {
  1071. current: page.currentPage,
  1072. size: page.pageSize
  1073. },
  1074. params,
  1075. this.searchForm
  1076. )
  1077. )
  1078. .then(response => {
  1079. this.tableData = [];
  1080. this.tableData = response.data.data.records;
  1081. this.page.total = response.data.data.total;
  1082. this.tableLoading = false;
  1083. // let resData = response.data.data.records;
  1084. //
  1085. // var yfp = 0;
  1086. // var ysd = 0;
  1087. // var shtg = 0;
  1088. // var payScoreVal = 0;
  1089. // if (resData.length > 0) {
  1090. // for (var i = 0; i < resData.length; i++) {
  1091. // if (undefined != resData[i].ytj) {
  1092. // ysd += resData[i].ytj;
  1093. // }
  1094. //
  1095. // if (undefined != resData[i].ysh) {
  1096. // shtg += resData[i].ysh;
  1097. // // if(undefined!=resData[i].score) {
  1098. // // var socre = parseFloat(resData[i].ysh * 100 / resData[i].score).toFixed(0);
  1099. // // if (socre > 100) {
  1100. // // socre = 100;
  1101. // // }
  1102. // // resData[i].scoreJd=socre;
  1103. // // }
  1104. // }
  1105. //
  1106. // if (undefined != resData[i].kfpjf) {
  1107. // yfp += resData[i].kfpjf;
  1108. // }
  1109. // if (undefined != resData[i].payScore) {
  1110. // payScoreVal += resData[i].payScore;
  1111. // }
  1112. // }
  1113. // this.scorePay = payScoreVal;
  1114. // this.socreShtg = shtg;
  1115. // this.socreYjwc = yfp;
  1116. //
  1117. // if (yfp > 0) {
  1118. // var socre = parseFloat((shtg * 100) / yfp).toFixed(2);
  1119. // if (socre > 100) {
  1120. // socre = 100;
  1121. // }
  1122. // this.socreShtgRate = parseInt(socre);
  1123. // }
  1124. // }
  1125. })
  1126. .catch(() => {
  1127. this.tableLoading = false;
  1128. });
  1129. },
  1130. // 查看按钮
  1131. viewBtn(row) {
  1132. this.currentSelect = row;
  1133. // debugger
  1134. this.showRelatedService();
  1135. this.distributionForm.belongDate = row.belongDate;
  1136. this.addShow = false;
  1137. this.allNot = true;
  1138. this.showTitle = 'view';
  1139. this.showTitle = '查看';
  1140. this.showDig = true;
  1141. this.lookValue = row.packageType1;
  1142. this.lookDetail(row.id);
  1143. },
  1144. // 回显数据
  1145. lookDetail(id) {
  1146. // debugger
  1147. let args = {
  1148. scoreId: id
  1149. };
  1150. selectWmScorePackage(args).then(response => {
  1151. // this.packsgeTypebtn(this.packageType1Val);
  1152. this.returnVal = [];
  1153. // this.returnVal = response.data.data.wmScoreTaskTypeList;
  1154. this.returnVal = response.data.data.taskTypeSet;
  1155. let showVal = [];
  1156. for (let i = 0; i < this.returnVal.length; i++) {
  1157. showVal.push(this.returnVal[i].type);
  1158. }
  1159. const data = response.data.data;
  1160. data.relatedService = data.relatedService ? Number(data.relatedService) : '';
  1161. data.planId = data.planId ? Number(data.planId) : '';
  1162. data.acceptSug = data.acceptSug ? Number(data.acceptSug) : '';
  1163. if (this.IS_DLS) {
  1164. this.getPlanList(data.relationScoreId, data.planId);
  1165. }
  1166. this.distributionForm = data; // 查看和编辑的回显
  1167. const timestamp = new Date(this.distributionForm.endTime).getTime();
  1168. this.distributionForm.endTimeValue = this.distributionForm.endTime;
  1169. // this.belongDate = this.distributionForm.belongDate;
  1170. // this.distributionForm.wmScoreTaskTypeList = this.taskTypeSet; // 回显复选框
  1171. // this.getKfpVal(response.data.data.relationScoreId);
  1172. const list = [
  1173. {
  1174. relationScoreName: data.relationScoreName,
  1175. id: data.relationScoreId
  1176. }
  1177. ];
  1178. this.gljfbOptions = list;
  1179. // this.getRelatedVal(response.data.data.relatedService);
  1180. // this.distributionForm.relationScoreId = response.data.data.relationScoreId; // 查看和编辑的回显
  1181. // if (this.distributionForm.wmScoreTaskTypeList == null) {
  1182. // this.showTaskType()
  1183. // }
  1184. this.showTaskType();
  1185. // 回显选中的有效服务类型
  1186. this.checkedDsScope = this.distributionForm.taskTypeSet;
  1187. this.showDig = true;
  1188. this.tableLoading = false;
  1189. });
  1190. },
  1191. // 获取可分配积分
  1192. getKfpVal(id) {
  1193. this.jbdxOptions = [];
  1194. let args = {
  1195. // scoreId: scoreName,
  1196. id: id
  1197. };
  1198. selectKfpjf(args).then(response => {
  1199. // debugger
  1200. this.kfpjfz = response.data.data[0].kfpjf == null ? 0 : response.data.data[0].kfpjf;
  1201. this.jbdxOptions = response.data.data[0].acceptSug;
  1202. // response.data.data[0].acceptSug.forEach((item) => {
  1203. // const addnew = {
  1204. // gsmc: item.gsmc,
  1205. // id: item.id
  1206. // };
  1207. //
  1208. // this.jbdxOptions.push(addnew)
  1209. // })
  1210. });
  1211. },
  1212. getRelatedVal(relatedService) {
  1213. // debugger
  1214. this.gljfbOptions = [];
  1215. let args = {
  1216. relatedService: relatedService
  1217. };
  1218. selectRelationScoreId(args).then(response => {
  1219. // debugger
  1220. this.gljfbOptions = response.data.data;
  1221. //关联服务企业展示关联积分包
  1222. // response.data.data.forEach((item) => {
  1223. // const addnew = {
  1224. // id: item.id,
  1225. // relationScoreName: item.relationScoreName
  1226. // };
  1227. // this.gljfbOptions.push(addnew)
  1228. // })
  1229. });
  1230. },
  1231. // 根据积分包任务类型 展示 可选的有效服务类型
  1232. // packsgeTypebtn(id) {
  1233. //
  1234. // this.dateOptions = []
  1235. // // this.distributionForm.wmScoreTaskTypeList = []
  1236. // showTask(id == "" ? this.lookValue : id).then((response) => {
  1237. // response.data.data.forEach((item) => {
  1238. // const addnew = {
  1239. // key: item.value,
  1240. // label: item.label,
  1241. // };
  1242. //
  1243. // this.dateOptions.push(addnew);
  1244. // });
  1245. //
  1246. // });
  1247. // },
  1248. dateFormat: function(time) {
  1249. var date = new Date(time);
  1250. var year = date.getFullYear();
  1251. /* 在日期格式中,月份是从0开始的,因此要加0
  1252. * 使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
  1253. * */
  1254. var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
  1255. // 拼接
  1256. return year + '-' + month;
  1257. },
  1258. // 新增按钮-弹窗
  1259. addBtn() {
  1260. if (this.userInfo.roles.includes(3)) {
  1261. this.importShowFlag = true;
  1262. this.getPlanList('-1');
  1263. // 获取计划
  1264. }
  1265. this.dialogType = 'add';
  1266. this.showDig = true;
  1267. this.showTitle = '新增';
  1268. this.allNot = false;
  1269. this.addShow = true;
  1270. this.showTaskType('1');
  1271. this.showRelatedService();
  1272. this.checkedDsScope = [];
  1273. // debugger
  1274. // this.disabledFn();
  1275. var vm = this;
  1276. //默认显示当前时间
  1277. const myDate = new Date();
  1278. const year = myDate.getFullYear(); // 获取当前年份
  1279. const month = myDate.getMonth() + 1; // 获取当前月份(0-11,0代表1月所以要加1);
  1280. vm.distributionForm.belongDate = month > 9 ? `${year}-${month}` : `${year}-0${month}`;
  1281. },
  1282. //关联执行包名称-选中的值
  1283. scoreNameChange(id) {
  1284. this.scoreIdVal = id;
  1285. this.distributionForm.acceptSug = '';
  1286. this.distributionForm.wmScoreTaskTypeList = [];
  1287. if (id == '-1') {
  1288. this.typeList = false;
  1289. this.packsgeType = false;
  1290. this.kfpjfz = '';
  1291. // this.belongDate = "";
  1292. this.checkedDsScope = [];
  1293. this.showTaskType('1');
  1294. this.drugProducerList = [...this.drugProducerListCopy]; // 推广产品企业
  1295. this.getListDrug();
  1296. } else {
  1297. let curr = this.gljfbOptions.find(item => item.id === id);
  1298. this.distributionForm.wmScoreTaskTypeList = this.wmScoreTaskTypeList;
  1299. this.typeList = true;
  1300. this.packsgeType = true;
  1301. this.distributionForm.planId = '';
  1302. this.getPlanList(id);
  1303. }
  1304. let arg = {
  1305. id: id
  1306. };
  1307. selectKfpjf(arg)
  1308. .then(response => {
  1309. // debugger
  1310. if (response.data.code == '0') {
  1311. this.jbdxOptions = [];
  1312. response.data.data[0].acceptSug.forEach(item => {
  1313. const addnew = {
  1314. gsmc: item.gsmc,
  1315. deptId: item.deptId,
  1316. id: item.id,
  1317. provAbbr: item.provAbbr
  1318. };
  1319. this.jbdxOptions.push(addnew);
  1320. });
  1321. if (this.currentSelect && this.currentSelect.planId) {
  1322. this.distributionForm.planId = this.currentSelect.planId;
  1323. this.planIdChange(this.currentSelect.planId);
  1324. }
  1325. this.showTaskType();
  1326. this.taskTypeList1val = response.data.data[1].wmScoreTaskTypeList1;
  1327. // console.log("334434343",this.taskTypeList1val)
  1328. this.wmScoreTaskTypeListVal = [];
  1329. // this.taskTypeList1val = [];
  1330. this.distributionForm.wmScoreTaskTypeList = [];
  1331. this.kfpjfz = response.data.data[1].kfpjf;
  1332. this.distributionForm.belongDate = response.data.data[1].belongDate;
  1333. this.distributionForm.packageType1 = response.data.data[1].packageType1;
  1334. this.distributionForm.wmScoreTaskTypeList = response.data.data[1].wmScoreTaskTypeList;
  1335. if (this.distributionForm.wmScoreTaskTypeList == '') {
  1336. this.showTaskType();
  1337. }
  1338. this.checkedDsScope = response.data.data[1].wmScoreTaskTypeList;
  1339. if (!this.IS_DLS) {
  1340. this.setSelectNodes(this.checkedDsScope);
  1341. }
  1342. this.planIdDisabled = false;
  1343. }
  1344. })
  1345. .catch(() => {
  1346. this.tableLoading = false;
  1347. });
  1348. },
  1349. setSelectNodes(arr) {
  1350. this.$refs.tree1.setCheckedKeys(arr);
  1351. this.$refs.tree2.setCheckedKeys(arr);
  1352. this.$refs.tree3.setCheckedKeys(arr);
  1353. // this.$refs.tree7.setCheckedKeys(arr);
  1354. },
  1355. getAllTaskTypeList() {
  1356. let taskTypeList = [];
  1357. taskTypeList = taskTypeList.concat(this.$refs.tree1.getCheckedNodes());
  1358. taskTypeList = taskTypeList.concat(this.$refs.tree2.getCheckedNodes());
  1359. taskTypeList = taskTypeList.concat(this.$refs.tree3.getCheckedNodes());
  1360. // taskTypeList = taskTypeList.concat(this.$refs.tree7.getCheckedNodes());
  1361. // taskTypeList = taskTypeList.concat(this.$refs.tree4.getCheckedNodes())
  1362. // taskTypeList = taskTypeList.concat(this.$refs.tree5.getCheckedNodes())
  1363. return taskTypeList;
  1364. },
  1365. formatDate(inputDate) {
  1366. const date = new Date(inputDate);
  1367. const year = date.getFullYear();
  1368. const month = String(date.getMonth() + 1).padStart(2, '0');
  1369. const day = String(date.getDate()).padStart(2, '0');
  1370. return `${year}-${month}-${day}`;
  1371. },
  1372. // 新增按钮-提交
  1373. submitForm(formName) {
  1374. this.$refs[formName].validate(valid => {
  1375. if (valid) {
  1376. // const date = this.formatDate(this.distributionForm.endTimeValue);
  1377. const date = this.distributionForm.endTimeValue;
  1378. // debugger
  1379. // this.showTaskType()
  1380. let wmScoreTaskTypeList;
  1381. if (!this.IS_DLS) {
  1382. wmScoreTaskTypeList = this.getAllTaskTypeList();
  1383. console.log('wmScoreTaskTypeList', wmScoreTaskTypeList);
  1384. }
  1385. let pkgTaskTypeQtyList;
  1386. // 代理商发包
  1387. if (this.IS_DLS) {
  1388. const tableData = this.$refs.dismantleTableRef.getDetail();
  1389. pkgTaskTypeQtyList = tableData.map(item => {
  1390. return {
  1391. taskTypeName: item.taskTypeName,
  1392. price: item.score,
  1393. taskTypeId: item.taskTypeId,
  1394. qty: item.qty
  1395. };
  1396. });
  1397. let treeArr = tableData.map(item => {
  1398. return {
  1399. taskTypeName: item.taskTypeName,
  1400. taskTypeId: item.orgTaskTypeId
  1401. };
  1402. });
  1403. let arr1 = [...pFlist];
  1404. tableData.forEach(item => {
  1405. const curr = arr1.find(iten => iten.taskTypeId === item.parent_id);
  1406. if (curr) {
  1407. curr.children.push({
  1408. taskTypeId: item.orgTaskTypeId,
  1409. taskTypeName: item.taskTypeName
  1410. });
  1411. }
  1412. });
  1413. let arr3 = arr1.concat(treeArr);
  1414. const arr4 = arr3.filter(item => {
  1415. if (!item.children || item.children.length > 0) {
  1416. return item;
  1417. }
  1418. });
  1419. wmScoreTaskTypeList = arr4;
  1420. }
  1421. if (wmScoreTaskTypeList.length == 0) {
  1422. this.$message.error('有效服务类型不能为空');
  1423. return false;
  1424. }
  1425. let args = {
  1426. pkgTaskTypeQtyList: pkgTaskTypeQtyList,
  1427. id: this.idVal == '' ? '' : this.idVal,
  1428. agentTypeId: this.distributionForm.relationScoreId == '-1' ? '1' : '2',
  1429. scoreId: this.distributionForm.scoreId,
  1430. scorePackageName: this.distributionForm.scorePackageName,
  1431. score: this.distributionForm.score,
  1432. acceptSug: this.distributionForm.acceptSug,
  1433. relationScoreId: this.distributionForm.relationScoreId == '-1' ? '' : this.distributionForm.relationScoreId,
  1434. kfpjf: this.kfpjfz == '' ? 0 : this.kfpjfz,
  1435. belongDate: this.distributionForm.belongDate,
  1436. // wmScoreTaskTypeList: "-1" != this.distributionForm.relationScoreId ? this.taskTypeList1val : "" == this.relationScoreId ? this.wmScoreTaskTypeListVal : "",//自己选的
  1437. wmScoreTaskTypeList: wmScoreTaskTypeList,
  1438. description: this.distributionForm.description,
  1439. packageType1: this.distributionForm.packageType1,
  1440. level1Id: this.distributionForm.level1Id,
  1441. level2Id: this.distributionForm.level2Id,
  1442. relatedService: this.distributionForm.relatedService,
  1443. entTaskLimit: this.distributionForm.entTaskLimit || 0,
  1444. auditManagementFeeRates: this.distributionForm.auditManagementFeeRates || 0,
  1445. quizIds: this.distributionForm.quizIds,
  1446. drugtable: this.distributionForm.drugtable,
  1447. startTime: this.distributionForm.startTime,
  1448. endTime: date,
  1449. planId: this.distributionForm.planId,
  1450. provAbbr: this.distributionForm.provAbbr
  1451. };
  1452. // 推广产品企业
  1453. if (this.distributionForm && this.distributionForm.relationScoreId && this.distributionForm.relationScoreId == '-1') {
  1454. if (!this.distributionForm.drugProducerList || this.distributionForm.drugProducerList.length === 0) {
  1455. args.drugProducerList = this.drugProducerList; // 推广产品企业
  1456. } else {
  1457. args.drugProducerList = this.distributionForm.drugProducerList;
  1458. }
  1459. if (!this.distributionForm.drugtable || this.distributionForm.drugtable.length === 0) {
  1460. args.drugtable = this.drugList.map(item => item.drug_id);
  1461. }
  1462. } else {
  1463. this.distributionForm.drugProducerList = this.drugProducerList; // 推广产品企业
  1464. args.drugtable = this.drugList.map(item => item.drug_id);
  1465. }
  1466. if (this.dialogType == 'add') {
  1467. // this.distributionForm.wmScoreTaskTypeList = this.getNodeVal
  1468. // this.distributionForm.wmScoreTaskTypeList = [];
  1469. // this.distributionForm.wmScoreTaskTypeList = this.wmScoreTaskTypeList;
  1470. if (Number(this.distributionForm.score) > this.kfpjfz && this.distributionForm.relationScoreId != '-1') {
  1471. this.$message.error('可分配积分不足');
  1472. return false;
  1473. }
  1474. delete args.drugProducerList;
  1475. this.buttonLoading = true;
  1476. saves(args)
  1477. // saves(this.distributionForm)
  1478. .then(response => {
  1479. // debugger
  1480. this.planList = [];
  1481. this.buttonLoading = false;
  1482. this.getList(this.page);
  1483. this.cancelBtn();
  1484. })
  1485. .catch(() => {
  1486. this.buttonLoading = false;
  1487. });
  1488. } else {
  1489. if (this.showTitle == 'edit') {
  1490. this.distributionForm.wmScoreTaskTypeList = this.getNodeVal;
  1491. if (Number(this.distributionForm.score) > this.kfpjfz + this.scoreIdVal && this.distributionForm.relationScoreId != '-1') {
  1492. this.$message.error('可分配积分不足');
  1493. return false;
  1494. }
  1495. }
  1496. this.buttonLoading = true;
  1497. updateByIds(args)
  1498. .then(response => {
  1499. // updateByIds(this.distributionForm).then((response) => {
  1500. // debugger
  1501. this.planList = [];
  1502. this.getList(this.page);
  1503. this.showDig = false;
  1504. this.tableLoading = false;
  1505. this.buttonLoading = false;
  1506. this.kfpjfz = '';
  1507. this.distributionForm.belongDate = '';
  1508. this.relationScoreId = '';
  1509. this.distributionForm = {
  1510. wmScoreTaskTypeList: []
  1511. };
  1512. })
  1513. .catch(() => {
  1514. this.buttonLoading = false;
  1515. });
  1516. }
  1517. setTimeout(() => {
  1518. this.$store.dispatch('SET_INTEGRAL');
  1519. }, 600);
  1520. } else {
  1521. console.log('error submit!!');
  1522. return false;
  1523. }
  1524. this.buttonLoading = false;
  1525. });
  1526. },
  1527. // 编辑回显
  1528. async updateBtn(row) {
  1529. // debugger
  1530. //积分包如果被分派,承接对象不可以修改
  1531. this.showRelatedService();
  1532. this.packageIsConduct = row.packageIsConduct;
  1533. if (row.packageIsConduct == '0') {
  1534. this.isAble = false;
  1535. } else {
  1536. this.isAble = true;
  1537. }
  1538. //积分包如果已结算,关联积分包不可以修改
  1539. this.settleStatus = row.settleStatus;
  1540. if (row.settleStatus == '1') {
  1541. this.scoreAble = true;
  1542. } else {
  1543. this.scoreAble = false;
  1544. }
  1545. //无 可以编辑任务类型,其他不可以编辑
  1546. if (row.relationScoreId == '') {
  1547. this.typeList = false;
  1548. this.packsgeType = false;
  1549. this.kfpjfz = '';
  1550. this.distributionForm.belongDate = '';
  1551. } else {
  1552. this.typeList = true;
  1553. this.packsgeType = true;
  1554. }
  1555. // debugger
  1556. this.showDig = true;
  1557. this.dialogType = 'edit';
  1558. this.showTitle = '编辑';
  1559. this.editDisabled = true;
  1560. this.allNot = false;
  1561. this.addShow = true;
  1562. this.idVal = row.id;
  1563. this.packageIsConductVal = row.packageIsConduct;
  1564. this.relationScoreIdVal = row.relationScoreId;
  1565. await this.lookDetail(row.id);
  1566. if (row.endTime) {
  1567. const timestamp = new Date(row.endTime).getTime();
  1568. // this.distributionForm.endTimeValue = timestamp;
  1569. this.distributionForm.endTimeValue = row.endTime;
  1570. }
  1571. },
  1572. showRestart(row) {
  1573. return false;
  1574. if (row.endTime) {
  1575. let targetDate;
  1576. // 判断 endTime 是否符合 YYYY-MM-DD 格式
  1577. const datePattern = /^\d{4}-\d{2}-\d{2}$/;
  1578. if (datePattern.test(row.endTime)) {
  1579. // 如果是日期格式,则添加 23:59:59
  1580. targetDate = new Date(`${row.endTime} 23:59:59`);
  1581. } else {
  1582. // 否则直接转换为 Date 对象
  1583. targetDate = new Date(row.endTime);
  1584. }
  1585. const currentDate = new Date();
  1586. if (targetDate.getTime() < currentDate.getTime()) {
  1587. return true;
  1588. }
  1589. }
  1590. return false;
  1591. },
  1592. restartFn(row) {
  1593. this.currentRow = row;
  1594. this.restartVisible = true;
  1595. },
  1596. restartVisibleClose() {
  1597. this.$refs.restartForm.resetFields();
  1598. this.restartVisible = false;
  1599. },
  1600. restartSubmit() {
  1601. this.$refs.restartForm.validate(async valid => {
  1602. if (valid) {
  1603. // const date = this.formatDate(this.restartForm.endTimeValue);
  1604. const date = this.restartForm.endTimeValue;
  1605. const obj = {
  1606. id: this.currentRow.id,
  1607. endTime: date
  1608. };
  1609. const res = await restartApi(obj);
  1610. if (res.data.code === 0) {
  1611. this.$message.success('重启成功');
  1612. this.getList(this.page);
  1613. this.restartVisibleClose();
  1614. }
  1615. }
  1616. });
  1617. },
  1618. // 承接对象
  1619. acceptSugChange(id) {
  1620. this.$forceUpdate(); // 强制刷新
  1621. },
  1622. // 计划包id
  1623. planIdChange(e) {
  1624. const curr = this.planList.find(item => item.planId === e);
  1625. if (this.IS_DLS) {
  1626. if (!curr.planDetails) {
  1627. this.$refs.dismantleTableRef.setData([]);
  1628. return this.$message.error(`服务目标【${curr.planName}】不存在可用的拆解详情,请核实!`);
  1629. }
  1630. this.planItem = curr.planDetails;
  1631. this.$refs.dismantleTableRef.setData(curr.planItems, curr.planScore);
  1632. this.distributionForm.score = curr.planDetails.total;
  1633. }
  1634. if (curr) {
  1635. this.distributionForm.startTime = curr.planIssue;
  1636. this.distributionForm.endTimeValue = curr.planExpiry;
  1637. this.distributionForm.score = curr.planScore;
  1638. }
  1639. const currA = this.jbdxOptions.find(item => item.deptId == curr.consigneeId);
  1640. if (currA) {
  1641. this.distributionForm.acceptSug = currA.id;
  1642. if (currA.provAbbr) {
  1643. this.provAbbrList = currA.provAbbr.split(',');
  1644. }
  1645. }
  1646. this.distributionForm.drugtable = [curr.skuInfo.skuId];
  1647. const arr = [
  1648. {
  1649. drug_name: curr.skuInfo.skuName,
  1650. drug_id: curr.skuInfo.skuId
  1651. }
  1652. ];
  1653. this.drugList = arr;
  1654. },
  1655. // 有效服务类型选中值-添加 新
  1656. chooseItems(data, checked) {
  1657. this.wmScoreTaskTypeListVal = this.$refs.tree.getCheckedNodes();
  1658. },
  1659. //关联服务企业-选中的值
  1660. RelatedServiceChange(relatedService) {
  1661. // debugger
  1662. this.distributionForm.relationScoreId = '';
  1663. // this.distributionForm.wmScoreTaskTypeList = [];
  1664. this.relatedServiceVal = relatedService;
  1665. let arg = {
  1666. relatedService: relatedService
  1667. };
  1668. selectRelationScoreId(arg)
  1669. .then(response => {
  1670. this.gljfbOptions = response.data.data;
  1671. })
  1672. .catch(() => {
  1673. this.tableLoading = false;
  1674. });
  1675. },
  1676. // 判断是否为-1, 若为-1则禁用,不为-1则可以选择
  1677. disabledFn() {
  1678. return true;
  1679. // debugger
  1680. if (this.dialogType == 'add' && this.distributionForm.relationScoreId == '-1') {
  1681. return false;
  1682. } else if (this.dialogType == 'edit' && this.packageIsConductVal == '1') {
  1683. return true;
  1684. } else if (this.dialogType == 'edit' && this.packageIsConductVal == '0' && '-1' == this.distributionForm.relationScoreId) {
  1685. return false;
  1686. } else if (this.dialogType == 'edit' && '' != this.distributionForm.relationScoreId) {
  1687. return true;
  1688. } else if (this.dialogType == 'edit' && this.packageIsConductVal == '0' && '' == this.relationScoreIdVal) {
  1689. return false;
  1690. } else if (this.distributionForm.relationScoreId == '-1' && this.packageIsConductVal == '') {
  1691. return false;
  1692. } else {
  1693. return true;
  1694. }
  1695. },
  1696. // 提交时间获取值
  1697. startDateBtn(date, done) {
  1698. (this.allocationDate = date[0]), (this.endLabelDate = date[1]);
  1699. },
  1700. // 搜索按钮
  1701. searchVal(form, done) {
  1702. this.searchForm = form;
  1703. this.searchForm.allocationDate = this.allocationDate;
  1704. this.searchForm.endLabelDate = this.endLabelDate;
  1705. this.page.currentPage = 1;
  1706. this.getList(this.page, form);
  1707. done();
  1708. },
  1709. // 终止
  1710. suspendBtn(row) {
  1711. this.enableFlagDig = true;
  1712. this.suspendData = row;
  1713. },
  1714. // 中止确认按钮
  1715. enableFlagBtn(formName) {
  1716. if (this.enableForm.enableFlag === '2' && this.suspendData.stopStatus === 'NOTHING' && !this.isShengyu) {
  1717. // 剩余收回
  1718. this.isShengyu = true;
  1719. return;
  1720. }
  1721. this.$refs[formName].validate(valid => {
  1722. if (valid) {
  1723. let args = {
  1724. enableType: this.enableForm.enableFlag,
  1725. id: this.suspendData.id
  1726. };
  1727. stopWmScorePackage(args).then(response => {
  1728. this.$message.success('终止成功');
  1729. this.getList(this.page);
  1730. this.stopcancelBtn();
  1731. });
  1732. } else {
  1733. console.log('error submit!!');
  1734. return false;
  1735. }
  1736. setTimeout(() => {
  1737. this.$store.dispatch('SET_INTEGRAL');
  1738. }, 500);
  1739. });
  1740. },
  1741. // 隐藏弹出窗
  1742. stopcancelBtn() {
  1743. this.enableFlagDig = false;
  1744. this.enableForm = {};
  1745. this.isShengyu = false;
  1746. },
  1747. // 终止按钮
  1748. // stopBtn(row, index, done, loading) {
  1749. // this.$confirm("是否确认终止", "警告", {
  1750. // confirmButtonText: "是",
  1751. // cancelButtonText: "否",
  1752. // type: "warning"
  1753. // })
  1754. // .then(() => {
  1755. // // updateStatusByIds(row)
  1756. // stopWmScorePackage(row)
  1757. // .then(data => {
  1758. // this.$message.success("任务终止成功");
  1759. // this.getList(this.page);
  1760. // })
  1761. // .catch(() => {});
  1762. // // this.$message.success("任务终止成功");
  1763. // // this.getList(this.page);
  1764. // })
  1765. // .catch(() => {});
  1766. // },
  1767. // 分页查询
  1768. sizeChange(pageSize) {
  1769. this.page.pageSize = pageSize;
  1770. },
  1771. currentChange(current) {
  1772. this.page.currentPage = current;
  1773. },
  1774. handleClose(done) {
  1775. this.planList = [];
  1776. this.resetInfo();
  1777. this.getList(this.page);
  1778. // done();
  1779. },
  1780. resetInfo() {
  1781. this.$refs.distributionForm.resetFields();
  1782. if (this.$refs.dismantleTableRef) {
  1783. this.$refs.dismantleTableRef.setData([]);
  1784. }
  1785. this.distributionForm.planId = '';
  1786. this.distributionForm.drugProducerList = null;
  1787. this.distributionForm.drugtable = [];
  1788. this.kfpjfz = '';
  1789. this.editDisabled = false;
  1790. this.isAble = false;
  1791. console.log(' this.editDisabled = false;', this.editDisabled);
  1792. this.scoreAble = false;
  1793. this.relatedAble = false;
  1794. this.showDig = false;
  1795. this.typeList = false;
  1796. this.packsgeType = false;
  1797. this.showDig = false;
  1798. },
  1799. // 取消弹出窗, 并清空表单
  1800. cancelBtn(formName) {
  1801. this.resetInfo();
  1802. this.getList(this.page);
  1803. },
  1804. // 搜索清空按钮
  1805. searchReset() {
  1806. this.dateTime = '';
  1807. this.allocationDate = '';
  1808. this.endLabelDate = '';
  1809. this.searchForm = {};
  1810. },
  1811. // 结算
  1812. async settleById(row) {
  1813. this.id = row.id;
  1814. this.settleButtonShow = true;
  1815. let {scorePackageName, score, ysh: finishScore, description} = row;
  1816. this.form = {
  1817. scorePackageName,
  1818. score,
  1819. finishScore,
  1820. description
  1821. };
  1822. this.textareaDisabled = !row.p2pDraft;
  1823. let discount;
  1824. if (row.p2pAmount) {
  1825. discount = (Number(row.p2pAmount) / Number(row.score)).toFixed(2);
  1826. } else {
  1827. discount = 1;
  1828. }
  1829. let obj = {
  1830. realName: row.$acceptSug,
  1831. discount: discount,
  1832. settleAmount: row.p2pAmount || row.score,
  1833. allScore: row.score,
  1834. settleNoteStatus: row.packageFinishStatus,
  1835. p2pServiceAmount: row.p2pServiceAmount,
  1836. p2pDraft: row.p2pDraft
  1837. };
  1838. this.gridData.push(obj);
  1839. this.settleTableVisible = true;
  1840. },
  1841. hideDialog() {
  1842. this.settleTableVisible = false;
  1843. this.form = {};
  1844. this.gridData = [];
  1845. this.getList(this.page);
  1846. },
  1847. async settleSave(p2pDraft) {
  1848. if (!this.id) {
  1849. this.$message.error('数据异常');
  1850. return;
  1851. }
  1852. for (var i = 0; i < this.gridData.length; i++) {
  1853. const item = this.gridData[i];
  1854. if (Number(item.discount) < Number(0.8) || Number(item.discount) > Number(1.2)) {
  1855. this.$message.error('第' + parseInt(i + 1) + '行,折扣应介于0.8~1.2之间');
  1856. return false;
  1857. }
  1858. }
  1859. let data = {
  1860. id: this.id,
  1861. p2pAmount: this.gridData[0].settleAmount,
  1862. p2pServiceAmount: this.gridData[0].p2pServiceAmount,
  1863. description: this.form.description,
  1864. p2pDraft
  1865. };
  1866. const res = await settleSave(data);
  1867. if (res.data.code === 0) {
  1868. let message = p2pDraft ? '保存成功' : '提交成功';
  1869. this.$message.success(message);
  1870. this.hideDialog();
  1871. }
  1872. },
  1873. getSummaries(param) {
  1874. const {columns, data} = param;
  1875. const sums = [];
  1876. columns.forEach((column, index) => {
  1877. if (index === 0) {
  1878. sums[index] = '总价';
  1879. return;
  1880. }
  1881. if (index === 4) {
  1882. let isNumber = num => num === +num;
  1883. let a = data[0] ? data[0].settleAmount : 0;
  1884. let b = data[0] ? data[0].p2pServiceAmount : 0;
  1885. let pre;
  1886. let numA = isNumber(Number(a)) ? Number(a) : 0;
  1887. let numB = isNumber(Number(b)) ? Number(b) : 0;
  1888. pre = numA + numB;
  1889. sums[index] = pre + ' 元';
  1890. } else {
  1891. sums[index] = '*';
  1892. }
  1893. });
  1894. return sums;
  1895. },
  1896. discountChange(e) {
  1897. let value = e.discount.toString();
  1898. value = value.replace(/[^\d.\-]/g, ''); //清除"数字"和"." "-"负号以外的字符
  1899. value = value.replace(/^\./g, ''); //验证第一个字符是数字
  1900. value = value.replace(/\.{2,}/g, ''); //只保留第一个, 清除多余的
  1901. value = value
  1902. .replace('.', '$#$')
  1903. .replace(/\./g, '')
  1904. .replace('$#$', '.');
  1905. value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  1906. e.discount = value;
  1907. e.settleAmount = (Number(e.allScore) * Number(value)).toFixed(2);
  1908. },
  1909. discountInput(e) {
  1910. let value = e.discount;
  1911. value = value.replace(/[^\d.\-]/g, ''); //清除"数字"和"." "-"负号以外的字符
  1912. value = value.replace(/^\./g, ''); //验证第一个字符是数字
  1913. value = value.replace(/\.{2,}/g, ''); //只保留第一个, 清除多余的
  1914. value = value
  1915. .replace('.', '$#$')
  1916. .replace(/\./g, '')
  1917. .replace('$#$', '.');
  1918. value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  1919. e.discount = value;
  1920. e.settleAmount = (Number(e.allScore) * Number(value)).toFixed(2);
  1921. },
  1922. settleAmountChange(e) {
  1923. let value = e.settleAmount.toString();
  1924. if (value) {
  1925. value = value.replace(/[^\d.\-]/g, ''); //清除"数字"和"." "-"负号以外的字符
  1926. value = value.replace(/\.{2,}/g, ''); //只保留第一个, 清除多余的
  1927. value = value
  1928. .replace('.', '$#$')
  1929. .replace(/\./g, '')
  1930. .replace('$#$', '.');
  1931. value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  1932. let discount = (Number(value) / Number(e.allScore)).toFixed(2);
  1933. e.settleAmount = value;
  1934. e.discount = discount;
  1935. } else {
  1936. e.settleAmount = 0;
  1937. e.discount = 0;
  1938. }
  1939. },
  1940. settleAmountInput(e) {
  1941. let value = e.settleAmount;
  1942. value = value.replace(/[^\d.\-]/g, ''); //清除"数字"和"." "-"负号以外的字符
  1943. value = value.replace(/\.{2,}/g, ''); //只保留第一个, 清除多余的
  1944. value = value
  1945. .replace('.', '$#$')
  1946. .replace(/\./g, '')
  1947. .replace('$#$', '.');
  1948. value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  1949. let discount = 0;
  1950. if (value) {
  1951. discount = (Number(value) / Number(e.allScore)).toFixed(2);
  1952. }
  1953. e.settleAmount = value;
  1954. e.discount = discount;
  1955. }
  1956. }
  1957. };
  1958. </script>
  1959. <style lang="scss" scoped>
  1960. .tabStyle {
  1961. width: 100%;
  1962. margin-top: 10px;
  1963. }
  1964. .el-input__inner {
  1965. border: 1px solid #dcdfe6 !important;
  1966. }
  1967. .el-date-editor .el-range-separator {
  1968. padding: 0 0 !important;
  1969. }
  1970. .treeBox {
  1971. float: left;
  1972. width: 25%;
  1973. }
  1974. .treeBox3 {
  1975. width: 50%;
  1976. }
  1977. /*.treeBox {*/
  1978. /* width: 100%;*/
  1979. /* height: 200px;*/
  1980. /* border: 1px solid #DCDFE6;*/
  1981. /* overflow-y: scroll;*/
  1982. /* overflow-x: hidden;*/
  1983. /* border-radius: 10px;*/
  1984. /*}*/
  1985. /*滚动条样式*/
  1986. .treeBox::-webkit-scrollbar {
  1987. width: 10px;
  1988. }
  1989. .treeBox::-webkit-scrollbar-thumb {
  1990. border-radius: 10px;
  1991. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1992. background-color: #f90;
  1993. }
  1994. .treeBox::-webkit-scrollbar-track {
  1995. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1996. border-radius: 10px;
  1997. background: rgba(0, 0, 0, 0.1);
  1998. }
  1999. .generating {
  2000. color: #1e90ff;
  2001. text-align: center;
  2002. display: block;
  2003. }
  2004. .btns {
  2005. display: flex;
  2006. justify-content: center;
  2007. }
  2008. .title-msg {
  2009. text-align: center;
  2010. margin-top: 10px;
  2011. }
  2012. .separator {
  2013. background-color: rgba(242, 242, 242, 1) !important;
  2014. text-align: center;
  2015. width: 96%;
  2016. height: 34px;
  2017. line-height: 34px;
  2018. margin-bottom: 2px;
  2019. }
  2020. .settle-desc {
  2021. width: 100%;
  2022. ::v-deep .el-form-item__content {
  2023. width: 80%;
  2024. }
  2025. }
  2026. .down-item {
  2027. margin-left: 20px;
  2028. margin-bottom: 15px;
  2029. span {
  2030. /* width: 160px; */
  2031. display: inline-block;
  2032. text-align: right;
  2033. }
  2034. .btn {
  2035. display: flex;
  2036. justify-content: center;
  2037. align-items: center;
  2038. }
  2039. .first {
  2040. width: 240px;
  2041. }
  2042. }
  2043. .input-num-box {
  2044. ::v-deep .el-input__inner {
  2045. text-align: left;
  2046. }
  2047. }
  2048. .import-content {
  2049. text-align: center;
  2050. }
  2051. </style>