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

project.vue 30KB

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