Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

project.vue 32KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952
  1. <template>
  2. <div class="page_project">
  3. <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
  4. <div class="cell clearfix" style="margin-bottom:0;">
  5. <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
  6. <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search" @click="searchAction" >搜索</el-button>
  7. <label class="title"><span class="name">状态</span> : </label>
  8. <el-select v-model="is_start" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeStart">
  9. <el-option
  10. v-for="item in options"
  11. :key="item.value"
  12. :label="item.label"
  13. :value="item.value">
  14. </el-option>
  15. </el-select>
  16. <label class="title"><span class="name">是否收费预估项:</span> : </label>
  17. <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeOption">
  18. <el-option
  19. v-for="item in optionOne"
  20. :key="item.value"
  21. :label="item.label"
  22. :value="item.value">
  23. </el-option>
  24. </el-select>
  25. <label class="title"><span class="name">备案:</span> : </label>
  26. <el-select v-model="is_mark" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeRecord">
  27. <el-option
  28. v-for="item in optionOne"
  29. :key="item.value"
  30. :label="item.label"
  31. :value="item.value">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div>
  36. <el-button type="primary" @click="openForm(0)">新增</el-button>
  37. <!-- <el-button type="primary" @click="BatchDelete()" v-if="$store.getters.xt_user.org_id == 9504 || $store.getters.xt_user.org_id == 10028">批量备案</el-button>
  38. <el-button type="primary" v-if="$store.getters.xt_user.org_id != 9504 && $store.getters.xt_user.org_id != 10028" @click="GDYBBatchPutOnRecord">批量备案</el-button> -->
  39. </div>
  40. </div>
  41. <div style="display:flex; align-items:center;margin-bottom:10px;">
  42. <!--<el-button type="primary" size="small" @click="BatchDelete()" v-if="$store.getters.xt_user.org_id == 9504 || $store.getters.xt_user.org_id == 10028" >批量备案</el-button>-->
  43. <el-button type="primary" size="small" @click="GDYBBatchPutOnRecord()">批量备案</el-button>
  44. <el-link target="_blank" href="https://kuyi.shengws.com/itemTemplate.xlsx" :underline="false"
  45. style="margin-left:15px">
  46. <el-button
  47. class="filter-item"
  48. type="primary"
  49. size="small"
  50. >下载模版
  51. </el-button>
  52. </el-link>
  53. <project-excel :on-success='handleSuccessOne'></project-excel>
  54. <el-button
  55. style="margin-left:10px;"
  56. @click="generateLog()"
  57. class="filter-item"
  58. type="primary"
  59. size="small"
  60. >下载日志
  61. </el-button>
  62. <el-button
  63. style="margin-left:10px;"
  64. @click="exportList()"
  65. class="filter-item"
  66. type="primary"
  67. size="small"
  68. >点击导出
  69. </el-button>
  70. </div>
  71. <el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}" @selection-change="handleSelectionChange">
  72. <el-table-column
  73. align="center"
  74. type="selection"
  75. width="55">
  76. </el-table-column>
  77. <el-table-column prop="date" label="序号" width="80" align="center">
  78. <template slot-scope="scope">
  79. {{scope.$index+1}}
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="date" label="名称" align="center">
  83. <template slot-scope="scope">
  84. {{scope.row.project_name}}
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="date" label="单价" align="center">
  88. <template slot-scope="scope">
  89. {{scope.row.price}}
  90. </template>
  91. </el-table-column>
  92. <el-table-column prop="date" label="单位" align="center">
  93. <template slot-scope="scope">
  94. {{scope.row.unit}}
  95. </template>
  96. </el-table-column>
  97. <el-table-column prop="date" label="费用类别" align="center">
  98. <template slot-scope="scope">
  99. {{getCostClassify(scope.row.cost_classify)}}
  100. </template>
  101. </el-table-column>
  102. <el-table-column prop="date" label="执行科室" width="140" align="center">
  103. <template slot-scope="scope">
  104. {{getExecutiveSection(scope.row.executive_section)}}
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="国家编码" width="140" align="center">
  108. <template slot-scope="scope">
  109. {{scope.row.medical_code}}
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="状态" width="60" align="center">
  113. <template slot-scope="scope">
  114. <span v-if="scope.row.medical_status ==0"></span>
  115. <span v-if="scope.row.medical_status ==1">停用</span>
  116. <span v-if="scope.row.medical_status ==2">收费</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="date" label="操作" width="300" align="center">
  120. <template slot-scope="scope">
  121. <el-button @click="editHisProject(scope.row.id)" type="primary" size="small">编辑</el-button>
  122. <el-button type="danger" size="small" @click="deleteProject(scope.row.id,scope.$index)">删除</el-button>
  123. <!--<el-button type="primary" size="small" icon="el-icon-refresh-left" @click="toReturn(scope.row.id,scope.row.is_mark)" v-if="$store.getters.xt_user.org_id == 9504 || $store.getters.xt_user.org_id == 10028 || $store.getters.xt_user.org_id == 10138">-->
  124. <!--<span v-if="scope.row.is_mark ==0">备案</span>-->
  125. <!--<span v-if="scope.row.is_mark ==1">撤销</span>-->
  126. <!--</el-button>-->
  127. <el-button type="primary" size="small" icon="el-icon-refresh-left">
  128. <span @click="putOnRecord(scope.row.id)" >目录对照</span>
  129. <span @click="putOnUnRecord(scope.row.id)" >撤消对照</span>
  130. </el-button>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. <el-pagination
  135. @size-change="handleSizeChange"
  136. @current-change="handleCurrentChange"
  137. :page-sizes="[10, 50, 100,500,1000]"
  138. :page-size="10"
  139. background
  140. align="right"
  141. style="margin-top:20px;"
  142. layout="total, sizes, prev, pager, next, jumper"
  143. :total="total"
  144. >
  145. </el-pagination>
  146. <add-project ref="addProject"></add-project>
  147. <editProject ref="editProject"></editProject>
  148. <el-dialog
  149. title="提示"
  150. :visible.sync="dialogVisible"
  151. width="40%"
  152. >
  153. <span>您提交的文档不是系统标准导入模板,请检查您的文档或重新 </span>
  154. <span slot="footer" class="dialog-footer">
  155. <el-button @click="dialogVisible = false">取 消</el-button>
  156. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  157. </span>
  158. </el-dialog>
  159. <el-dialog
  160. title="提示"
  161. :visible.sync="exportLogVisible"
  162. width="40%"
  163. >
  164. <div v-for="(item,index) in logs" :key="index">
  165. <span> {{ item.export_time | parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
  166. <br/>
  167. <br/>
  168. <span>{{getContent(item)}}</span>
  169. <span >点击</span>
  170. <span style="color:blue" @click="generateTxt(item)">查看详情</span>
  171. <br/>
  172. <br/>
  173. </div>
  174. <span slot="footer" class="dialog-footer">
  175. <el-button @click="exportLogVisible = false">取 消</el-button>
  176. <el-button type="primary" @click="exportLogVisible = false">确 定</el-button>
  177. </span>
  178. </el-dialog>
  179. </div>
  180. </template>
  181. <script>
  182. import addProject from './addProject'
  183. import editProject from './editProject'
  184. import { getProjectList,deleteHisProject,getDePartmentList,postProjectInformation } from "@/api/project/project"
  185. import { getDictionaryDataConfig } from "@/utils/data";
  186. import axios from 'axios'
  187. import ProjectExcel from '@/xt_pages/components/ProjectExcel'
  188. import { generateLog } from '@/api/config'
  189. export default {
  190. components:{
  191. addProject,
  192. editProject,
  193. ProjectExcel
  194. },
  195. data(){
  196. return{
  197. search_input:'',
  198. options: [
  199. {value:0,label:'全部'},
  200. {value:1,label: '停用'},
  201. {value:2,label: '收费'}
  202. ],
  203. optionOne:[
  204. {value:0,label:'全部'},
  205. {value:1,label:'是'},
  206. {value:2,label:'否'}
  207. ],
  208. value: '',
  209. limit:10,
  210. page:1,
  211. total:0,
  212. tableData: [],
  213. is_start:0,
  214. is_charge:'',
  215. selectDrug:[],
  216. optionOne: [
  217. {
  218. value: '0',
  219. label: '全部'
  220. }, {
  221. value: '1',
  222. label: '已备案'
  223. }, {
  224. value: '2',
  225. label: '未备案'
  226. }],
  227. is_mark:"",
  228. page:1,
  229. departMentList:[],
  230. dialogVisible:false,
  231. exportLogVisible:false,
  232. logs:[]
  233. }
  234. },
  235. methods:{
  236. putOnUnRecord(id){
  237. var that = this;
  238. let params = {
  239. ids:id.toString(),
  240. record_type: 3,
  241. admin_user_id:this.$store.getters.xt_user.user.id
  242. };
  243. axios.get('http://127.0.0.1:9532/api/uncheckcode/get',{params:params}).then(function(response) {
  244. if (response.data.state == 0) {
  245. that.$message.error(response.data.data.msg);
  246. return false
  247. } else {
  248. if(response.data.data.failed_code == -10){
  249. // that.$message.error(response.data.data.msg)
  250. that.$confirm(response.data.data.msg, '医保错误信息', {
  251. confirmButtonText: '确 定',
  252. type: 'warning'
  253. }).then(() => {
  254. }).catch(() => {
  255. })
  256. }else{
  257. // for (let i = 0; i < that.tableData.length; i++) {
  258. // if (that.tableData[i].id == that.currentObject.id) {
  259. // that.tableData[i].record.is_cancel == 1
  260. // }
  261. // }
  262. }
  263. }
  264. }).catch(function(error) {
  265. })
  266. },
  267. putOnRecord(id){
  268. var that = this;
  269. let params = {
  270. ids:id.toString(),
  271. record_type: 3,
  272. admin_user_id:this.$store.getters.xt_user.user.id
  273. };
  274. axios.get('http://127.0.0.1:9532/api/checkcode/get',{params:params}).then(function(response) {
  275. if (response.data.state == 0) {
  276. that.$message.error(response.data.data.msg);
  277. return false
  278. } else {
  279. if(response.data.data.failed_code == -10){
  280. // that.$message.error(response.data.data.msg)
  281. that.$confirm(response.data.data.msg, '医保错误信息', {
  282. confirmButtonText: '确 定',
  283. type: 'warning'
  284. }).then(() => {
  285. }).catch(() => {
  286. })
  287. }else{
  288. }
  289. }
  290. }).catch(function(error) {
  291. })
  292. },
  293. GDYBBatchPutOnRecord(){
  294. var that = this;
  295. var ids = [];
  296. var idMap = {};
  297. for (const index in this.selectDrug) {
  298. ids.push(this.selectDrug[index].id);
  299. idMap[this.selectDrug[index].id] = this.selectDrug[index].id;
  300. }
  301. let params = {
  302. ids:ids.join(','),
  303. record_type: 3,
  304. admin_user_id:this.$store.getters.xt_user.user.id
  305. };
  306. axios.get('http://127.0.0.1:9532/api/checkcode/get',{params:params}).then(function(response) {
  307. if (response.data.state == 0) {
  308. that.$message.error(response.data.data.msg);
  309. return false
  310. } else {
  311. if(response.data.data.failed_code == -10){
  312. // that.$message.error(response.data.data.msg)
  313. that.$confirm(response.data.data.msg, '医保错误信息', {
  314. confirmButtonText: '确 定',
  315. type: 'warning'
  316. }).then(() => {
  317. }).catch(() => {
  318. })
  319. }else{
  320. }
  321. }
  322. }).catch(function(error) {
  323. })
  324. },
  325. changeStart(){
  326. this.getlist()
  327. },
  328. handleSizeChange(val) {
  329. this.limit = val;
  330. this.getlist()
  331. },
  332. handleCurrentChange(val) {
  333. this.page = val;
  334. this.getlist()
  335. },
  336. searchAction(){
  337. this.getlist()
  338. },
  339. clickSelfPayment(){
  340. this.$refs.selfPayment.show();
  341. },
  342. clickMainTain(){
  343. },
  344. openForm(id){
  345. this.$refs.addProject.show(id);
  346. },
  347. editHisProject(id){
  348. this.$refs.editProject.show(id)
  349. },
  350. getCostClassify(id){
  351. var costClassify = getDictionaryDataConfig('system','cost_classify');
  352. var name = "";
  353. for(let i=0;i<costClassify.length;i++){
  354. if(id == costClassify[i].id){
  355. name = costClassify[i].name
  356. }
  357. }
  358. return name
  359. },
  360. getExecutiveSection(id){
  361. var executiveSection = this.departMentList;
  362. var name = "";
  363. for(let i=0;i<executiveSection.length;i++){
  364. if(id == executiveSection[i].id){
  365. name = executiveSection[i].name
  366. }
  367. }
  368. return name
  369. },
  370. getlist(){
  371. var params = {
  372. keyword:this.search_input,
  373. is_charge:this.is_charge,
  374. is_start:this.is_start,
  375. limit:this.limit,
  376. page:this.page,
  377. is_mark:this.is_mark,
  378. };
  379. getProjectList(params).then(response=>{
  380. if(response.data.state == 1){
  381. var projecList = response.data.data.projecList;
  382. this.tableData = projecList;
  383. var total = response.data.data.total;
  384. this.total = total
  385. }
  386. })
  387. },
  388. deleteProject(id,index){
  389. this.$confirm("确认删除此项目吗?", "删除", {
  390. confirmButtonText: "确 定",
  391. cancelButtonText: "取 消",
  392. type: "warning"
  393. }).then(() => {
  394. deleteHisProject(id).then(response => {
  395. if (response.data.state == 1) {
  396. var msg = response.data.data.msg;
  397. this.$message.success("删除成功");
  398. this.tableData.splice(index, 1);
  399. }
  400. });
  401. })
  402. .catch(() => {});
  403. },
  404. changeOption(){
  405. this.getlist()
  406. },
  407. toRecord(){
  408. var that = this;
  409. axios.get('http://127.0.0.1:9532/sz/api/treatment/get').then(function(response) {
  410. if (response.data.state == 0) {
  411. that.$message.error(response.data.msg);
  412. return false
  413. } else {
  414. that.$message({ message: '备案成功', type: 'success' });
  415. that.getlist()
  416. }
  417. }).catch(function(error) {
  418. })
  419. },
  420. toReturn(id,isMark){
  421. var that = this;
  422. let params = {
  423. 'id':id,
  424. 'type_id':2,
  425. 'is_mark':isMark,
  426. 'admin_user_id':this.$store.getters.xt_user.user.id,
  427. };
  428. axios.get('http://127.0.0.1:9532/sz/api/revocation/get',{params:params}).then(function(response) {
  429. if (response.data.state == 0) {
  430. that.$message.error(response.data.data.msg);
  431. return false
  432. } else {
  433. if(response.data.data.msg == ""){
  434. that.$message.success("备案成功!");
  435. that.getlist()
  436. }
  437. if(response.data.data.msg!=""){
  438. that.$message.error(response.data.data.msg);
  439. that.getlist()
  440. }
  441. }
  442. }).catch(function(error) {
  443. })
  444. },
  445. handleSelectionChange(val) {
  446. this.selectDrug = val;
  447. },
  448. changeRecord(){
  449. this.getlist()
  450. },
  451. BatchDelete() {
  452. if (this.selectDrug.length == 0) {
  453. this.$message.error("请选择要备案的信息");
  454. return false;
  455. }
  456. this.$confirm(
  457. "确认要备案所选记录吗? <br>",
  458. "备案提示",
  459. {
  460. dangerouslyUseHTMLString: true,
  461. confirmButtonText: "确定",
  462. cancelButtonText: "取消",
  463. type: "warning"
  464. }
  465. ).then(() => {
  466. var ids = [];
  467. var idMap = {};
  468. for (const index in this.selectDrug) {
  469. ids.push(this.selectDrug[index].id);
  470. idMap[this.selectDrug[index].id] = this.selectDrug[index].id;
  471. }
  472. var idss = ids.join(',');
  473. let params = {
  474. ids:idss,
  475. admin_user_id:this.$store.getters.xt_user.user.id
  476. };
  477. var that = this;
  478. axios.get('http://127.0.0.1:9532/sz/api/treatment/get',{ params: params }).then(function(response) {
  479. if (response.data.state == 0) {
  480. that.$message.error(response.data.data.msg);
  481. return false
  482. } else {
  483. if(response.data.data.msg == ""){
  484. that.$message.success("备案成功!");
  485. that.getlist()
  486. }
  487. if(response.data.data.msg!=""){
  488. that.$message.error(response.data.data.msg);
  489. that.getlist()
  490. }
  491. }
  492. }).catch(function(error) {
  493. })
  494. });
  495. },
  496. getDartmentList(){
  497. var params = {
  498. limit:this.limit,
  499. page:this.page,
  500. };
  501. getDePartmentList(params).then(response=>{
  502. if(response.data.state == 1){
  503. var department = response.data.data.departMentList;
  504. this.departMentList = department
  505. }
  506. })
  507. },
  508. handleSuccessOne({ results, header }) {
  509. if (header != undefined && header.length > 0) {
  510. var isHasProjectName = header.includes('*项目名称');
  511. var isHasProjectPrice = header.includes('*零价');
  512. var isHasProjectUnit = header.includes('*单位');
  513. var isHasProjectCostClassify = header.includes('*费用类别');
  514. var isHasProjectExecutiveSection = header.includes('*执行科室');
  515. var isHasProjectMedicalCoverage = header.includes('*医保等级');
  516. if (!(isHasProjectName && isHasProjectPrice && isHasProjectUnit && isHasProjectCostClassify && isHasProjectExecutiveSection && isHasProjectMedicalCoverage )) {
  517. this.dialogVisible = true;
  518. return
  519. }
  520. }else {
  521. this.dialogVisible = true;
  522. return
  523. }
  524. var tableData = [];
  525. for(let i=1;i<results.length;i++){
  526. let obj = {"cost_classify_id":0,"medical_insurance_level_id":0,"executive_section_id":0,"tube_color_id":0,"statistical_classification_id":0,"category":0,"specail_project":0,"medical_status":0};
  527. for (var key in results[i]) {
  528. if (results[i]['*项目名称'] === undefined) {
  529. obj['project_name'] = ''
  530. } else {
  531. if (key == '*项目名称') {
  532. obj['project_name'] = results[i][key].replace(/\s/g,"")
  533. }
  534. }
  535. if (results[i]['*零价'] === undefined) {
  536. obj['price'] = ''
  537. } else {
  538. if (key == '*零价') {
  539. obj['price'] = results[i][key].replace(/\s/g,"")
  540. }
  541. }
  542. if (results[i]['*单位'] === undefined) {
  543. obj['unit'] = ''
  544. } else {
  545. if (key == '*单位') {
  546. obj['unit'] = results[i][key].replace(/\s/g,"")
  547. }
  548. }
  549. if (results[i]['*费用类别'] === undefined) {
  550. obj['cost_classify'] = ''
  551. } else {
  552. if (key == '*费用类别') {
  553. obj['cost_classify'] = results[i][key].replace(/\s/g,"")
  554. }
  555. }
  556. if (results[i]['*执行科室'] === undefined) {
  557. obj['executive_section'] = ''
  558. } else {
  559. if (key == '*执行科室') {
  560. obj['executive_section'] = results[i][key].replace(/\s/g,"")
  561. }
  562. }
  563. if (results[i]['*医保等级'] === undefined) {
  564. obj['medical_coverage'] = ''
  565. } else {
  566. if (key == '*医保等级') {
  567. obj['medical_coverage'] = results[i][key].replace(/\s/g,"")
  568. }
  569. }
  570. if (results[i]['拼音'] === undefined) {
  571. obj['pinyin'] = ''
  572. } else {
  573. if (key == '拼音') {
  574. obj['pinyin'] = results[i][key].replace(/\s/g,"")
  575. }
  576. }
  577. if (results[i]['五笔'] === undefined) {
  578. obj['wubi'] = ''
  579. } else {
  580. if (key == '五笔') {
  581. obj['wubi'] = results[i][key].replace(/\s/g,"")
  582. }
  583. }
  584. if (results[i]['统计分类'] === undefined) {
  585. obj['statistical_classification'] = ''
  586. } else {
  587. if (key == '统计分类') {
  588. obj['statistical_classification'] = results[i][key].replace(/\s/g,"")
  589. }
  590. }
  591. if (results[i]['是否特病目录'] === undefined) {
  592. obj['disease_directory'] = ''
  593. } else {
  594. if (key == '是否特病目录') {
  595. obj['disease_directory'] = results[i][key].replace(/\s/g,"")
  596. }
  597. }
  598. if (results[i]['是否备案'] === undefined) {
  599. obj['is_record'] = ''
  600. } else {
  601. if (key == '是否备案') {
  602. obj['is_record'] = results[i][key].replace(/\s/g,"")
  603. }
  604. }
  605. if (results[i]['国家编码'] === undefined) {
  606. obj['medical_code'] = ''
  607. } else {
  608. if (key == '国家编码') {
  609. obj['medical_code'] = results[i][key].replace(/\s/g,"")
  610. }
  611. }
  612. if (results[i]['试管颜色'] === undefined) {
  613. obj['tube_color'] = ''
  614. } else {
  615. if (key == '试管颜色') {
  616. obj['tube_color'] = results[i][key].replace(/\s/g,"")
  617. }
  618. }
  619. if (results[i]['单次用量'] === undefined) {
  620. obj['single_dose'] = ''
  621. } else {
  622. if (key == '单次用量') {
  623. obj['single_dose'] = results[i][key].replace(/\s/g,"")
  624. }
  625. }
  626. if (results[i]['用法'] === undefined) {
  627. obj['delivery_way'] = ''
  628. } else {
  629. if (key == '用法') {
  630. obj['delivery_way'] = results[i][key].replace(/\s/g,"")
  631. }
  632. }
  633. if (results[i]['频率'] === undefined) {
  634. obj['execution_frequency'] = ''
  635. } else {
  636. if (key == '频率') {
  637. obj['execution_frequency'] = results[i][key].replace(/\s/g,"")
  638. }
  639. }
  640. if (results[i]['天数'] === undefined) {
  641. obj['number_days'] = ''
  642. } else {
  643. if (key == '天数') {
  644. obj['number_days'] = results[i][key].replace(/\s/g,"")
  645. }
  646. }
  647. if (results[i]['总量'] === undefined) {
  648. obj['total'] = ''
  649. } else {
  650. if (key == '总量') {
  651. obj['total'] = results[i][key].replace(/\s/g,"")
  652. }
  653. }
  654. if (results[i]['状态'] === undefined) {
  655. obj['medical_status'] = ''
  656. } else {
  657. if (key == '状态') {
  658. obj['medical_status'] = results[i][key].replace(/\s/g,"")
  659. }
  660. }
  661. if (results[i]['类别'] === undefined) {
  662. obj['category'] = ''
  663. } else {
  664. if (key == '类别') {
  665. obj['category'] = results[i][key].replace(/\s/g,"")
  666. }
  667. }
  668. if (results[i]['特检项目'] === undefined) {
  669. obj['specail_project'] = ''
  670. } else {
  671. if (key == '特检项目') {
  672. obj['specail_project'] = results[i][key].replace(/\s/g,"")
  673. }
  674. }
  675. if (results[i]['社保目录编码'] === undefined) {
  676. obj['social_security_directory_code'] = ''
  677. } else {
  678. if (key == '社保目录编码') {
  679. obj['social_security_directory_code'] = results[i][key].replace(/\s/g,"")
  680. }
  681. }
  682. if (results[i]['备案日期'] === undefined) {
  683. obj['record_date'] = ''
  684. } else {
  685. if (key == '备案日期') {
  686. obj['record_date'] = results[i][key].replace(/\s/g,"")
  687. }
  688. }
  689. if (results[i]['备注'] === undefined) {
  690. obj['remark'] = ''
  691. } else {
  692. if (key == '备注') {
  693. obj['remark'] = results[i][key].replace(/\s/g,"")
  694. }
  695. }
  696. }
  697. tableData.push(obj);
  698. for(let i=0;i<tableData.length;i++){
  699. if(tableData[i].disease_directory == ""){
  700. tableData[i].disease_directory = 0
  701. }
  702. if(tableData[i].disease_directory == "是"){
  703. tableData[i].disease_directory = 1
  704. }
  705. if(tableData[i].disease_directory == "否"){
  706. tableData[i].disease_directory = 2
  707. }
  708. if(tableData[i].is_record == ""){
  709. tableData[i].is_record = 0
  710. }
  711. if(tableData[i].is_record == "是"){
  712. tableData[i].is_record = 1
  713. }
  714. if(tableData[i].is_record == "否"){
  715. tableData[i].is_record = 2
  716. }
  717. if(tableData[i].category == ""){
  718. tableData[i].category = 0
  719. }
  720. if(tableData[i].category == "常规诊疗项目"){
  721. tableData[i].category = 1
  722. }
  723. if(tableData[i].category == "辅助器具项目"){
  724. tableData[i].category = 2
  725. }
  726. if(tableData[i].category == "加收项目"){
  727. tableData[i].category = 3
  728. }
  729. if(tableData[i].specail_project == ""){
  730. tableData[i].specail_project = 0
  731. }
  732. if(tableData[i].specail_project == "是"){
  733. tableData[i].specail_project = 1
  734. }
  735. if(tableData[i].specail_project == "否"){
  736. tableData[i].specail_project = 2
  737. }
  738. if(tableData[i].medical_status == ""){
  739. tableData[i].medical_status = 0
  740. }
  741. if(tableData[i].medical_status == "停用"){
  742. tableData[i].medical_status = 1
  743. }
  744. if(tableData[i].medical_status == "收费"){
  745. tableData[i].medical_status = 2
  746. }
  747. }
  748. }
  749. let params = {
  750. 'projects':tableData
  751. };
  752. console.log("params222",params);
  753. postProjectInformation(params).then(response=>{
  754. if(response.data.state == 1){
  755. var msg = response.data.data.msg;
  756. this.$message.success("导入成功!");
  757. this.getlist()
  758. }else{
  759. this.$message.error("导入失败")
  760. }
  761. })
  762. },
  763. generateTxt: function(log) {
  764. var content = '';
  765. var errlog = log.err_logs;
  766. content = this.getContent(log);
  767. for (let i = 0; i < errlog.length; i++) {
  768. if (content.length == 0) {
  769. content = errlog[i].err_msg
  770. } else {
  771. content = content + '\n' + errlog[i].err_msg
  772. }
  773. }
  774. var url = new Blob(['\ufeff' + content], { type: 'text/txt,charset=UTF-8' });
  775. if (typeof url === 'object' && url instanceof Blob) {
  776. url = URL.createObjectURL(url) // 创建blob地址
  777. }
  778. const aLink = document.createElement('a');
  779. aLink.href = url;
  780. aLink.download = this.timestampToTime(log.export_time) + '患者导入日志' + '.txt';
  781. aLink.click()
  782. },
  783. getContent(log) {
  784. return '您导入的文档共' + log.total_num + '条患者数据' + ',' + '已成功导入' + log.success_num + '条,导入失败' + log.fail_num + '条,'
  785. },
  786. timestampToTime(timestamp) {
  787. var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  788. var Y = date.getFullYear() + '年';
  789. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月';
  790. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日 ';
  791. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时';
  792. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + '分';
  793. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()) + '秒';
  794. return Y + M + D + h + m + s
  795. },
  796. generateLog() {
  797. let params = {
  798. 'log_type': 6
  799. };
  800. generateLog(params).then(
  801. response => {
  802. if (response.data.state === 1) {
  803. this.logs = response.data.data.logs;
  804. this.exportLogVisible = true
  805. } else {
  806. this.$message.error(response.data.msg)
  807. }
  808. }
  809. )
  810. },
  811. getDictionaryDataConfig(module, filed_name) {
  812. return getDictionaryDataConfig(module, filed_name)
  813. },
  814. exportList(){
  815. import('@/vendor/Export2Excel').then(excel => {
  816. for(let i=0;i<this.tableData.length;i++){
  817. for(let j=0;j<this.getDictionaryDataConfig('system','cost_classify').length;j++){
  818. if(this.tableData[i].cost_classify == this.getDictionaryDataConfig('system','cost_classify')[j].id){
  819. this.tableData[i].cost_classify_name = this.getDictionaryDataConfig('system','cost_classify')[j].name
  820. }
  821. }
  822. for(let y=0;y<this.getDictionaryDataConfig('system','medical_insurance_level').length;y++){
  823. if(this.tableData[i].medical_coverage == this.getDictionaryDataConfig('system','medical_insurance_level')[y].id){
  824. this.tableData[i].medical_coverage_name = this.getDictionaryDataConfig('system','medical_insurance_level')[y].name
  825. }
  826. }
  827. for(let a=0;a<this.departMentList.length;a++){
  828. if(this.tableData[i].executive_section == this.departMentList[a].id){
  829. this.tableData[i].executive_section_name = this.departMentList[a].name
  830. }
  831. }
  832. }
  833. console.log("this.table",this.tableData)
  834. const tHeader = ['项目名称','零价','单位','费用类别','执行科室','医保等级','国家编码','社保目录编码']
  835. const filterVal = ['project_name', 'price','unit','cost_classify_name','executive_section_name','medical_coverage_name','medical_code','social_security_directory_code']
  836. const data = this.formatJson(filterVal,this.tableData)
  837. excel.export_json_to_excel({
  838. header: tHeader,
  839. data,
  840. filename: '项目信息'
  841. })
  842. this.downloadLoading = false
  843. })
  844. },
  845. formatJson(filterVal, jsonData) {
  846. return jsonData.map(v => filterVal.map(j => v[j]))
  847. },
  848. },
  849. created(){
  850. this.getlist();
  851. this.getDartmentList()
  852. }
  853. }
  854. </script>