index.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. <template>
  2. <!-- 配送目录管理 -->
  3. <div style="display: flex">
  4. <el-card style="width: 18%; margin-right: 18px; border-radius: 6px">
  5. <el-tabs v-model="activeNametree" type="card" @tab-click="tabClick" stretch>
  6. <!-- <el-tab-pane label="按分类" name="grp"></el-tab-pane> -->
  7. <el-tab-pane label="按机构" name="org"></el-tab-pane>
  8. </el-tabs>
  9. <el-tree
  10. :data="data"
  11. :props="defaultProps"
  12. node-key="spdId"
  13. @node-click="handleNodeClick"
  14. default-expand-all="true"
  15. style="margin-top: 10px"
  16. ></el-tree>
  17. </el-card>
  18. <div class="right-common-box">
  19. <el-form :model="listQuery" ref="listQuery" :inline="true" label-width="90px">
  20. <!-- <el-form-item label="耗材编码" prop="materialId" class="long">
  21. <el-input
  22. v-model="listQuery.materialId"
  23. placeholder="请输入耗材编码"
  24. ></el-input>
  25. </el-form-item> -->
  26. <el-form-item size="mini" label="医保编码" prop="hiCode" class="long">
  27. <el-input v-model="listQuery.hiCode" placeholder="请输入医保编码"></el-input>
  28. </el-form-item>
  29. <el-form-item size="mini" label="耗材名称" prop="prodName" class="long">
  30. <el-input v-model="listQuery.prodName" placeholder="请输入耗材名称"></el-input>
  31. </el-form-item>
  32. <el-form-item size="mini" label="规格" prop="spec" class="long">
  33. <el-input v-model="listQuery.spec" placeholder="请输入规格"></el-input>
  34. </el-form-item>
  35. <el-form-item size="mini" label="型号" prop="mol" class="long">
  36. <el-input v-model="listQuery.mol" placeholder="请输入型号"></el-input>
  37. </el-form-item>
  38. <el-form-item size="mini" label="生产企业" prop="prodEntp" class="long">
  39. <el-input v-model="listQuery.prodEntp" placeholder="请输入生产企业"></el-input>
  40. </el-form-item>
  41. <el-form-item size="mini" label="是否集采" prop="isFas" class="long">
  42. <el-select v-model="listQuery.isFas" placeholder="请选择是否集采" clearable>
  43. <el-option
  44. v-for="item in isFasData"
  45. :key="item.value"
  46. :label="item.name"
  47. :value="item.value"
  48. ></el-option>
  49. </el-select>
  50. </el-form-item>
  51. <!-- <el-form-item label="集采批次" prop="fasBtch" class="long">
  52. <el-input v-model="listQuery.fasBtch" placeholder="请输入集采批次"></el-input>
  53. </el-form-item> -->
  54. <el-form-item size="mini" label="耗材类别" prop="mcsType" class="long">
  55. <el-select v-model="listQuery.mcsType" placeholder="请选择耗材类别" clearable>
  56. <el-option
  57. v-for="item in mcsTypeData"
  58. :key="item.value"
  59. :label="item.name"
  60. :value="item.value"
  61. ></el-option>
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item size="mini" label="生产来源" prop="prodSouc" class="long">
  65. <el-select v-model="listQuery.prodSouc" placeholder="请选择生产来源" clearable>
  66. <el-option
  67. v-for="item in SoucData"
  68. :key="item.value"
  69. :label="item.name"
  70. :value="item.value"
  71. ></el-option>
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item size="mini" label="材质" prop="matl" class="long">
  75. <el-input v-model="listQuery.matl" placeholder="请输入材质"></el-input>
  76. </el-form-item>
  77. <el-form-item size="mini" label="注册证号" prop="regcertno" class="long">
  78. <el-input v-model="listQuery.regcertno" placeholder="请输入注册证号"></el-input>
  79. </el-form-item>
  80. <el-form-item size="mini" label="目录来源" prop="isPub" class="long">
  81. <el-select v-model="listQuery.isPub" placeholder="请选择目录来源" clearable>
  82. <el-option
  83. v-for="item in isPubData"
  84. :key="item.value"
  85. :label="item.name"
  86. :value="item.value"
  87. ></el-option>
  88. </el-select>
  89. </el-form-item>
  90. <el-form-item size="mini" label="当前状态" prop="status" class="long">
  91. <el-select v-model="listQuery.status" placeholder="请选择当前状态" clearable>
  92. <el-option
  93. v-for="item in statusData"
  94. :key="item.value"
  95. :label="item.name"
  96. :value="item.value"
  97. ></el-option>
  98. </el-select>
  99. </el-form-item>
  100. <!-- <el-form-item>
  101. <el-button type="primary" @click="getHospConsum('search')">查询</el-button>
  102. <el-button @click="reset('consumableData')">重置</el-button>
  103. </el-form-item> -->
  104. </el-form>
  105. <div class="right-button">
  106. <el-button type="primary" @click="getHospConsum('search')">查询</el-button>
  107. <el-button @click="reset('consumableData')">重置</el-button>
  108. </div>
  109. <div class="right-button" v-if="btnShow">
  110. <el-button type="primary" icon="el-icon-plus" @click="handleUpdate('search')"
  111. >挂网目录新增
  112. </el-button>
  113. <el-button type="primary" icon="el-icon-plus" @click="handleFadd('search')"
  114. >非挂网目录新增
  115. </el-button>
  116. </div>
  117. <el-table
  118. v-loading="listLoading"
  119. element-loading-text="加载中"
  120. :data="list"
  121. fit
  122. height="500"
  123. stripe
  124. border
  125. >
  126. <template slot="empty">
  127. <img src="@/assets/nopage.png" alt />
  128. <p>暂无数据</p>
  129. </template>
  130. <el-table-column fixed type="index" label="序号" width="60" />
  131. <el-table-column label="耗材名称" min-width="340">
  132. <template slot-scope="scope">
  133. <mcs-info :info="scope.row"></mcs-info>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="医保编码" prop="hiCode" width="80" />
  137. <el-table-column label="规格" prop="spec" width="80" />
  138. <el-table-column label="型号" prop="mol" width="80" />
  139. <el-table-column label="材质" prop="matl" width="80" />
  140. <el-table-column label="是否集采" prop="isFas" width="80">
  141. <template #default="{ row }">
  142. <span v-if="row.isFas == '1'">否</span>
  143. <span v-if="row.isFas == '0'">是</span>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="采购单位" prop="prcUnt" width="80" />
  147. <el-table-column label="采购价" prop="purcPric" width="80" />
  148. <el-table-column label="驳回原因" prop="rejtRea" width="80" />
  149. <el-table-column label="目录来源" prop="isPub" width="80" fixed="right">
  150. <template #default="{ row }">
  151. <span v-if="row.isPub == '0'">挂网</span>
  152. <span v-if="row.isPub == '1'">非挂网</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="当前状态" prop="status" width="80" fixed="right">
  156. <template #default="{ row }">
  157. <span v-if="row.status == 'A'">待审核</span>
  158. <span v-if="row.status == 'B'">审核中</span>
  159. <span v-if="row.status == 'C'">审核通过</span>
  160. <span v-if="row.status == 'R'">驳回
  161. </span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column fixed="right" label="操作" width="160">
  165. <template slot-scope="scope">
  166. <div>
  167. <el-button type="text" @click="handleDui(scope.row)">编辑</el-button>
  168. <!-- <el-button type="text" v-if="scope.row.stas == '1'" @click="handleCanc(scope.row)">取消对码</el-button> -->
  169. <!-- <el-button type="text" @click="handlePrice(scope.row)">申请调价</el-button> -->
  170. </div>
  171. </template>
  172. </el-table-column>
  173. </el-table>
  174. <!--分页-->
  175. <yl-pagination
  176. v-show="total > 0"
  177. :total="total"
  178. :page.sync="listQuery.current"
  179. :limit.sync="listQuery.size"
  180. @pagination="getHospConsum"
  181. />
  182. </div>
  183. <el-dialog title="调价申请" :visible.sync="dialogPrice" width="55%">
  184. <el-form
  185. ref="dataForm"
  186. :rules="rules"
  187. :model="temp"
  188. label-position="right"
  189. label-width="80px"
  190. >
  191. <el-row>
  192. <el-col :span="8">
  193. <el-form-item label="药品编码" prop="drugListId">
  194. <el-input v-model.trim="temp.drugListId" readonly placeholder="请输入" />
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="8">
  198. <el-form-item label="药品名称" prop="drugName">
  199. <el-input v-model.trim="temp.drugName" readonly placeholder="请输入" />
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="8">
  203. <el-form-item label="剂型" prop="dosformName">
  204. <el-input v-model.trim="temp.dosformName" readonly placeholder="请输入" />
  205. </el-form-item>
  206. </el-col>
  207. </el-row>
  208. <el-row>
  209. <el-col :span="8">
  210. <el-form-item label="规格" prop="specName">
  211. <el-input v-model.trim="temp.specName" readonly placeholder="请输入" />
  212. </el-form-item>
  213. </el-col>
  214. <el-col :span="8">
  215. <el-form-item label="包装单位" prop="pacUnt">
  216. <el-input v-model.trim="temp.pacUnt" readonly placeholder="请输入" />
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="8">
  220. <el-form-item label="生产企业" prop="prodEntp">
  221. <el-input v-model.trim="temp.prodEntp" readonly placeholder="请输入" />
  222. </el-form-item>
  223. </el-col>
  224. </el-row>
  225. <el-row>
  226. <el-col :span="8">
  227. <el-form-item label="当前价格" prop="pricInit">
  228. <el-input v-model.trim="temp.pricInit" readonly placeholder="请输入" />
  229. </el-form-item>
  230. </el-col>
  231. <el-col :span="8">
  232. <el-form-item label="调整价格" prop="pricCurr">
  233. <el-input v-model.trim="temp.pricCurr" placeholder="请输入调整后价格" />
  234. </el-form-item>
  235. </el-col>
  236. </el-row>
  237. <el-row>
  238. <el-form-item label="申请原因" prop="appyRea">
  239. <el-input
  240. type="textarea"
  241. v-model.trim="temp.appyRea"
  242. placeholder="请输入调价原因"
  243. />
  244. </el-form-item>
  245. </el-row>
  246. <el-row>
  247. <el-form-item label="上传文件" prop="fileId" :rules="rules.uploadRequired">
  248. <yl-upload :fileId="temp.fileId" @getUpload="getUpload" urlName="acco">
  249. <template v-slot:dec>只能上传pdf文件</template>
  250. </yl-upload>
  251. </el-form-item>
  252. </el-row>
  253. </el-form>
  254. <div slot="footer" class="dialog-footer">
  255. <el-button @click="dialogPrice = false">取消</el-button>
  256. <el-button type="primary" @click="commitData()" :loading="ccLoad">确认</el-button>
  257. </div>
  258. </el-dialog>
  259. <el-dialog title="选择耗材" :visible.sync="dialogAdd" width="75%">
  260. <template>
  261. <el-form :model="listQueryadd" ref="listQueryadd" :inline="true">
  262. <el-form-item label="耗材名称" prop="prodName" class="long">
  263. <el-input
  264. v-model="listQueryadd.prodName"
  265. placeholder="请输入耗材名称"
  266. ></el-input>
  267. </el-form-item>
  268. <el-form-item label="规格" prop="spec" class="long">
  269. <el-input v-model="listQueryadd.spec" placeholder="请输入耗材规格"></el-input>
  270. </el-form-item>
  271. <!-- <el-form-item label="耗材编码" prop="materialId" class="long">
  272. <el-input
  273. v-model="listQueryadd.materialId"
  274. placeholder="请输入耗材编码"
  275. ></el-input>
  276. </el-form-item> -->
  277. <el-form-item label="医保编码" prop="hiCode" class="long">
  278. <el-input
  279. v-model="listQueryadd.hiCode"
  280. placeholder="请输入医保编码"
  281. ></el-input>
  282. </el-form-item>
  283. <el-form-item label="是否集采" prop="isFas" class="long">
  284. <el-select
  285. v-model="listQueryadd.isFas"
  286. placeholder="请选择是否集采"
  287. clearable
  288. >
  289. <el-option
  290. v-for="item in isFasData"
  291. :key="item.value"
  292. :label="item.name"
  293. :value="item.value"
  294. ></el-option>
  295. </el-select>
  296. </el-form-item>
  297. <!-- <el-form-item label="对码状态" prop="stas">
  298. <el-select
  299. v-model="listQuery.stas"
  300. placeholder="请选择对码状态"
  301. clearable
  302. >
  303. <el-option
  304. v-for="item in crspFlgOption"
  305. :key="item.value"
  306. :label="item.name"
  307. :value="item.value"
  308. ></el-option>
  309. </el-select>
  310. </el-form-item> -->
  311. <el-form-item>
  312. <el-button type="primary" @click="getdialog('search')">查询</el-button>
  313. <el-button @click="resetdialog('consumableData')">重置</el-button>
  314. </el-form-item>
  315. </el-form>
  316. <el-table
  317. ref="multipleTable"
  318. v-loading="listdialogLoading"
  319. element-loading-text="加载中"
  320. fit
  321. stripe
  322. border
  323. :data="consumableData"
  324. border
  325. style="width: 100%"
  326. row-key="id"
  327. height="500"
  328. @selection-change="handleSelectionChange"
  329. highlight-current-row
  330. >
  331. <el-table-column
  332. type="selection"
  333. :selectable="selected"
  334. :reserve-selection="true"
  335. width="55"
  336. ></el-table-column>
  337. <el-table-column prop="hiCode" label="医保编码" width="150"> </el-table-column>
  338. <el-table-column prop="prodName" label="耗材名称" width="180">
  339. </el-table-column>
  340. <el-table-column prop="pubonlnPric" label="挂网价格" width="180">
  341. </el-table-column>
  342. <el-table-column prop="isFas" label="是否集采" width="120">
  343. <template #default="{ row }">
  344. <span v-if="row.isFas == '1'">否</span>
  345. <span v-if="row.isFas == '0'">是</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column prop="fasBtch" label="集采批次"> </el-table-column>
  349. <!-- <el-table-column prop="splb" label="商品类别" width="120">
  350. </el-table-column>
  351. <el-table-column prop="spfl" label="商品分类" width="120">
  352. </el-table-column> -->
  353. <el-table-column prop="spec" label="规格"> </el-table-column>
  354. <el-table-column prop="mol" label="型号"> </el-table-column>
  355. <el-table-column prop="matl" label="材质"> </el-table-column>
  356. <el-table-column prop="pacmatl" label="包装材质"> </el-table-column>
  357. <el-table-column prop="prodSouc" label="生产来源">
  358. <template #default="{ row }">
  359. <span v-if="row.prodSouc == '1'">国产</span>
  360. <span v-if="row.prodSouc == '0'">进口</span>
  361. </template>
  362. </el-table-column>
  363. <el-table-column prop="regcertno" label="注册证号"> </el-table-column>
  364. <el-table-column prop="prodEntp" label="生产企业" width="120">
  365. </el-table-column>
  366. <el-table-column prop="agnt" label="代理企业" width="180"> </el-table-column>
  367. </el-table>
  368. <div slot="footer" class="dialog-footer">
  369. <el-button type="primary" @click="handleConfirm" :loading="addLoading"
  370. >确认</el-button
  371. >
  372. </div>
  373. <!-- <el-form :model="form" ref="form" :rules="rules">
  374. <el-table
  375. :data="form.splerData"
  376. border
  377. style="width: 100%"
  378. v-loading="supLoading"
  379. >
  380. <el-table-column
  381. fixed
  382. prop="splerDrugName"
  383. label="药品名称"
  384. width="150"
  385. >
  386. </el-table-column>
  387. <el-table-column
  388. prop="splerDosformName"
  389. label="剂型名称"
  390. width="120"
  391. >
  392. </el-table-column>
  393. <el-table-column prop="splerProdentpName" label="生产企业">
  394. </el-table-column>
  395. <el-table-column
  396. prop="splerDrugListId"
  397. label="药品编码"
  398. width="120"
  399. >
  400. </el-table-column>
  401. <el-table-column prop="address" label="规格" width="250">
  402. <template slot-scope="scope">
  403. <div class="drug-name">
  404. {{"供应商规格 【" +scope.row.splerSpecName +"*" +scope.row.splerPrepunt +"/" +scope.row.splerPacUnt +"】"}}
  405. </div>
  406. </template>
  407. </el-table-column>
  408. <el-table-column prop="address" label="转换比" width="150">
  409. <template slot-scope="scope">
  410. <el-form-item :prop="'splerData.' + scope.$index + '.convrat'" :rules="{required: true,message: '输入转换比',trigger: 'change'}" >
  411. <el-input v-model="scope.row.convrat" placeholder="请输入转换比"></el-input>
  412. </el-form-item>
  413. </template>
  414. </el-table-column>
  415. <el-table-column fixed="right" label="操作" width="60">
  416. <template slot-scope="scope">
  417. <el-button
  418. @click="handleClick(scope.row, scope.$index)"
  419. type="text"
  420. size="small"
  421. >对码</el-button
  422. >
  423. </template>
  424. </el-table-column>
  425. </el-table>
  426. </el-form> -->
  427. <!--分页-->
  428. <yl-pagination
  429. v-show="totalC > 0"
  430. :total="totalC"
  431. :page.sync="listQueryadd.current"
  432. :limit.sync="listQueryadd.size"
  433. @pagination="getdialog"
  434. />
  435. </template>
  436. </el-dialog>
  437. </div>
  438. </template>
  439. <script>
  440. import ylPagination from "@/components/yl-pagination";
  441. import mcsInfo from "@/views/components/mcs-info.vue"
  442. import {
  443. selectSplerMcsList,
  444. selectMcsList,
  445. saveSplerMcs,
  446. PricChg,
  447. QueryHospList,
  448. QueryHospDrugList,
  449. QuerySplerDrugList,
  450. DrugMatch,
  451. CancMatch,
  452. selectSpdList,
  453. } from "@/api/consumCataManage-sup/index";
  454. import rulesR from "@/utils/rules";
  455. import ylUpload from "@/components/yl-upload";
  456. export default {
  457. components: {
  458. ylPagination,
  459. ylUpload,
  460. mcsInfo,
  461. },
  462. data() {
  463. return {
  464. activeName: "grp",
  465. rulesR,
  466. spdId: null,
  467. data: [],
  468. defaultProps: {
  469. children: "children",
  470. label: "spdName",
  471. },
  472. listQuery: {
  473. current: 1,
  474. size: 10,
  475. materialId: "",
  476. spec: "",
  477. hiCode: "",
  478. isFas: "",
  479. fasBtch: "",
  480. mol: "",
  481. prodSouc: "",
  482. mcsType: "",
  483. matl: "",
  484. prodEntp: "",
  485. prodName: "",
  486. status: "",
  487. regcertno:"",
  488. isPub:"",
  489. },
  490. listLoading: false,
  491. list: [],
  492. total: 0,
  493. tableLoading: false,
  494. supLoading: false,
  495. tableData: [],
  496. crspFlgOption: [
  497. { value: "0", name: "未对码" },
  498. { value: "1", name: "已对码" },
  499. ],
  500. isFasData: [
  501. { value: "0", name: "是" },
  502. { value: "1", name: "否" },
  503. ],
  504. mcsTypeData: [
  505. { value: "0", name: "普通耗材" },
  506. { value: "1", name: "高值耗材" },
  507. { value: "2", name: "试剂" },
  508. ],
  509. SoucData: [
  510. { value: "1", name: "国产" },
  511. { value: "0", name: "进口" },
  512. ],
  513. statusData: [
  514. { value: "A", name: "待审核" },
  515. { value: "B", name: "审核中" },
  516. { value: "C", name: "审核通过" },
  517. { value: "R", name: "驳回" },
  518. ],
  519. isPubData: [
  520. { value: "0", name: "挂网" },
  521. { value: "1", name: "非挂网" },
  522. ],
  523. dialogPrice: false,
  524. dialogDui: false,
  525. ccLoad: false,
  526. temp: {
  527. drugListId: "",
  528. drugName: "",
  529. dosformName: "",
  530. specName: "",
  531. pacUnt: "",
  532. prodEntp: "",
  533. pricInit: "",
  534. pricCurr: "",
  535. appyRea: "",
  536. fileId: "",
  537. },
  538. rules: {
  539. pricCurr: [
  540. {
  541. required: true,
  542. message: "调整价格不能为空",
  543. trigger: "blur",
  544. },
  545. {
  546. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  547. message: "请输入数字,最多两位小数",
  548. trigger: "blur",
  549. },
  550. ],
  551. appyRea: [
  552. {
  553. required: true,
  554. message: "申请原因不能为空",
  555. trigger: "blur",
  556. },
  557. ],
  558. num: [
  559. {
  560. required: true,
  561. message: "请输入转换比",
  562. trigger: "change",
  563. },
  564. ],
  565. uploadRequired: [{ required: true, message: "请上传文件", trigger: "change" }],
  566. },
  567. tableData: [
  568. {
  569. date: "2016-05-02",
  570. name: "王小虎",
  571. province: "上海",
  572. city: "普陀区",
  573. address: "上海市普陀区金沙江路 1518 弄",
  574. zip: 200333,
  575. },
  576. {
  577. date: "2016-05-04",
  578. name: "王小虎",
  579. province: "上海",
  580. city: "普陀区",
  581. address: "上海市普陀区金沙江路 1517 弄",
  582. zip: 200333,
  583. },
  584. {
  585. date: "2016-05-01",
  586. name: "王小虎",
  587. province: "上海",
  588. city: "普陀区",
  589. address: "上海市普陀区金沙江路 1519 弄",
  590. zip: 200333,
  591. },
  592. {
  593. date: "2016-05-03",
  594. name: "王小虎",
  595. province: "上海",
  596. city: "普陀区",
  597. address: "上海市普陀区金沙江路 1516 弄",
  598. zip: 200333,
  599. },
  600. ],
  601. consumableData: [],
  602. form: {
  603. splerData: [],
  604. },
  605. // 省平台目录
  606. listdialogLoading: false,
  607. dialogAdd: false,
  608. listQueryadd: {
  609. materialId: "",
  610. materialId: "",
  611. spec: "",
  612. hiCode: "",
  613. isFas: "",
  614. fasBtch: "",
  615. mol: "",
  616. current: 1,
  617. size: 10,
  618. },
  619. totalC: false,
  620. addLoading: false,
  621. insertMcsList: [],
  622. // tree
  623. activeNametree: "org",
  624. btnShow: false,
  625. };
  626. },
  627. methods: {
  628. tabClick(tab) {
  629. if (tab.label == "按机构") {
  630. this.defaultProps.label = "spdName";
  631. }
  632. // else if(tab.label == "按分类"){
  633. // // this.getData4();
  634. // // this.defaultProps.label = 'orgGrpName'
  635. // // this.listQuery.type = 'grp';
  636. // }
  637. },
  638. // 上传文件
  639. getUpload(id) {
  640. this.temp.fileId = id;
  641. if (id) {
  642. this.$refs.dataForm.clearValidate("fileId");
  643. } else {
  644. this.$refs.dataForm.validateField("fileId");
  645. }
  646. },
  647. validateField(form, index) {
  648. let result = true;
  649. for (let item of this.$refs[form].fields) {
  650. if (item.prop.split(".")[1] == index) {
  651. this.$refs[form].validateField(item.prop, (error) => {
  652. if (error != "") {
  653. result = false;
  654. }
  655. });
  656. }
  657. if (!result) break;
  658. }
  659. return result;
  660. },
  661. // 搜索获取医院药品列表
  662. getHospConsum(type) {
  663. if (type == "search") {
  664. this.listQuery.current = 1;
  665. }
  666. this.listLoading = true;
  667. // this.spdId = this.$route.query.spdId;
  668. this.listQuery.spdId = this.spdId;
  669. selectSplerMcsList(this.listQuery)
  670. .then((res) => {
  671. this.list = res.data.records;
  672. this.total = res.data.total;
  673. this.listLoading = false;
  674. })
  675. .catch((err) => {
  676. this.listLoading = false;
  677. });
  678. },
  679. // 获取新增目录弹框数据
  680. getdialog(type) {
  681. if (type == "search") {
  682. this.listQueryadd.current = 1;
  683. }
  684. this.listdialogLoading = true;
  685. // this.listQuery.spdId = this.spdId;
  686. selectMcsList(this.listQueryadd)
  687. .then((res) => {
  688. this.consumableData = res.data.records;
  689. this.totalC = res.data.total;
  690. this.listdialogLoading = false;
  691. })
  692. .catch((err) => {
  693. this.listdialogLoading = false;
  694. });
  695. },
  696. // 点击获取医院药品列表
  697. handleNodeClick(data) {
  698. console.log(data, "data");
  699. this.listLoading = true;
  700. this.spdId = data.spdId;
  701. this.listQuery.spdId = this.spdId;
  702. selectSplerMcsList(this.listQuery)
  703. .then((res) => {
  704. this.list = res.data.records;
  705. this.total = res.data.total;
  706. this.listLoading = false;
  707. console.log(res, "医院目录");
  708. this.btnShow = true;
  709. })
  710. .catch((err) => {
  711. this.listLoading = false;
  712. });
  713. },
  714. // 获取医院列表
  715. getData(type) {
  716. this.data = [];
  717. this.listLoading = true;
  718. selectSpdList()
  719. .then((res) => {
  720. this.listQuery.spdId = res.data[0].spdId;
  721. this.data = res.data;
  722. console.log(this.data, "dadad");
  723. this.listLoading = false;
  724. })
  725. .catch((err) => {
  726. this.listLoading = false;
  727. });
  728. },
  729. reset(type) {
  730. if (type === "consumableData") {
  731. this.$refs.listQuery.resetFields();
  732. this.getHospConsum();
  733. } else {
  734. this.$refs.supQuery.resetFields();
  735. this.searchSup();
  736. }
  737. },
  738. resetdialog(type) {
  739. if (type === "consumableData") {
  740. this.$refs.listQueryadd.resetFields();
  741. this.getdialog();
  742. } else {
  743. this.$refs.supQuery.resetFields();
  744. this.searchSup();
  745. }
  746. },
  747. // 多选
  748. handleSelectionChange(e) {
  749. this.insertMcsList = e;
  750. // e.forEach((v) => {
  751. // if (v.readFlag == "0") {
  752. // this.marked.push(v.id);
  753. // }
  754. // });
  755. // console.log(e, "ee");
  756. },
  757. // 多选后选过的禁用
  758. selected(row, index) {
  759. if (
  760. this.list.some((el) => {
  761. return el.hiCode === row.hiCode;
  762. })
  763. ) {
  764. return false;
  765. } else {
  766. return true;
  767. }
  768. },
  769. // 新增目录
  770. handleUpdate(type) {
  771. if (type == "search") {
  772. this.listQueryadd.current = 1;
  773. }
  774. this.dialogAdd = true;
  775. this.getdialog();
  776. },
  777. // 新增目录确认
  778. handleConfirm() {
  779. if (this.insertMcsList.length == 0) {
  780. this.$message({
  781. message: "请选择要添加的数据",
  782. type: "warning",
  783. });
  784. } else {
  785. this.$confirm("确认提交", "提示", {
  786. confirmButtonText: "确定",
  787. cancelButtonText: "取消",
  788. type: "warning",
  789. }).then(() => {
  790. this.addLoading = true;
  791. saveSplerMcs({ insertMcsList: this.insertMcsList })
  792. .then((res) => {
  793. if (res.success === true) {
  794. this.addLoading = false;
  795. this.getHospConsum();
  796. this.insertMcsList = [];
  797. this.dialogAdd = false;
  798. this.$refs.multipleTable.clearSelection();
  799. } else {
  800. this.addLoading = false;
  801. this.$refs.multipleTable.clearSelection();
  802. // this.$message({
  803. // message: res.message || "操作失败",
  804. // type: "error",
  805. // });
  806. }
  807. })
  808. .catch(() => {
  809. this.addLoading = false;
  810. this.dialogAdd = false;
  811. this.$refs.multipleTable.clearSelection();
  812. });
  813. });
  814. }
  815. // saveSplerMcs
  816. // this.addLoading = false;
  817. // this.dialogAdd = false;
  818. },
  819. // 非挂网目录新增
  820. handleFadd() {
  821. this.$router.push({
  822. name: "catalogdetailsadd",
  823. query: { spdId: this.spdId },
  824. });
  825. },
  826. // 申请调价
  827. handlePrice(row) {
  828. this.dialogPrice = true;
  829. this.temp.drugListId = row.drugListId;
  830. this.temp.drugName = row.drugName;
  831. this.temp.dosformName = row.dosformName;
  832. this.temp.specName = row.specName;
  833. this.temp.pacUnt = row.pacUnt;
  834. this.temp.prodEntp = row.prodEntp;
  835. this.temp.pricInit = row.pricCurr ? row.pricCurr : 0;
  836. this.$nextTick(() => {
  837. this.$refs.dataForm.resetFields();
  838. });
  839. },
  840. // 调价申请 确认
  841. commitData() {
  842. this.$refs["dataForm"].validate((valid) => {
  843. if (valid) {
  844. this.ccLoad = true;
  845. let data = {
  846. drugListId: this.temp.drugListId,
  847. pricInit: this.temp.pricInit,
  848. pricCurr: this.temp.pricCurr,
  849. appyRea: this.temp.appyRea,
  850. spdId: this.spdId,
  851. fileId: this.temp.fileId,
  852. };
  853. PricChg(data)
  854. .then((res) => {
  855. if (res.success === true) {
  856. this.$message("调价已申请");
  857. this.ccLoad = false;
  858. this.dialogPrice = false;
  859. this.getHospConsum();
  860. }
  861. })
  862. .catch((err) => {
  863. this.ccLoad = false;
  864. });
  865. }
  866. });
  867. },
  868. // 对码弹窗获取供应商列表
  869. handleDui(row) {
  870. // console.log(row, "编辑");
  871. this.$router.push({
  872. name: "catalogdetails",
  873. query: { id: row.id, status: row.status, spdId: row.spdId, isPub: row.isPub },
  874. });
  875. // this.dialogDui = true;
  876. // this.consumableData = [];
  877. // this.consumableData.push(row);
  878. // this.supLoading = true;
  879. // QuerySplerDrugList({ spdId: row.spdId })
  880. // .then((res) => {
  881. // this.form.splerData = res.data.records;
  882. // this.total = res.data.total;
  883. // this.supLoading = false;
  884. // })
  885. // .catch((err) => {
  886. // this.supLoading = false;
  887. // });
  888. },
  889. // 对码操作
  890. handleClick(item, index) {
  891. let DrugMatchObj = {
  892. spdId: this.spdId,
  893. drugListId: this.consumableData[0].drugListId,
  894. splerDrugListId: item.splerDrugListId,
  895. convrat: item.convrat,
  896. };
  897. if (!this.validateField("form", index)) {
  898. return;
  899. } else {
  900. DrugMatch(DrugMatchObj).then((res) => {
  901. if (res.success === true) {
  902. this.dialogDui = false;
  903. this.getHospConsum();
  904. this.$message({
  905. message: "对码成功",
  906. type: "success",
  907. });
  908. } else {
  909. this.$message.error("对码失败");
  910. }
  911. });
  912. }
  913. },
  914. // 取消对码
  915. handleCanc(row) {
  916. this.$confirm("此操作会取消该药品对码, 是否继续?", "提示", {
  917. confirmButtonText: "确定",
  918. cancelButtonText: "取消",
  919. type: "warning",
  920. })
  921. .then(() => {
  922. CancMatch({ spdId: this.spdId, drugListId: row.drugListId }).then((res) => {
  923. if (res.success) {
  924. this.getHospConsum();
  925. this.$message({
  926. type: "success",
  927. message: "取消对码成功",
  928. });
  929. }
  930. });
  931. })
  932. .catch(() => {});
  933. },
  934. //搜索供应商列表
  935. searchSup() {
  936. this.supLoading = true;
  937. this.supQuery.spdId = this.spdId;
  938. QuerySplerDrugList(this.supQuery)
  939. .then((res) => {
  940. this.form.splerData = res.data.records;
  941. this.total = res.data.total;
  942. this.supLoading = false;
  943. })
  944. .catch((err) => {
  945. this.supLoading = false;
  946. });
  947. },
  948. },
  949. mounted() {
  950. this.getData();
  951. // this.getHospConsum();
  952. if (this.$route.query.spdId) {
  953. this.listQuery.spdId = this.$route.query.spdId;
  954. selectSplerMcsList(this.listQuery)
  955. .then((res) => {
  956. this.list = res.data.records;
  957. this.total = res.data.total;
  958. this.listLoading = false;
  959. console.log(res, "医院目录");
  960. this.btnShow = true;
  961. })
  962. .catch((err) => {
  963. this.listLoading = false;
  964. });
  965. }
  966. },
  967. };
  968. </script>
  969. <style lang="scss" scoped>
  970. ::v-deep .el-card__body {
  971. padding: 12px;
  972. }
  973. ::v-deep .el-tree-node__content {
  974. height: 35px;
  975. }
  976. ::v-deep .el-input__suffix {
  977. display: flex;
  978. align-items: center;
  979. cursor: pointer;
  980. font-size: 15px;
  981. }
  982. ::v-deep .long .el-form-item__content {
  983. width: 220px;
  984. }
  985. ::v-deep .long .el-input__inner {
  986. width: 199px;
  987. }
  988. </style>