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

consumables.vue 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. <template>
  2. <div class="page_consumables">
  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="keywords"
  6. class="filter-item"/>
  7. <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
  8. @click="searchAction">搜索
  9. </el-button>
  10. <label class="title"><span class="name">是否启用</span> : </label>
  11. <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
  12. <el-option
  13. v-for="item in options"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value">
  17. </el-option>
  18. </el-select>
  19. <label class="title"><span class="name">是否收费</span> : </label>
  20. <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeCharge">
  21. <el-option
  22. v-for="item in options"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value">
  26. </el-option>
  27. </el-select>
  28. <span style="color: #909399;font-size:14px;">耗材种类 : &nbsp;</span>
  29. <el-select v-model="good_kind" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeKind">
  30. <el-option
  31. v-for="item,index in getDictionaryDataConfig('system','good_kind')"
  32. :key="index"
  33. :label="item.name"
  34. :value="item.id">
  35. </el-option>
  36. </el-select>
  37. </div>
  38. <el-button type="primary" @click="openForm()">新增</el-button>
  39. </div>
  40. <el-table
  41. border style="width: 100%" :row-style="{ color: '#303133' }"
  42. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}"
  43. :data="goodInfo.goodInfoData"
  44. v-loading="goodInfo.loading"
  45. >
  46. <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
  47. <el-table-column label="名称" align="center">
  48. <template slot-scope="scope">
  49. {{ scope.row.good_name }}
  50. </template>
  51. </el-table-column>
  52. <el-table-column prop="date" label="规格型号" align="center">
  53. <template slot-scope="scope">
  54. {{ scope.row.specification_name }}
  55. </template>
  56. </el-table-column>
  57. <el-table-column prop="date" label="耗材种类" width="140" align="center">
  58. <template slot-scope="scope">
  59. {{ getGoodKind(scope.row.good_kind) }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="耗材编码" width="140" align="center">
  63. <template slot-scope="scope">
  64. {{ scope.row.good_code }}
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="最小单位" width="60" align="center">
  68. <template slot-scope="scope">
  69. {{ getGoodUnit(scope.row.good_unit) }}
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="零售价" width="60" align="center">
  73. <template slot-scope="scope">
  74. {{ scope.row.retail_price }}
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="状态" width="60" align="center">
  78. <template slot-scope="scope">
  79. {{ scope.row.good_status}}
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="date" label="操作" width="300" align="center">
  83. <template slot-scope="scope">
  84. <el-button @click="handleGoodInfoEdit(scope.$index, scope.row)" type="primary" size="small">编辑</el-button>
  85. <el-button type="primary" size="small" @click="clickSelfPayment(scope.row.id)">自付比例</el-button>
  86. <el-button type="danger" size="small" @click="handleGoodInfoDelete(scope.$index, scope.row)">删除</el-button>
  87. </template>
  88. </el-table-column>
  89. </el-table>
  90. <el-pagination
  91. @size-change="handleSizeChange"
  92. @current-change="handleCurrentChange"
  93. :page-sizes="[10, 50, 100]"
  94. :page-size="10"
  95. background
  96. align="right"
  97. style="margin-top:20px;"
  98. layout="total, sizes, prev, pager, next, jumper"
  99. :total="total"
  100. >
  101. </el-pagination>
  102. <good-info-dailog ref="addConsumable"
  103. :titles="goodInfo.goodInfoDialog.goodInfoTitle"
  104. :formValue="goodInfo.goodInfoDialog.formValue"
  105. :visibility="goodInfo.goodInfoDialog.isVisibility"
  106. :isCreated="goodInfo.goodInfoDialog.isCreated"
  107. v-on:dialog-comfirm="goodInfoDialogComfirm"
  108. v-on:dialog-cancle="goodInfoDialogCancle"
  109. ></good-info-dailog>
  110. <self-payment ref='selfPayment'></self-payment>
  111. </div>
  112. </template>
  113. <script>
  114. import GoodInfoDailog from '../../stock/Dialog/goodInfoDailog'
  115. import { getDictionaryDataConfig } from "@/utils/data";
  116. import selfPayment from './selfPayment'
  117. import {
  118. createGoodInfo,
  119. deleteGoodInfo,
  120. GetAllDeals,
  121. GetAllGoodType,
  122. GetAllManufacturer,
  123. GetGoodInfo,
  124. GetGoodInfoByGoodId,
  125. getGoodInfoList,
  126. modifyGoodInfo
  127. } from '@/api/stock'
  128. export default {
  129. components: {
  130. GoodInfoDailog,
  131. selfPayment
  132. },
  133. data() {
  134. return {
  135. good_kind:'',
  136. is_use:'',
  137. is_charge:'',
  138. search_input: '',
  139. options: [{
  140. value: '0',
  141. label: '全部'
  142. },{
  143. value: '1',
  144. label: '是'
  145. }, {
  146. value: '2',
  147. label: '否'
  148. }],
  149. value: '',
  150. total: 0,
  151. pageTotal: 0,
  152. pageSelect: 0,
  153. page: 1,
  154. limit: 10,
  155. keywords: '',
  156. goodInfo: {
  157. loading: false,
  158. goodInfoData: [],
  159. good_code: '',
  160. editGoodId: '',
  161. editGoodIndex: '',
  162. goodInfoDialog: {
  163. goodInfoTitle: '新增商品信息',
  164. isCreated: 1, //1.创建 2.编辑 3.查看详情
  165. formValue: {
  166. good_id: '',
  167. specification_name: '',
  168. buy_price: '',
  169. sell_price: '',
  170. remark: '',
  171. manufacturer: '',
  172. good_type_id: '',
  173. dealer: '',
  174. expiry_date_warn_day_count: '',
  175. stock_warn_count: '',
  176. is_reuse: '2',
  177. dealers: [],
  178. manufacturers: [],
  179. goodType: [],
  180. goodUnit: [],
  181. good_name:'',
  182. pinyin:"",
  183. wubi:"",
  184. good_kind:'',
  185. medical_insurance_level:'',
  186. good_unit:'',
  187. retail_price:'',
  188. medical_insurance_number:'',
  189. is_special_diseases:'',
  190. is_record:'',
  191. statistics_category:'',
  192. agent:'',
  193. good_status:'',
  194. default_count:'',
  195. sign:'',
  196. is_default:'',
  197. is_charge_use:'',
  198. is_charge_predict:'',
  199. is_statistics_work:'',
  200. sort:'',
  201. is_doctor_use:'',
  202. good_number:'',
  203. },
  204. isVisibility: false
  205. }
  206. }
  207. }
  208. },
  209. methods: {
  210. changeKind(val){
  211. this.getList()
  212. },
  213. changeCharge(val){
  214. this.getList()
  215. },
  216. changeUser(val){
  217. this.getList()
  218. },
  219. getGoodUnit(id){
  220. for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
  221. if(id == this.$store.getters.good_unit[i].id){
  222. return this.$store.getters.good_unit[i].name
  223. }
  224. }
  225. return ""
  226. },
  227. getGoodKind(id){
  228. var data = this.getDictionaryDataConfig('system','good_kind')
  229. var name = ""
  230. for(let i = 0; i < data.length; i++){
  231. if(id == data[i].id){
  232. name = data[i].name
  233. }
  234. }
  235. return name
  236. },
  237. getDictionaryDataConfig(module,filed_name){
  238. return getDictionaryDataConfig(module,filed_name)
  239. },
  240. search: function() {
  241. this.getList()
  242. },
  243. handleGoodInfoEdit: function(index, row) {
  244. this.getAllDealer()
  245. this.getAllManufacturer()
  246. this.getAllGoodType()
  247. this.goodInfo.editGoodId = row.id
  248. this.goodInfo.editGoodIndex = index
  249. let params = {
  250. id: row.id
  251. }
  252. GetGoodInfo(params).then(response => {
  253. if (response.data.state == 0) {
  254. this.$message.error(response.data.msg)
  255. return false
  256. } else {
  257. if (response.data.data.goodInfo.good_unit <= 0) {
  258. this.goodInfo.goodInfoDialog.formValue.good_unit = ''
  259. } else {
  260. this.goodInfo.goodInfoDialog.formValue.good_unit =
  261. response.data.data.goodInfo.good_unit
  262. }
  263. if (response.data.data.goodInfo.manufacturer <= 0) {
  264. this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
  265. } else {
  266. this.goodInfo.goodInfoDialog.formValue.manufacturer =
  267. response.data.data.goodInfo.manufacturer
  268. }
  269. if (response.data.data.goodInfo.dealer <= 0) {
  270. this.goodInfo.goodInfoDialog.formValue.dealer = ''
  271. } else {
  272. this.goodInfo.goodInfoDialog.formValue.dealer =
  273. response.data.data.goodInfo.dealer
  274. }
  275. this.goodInfo.goodInfoDialog.formValue.specification_name =
  276. response.data.data.goodInfo.specification_name
  277. this.goodInfo.goodInfoDialog.formValue.buy_price =
  278. response.data.data.goodInfo.buy_price
  279. this.goodInfo.goodInfoDialog.formValue.sell_price =
  280. response.data.data.goodInfo.sell_price
  281. this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count =
  282. response.data.data.goodInfo.expiry_date_warn_day_count
  283. this.goodInfo.goodInfoDialog.formValue.stock_warn_count =
  284. response.data.data.goodInfo.stock_warn_count
  285. this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString()
  286. this.goodInfo.goodInfoDialog.formValue.remark =
  287. response.data.data.goodInfo.remark
  288. this.goodInfo.goodInfoDialog.isCreated = 2
  289. this.goodInfo.good_code = response.data.data.goodInfo.good_code
  290. this.goodInfo.goodInfoDialog.formValue.good_type_id =
  291. response.data.data.goodInfo.good_type_id
  292. this.goodInfo.goodInfoDialog.formValue.good_name =
  293. response.data.data.goodInfo.good_name
  294. this.goodInfo.goodInfoDialog.formValue.pinyin =
  295. response.data.data.goodInfo.pinyin
  296. this.goodInfo.goodInfoDialog.formValue.wubi =
  297. response.data.data.goodInfo.wubi
  298. if (response.data.data.goodInfo.good_kind <= 0) {
  299. this.goodInfo.goodInfoDialog.formValue.good_kind = ''
  300. } else {
  301. this.goodInfo.goodInfoDialog.formValue.good_kind =
  302. response.data.data.goodInfo.good_kind
  303. }
  304. if (response.data.data.goodInfo.medical_insurance_level <= 0) {
  305. this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = ''
  306. } else {
  307. this.goodInfo.goodInfoDialog.formValue.medical_insurance_level =
  308. response.data.data.goodInfo.medical_insurance_level
  309. }
  310. this.goodInfo.goodInfoDialog.formValue.retail_price =
  311. response.data.data.goodInfo.retail_price
  312. this.goodInfo.goodInfoDialog.formValue.medical_insurance_number =
  313. response.data.data.goodInfo.medical_insurance_number
  314. if (response.data.data.goodInfo.is_special_diseases <= 0) {
  315. this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
  316. } else {
  317. this.goodInfo.goodInfoDialog.formValue.is_special_diseases =
  318. response.data.data.goodInfo.is_special_diseases.toString()
  319. }
  320. if (response.data.data.goodInfo.is_record <= 0) {
  321. this.goodInfo.goodInfoDialog.formValue.is_record = ''
  322. } else {
  323. this.goodInfo.goodInfoDialog.formValue.is_record =
  324. response.data.data.goodInfo.is_record.toString()
  325. }
  326. if (response.data.data.goodInfo.statistics_category <= 0) {
  327. this.goodInfo.goodInfoDialog.formValue.statistics_category = ''
  328. } else {
  329. this.goodInfo.goodInfoDialog.formValue.statistics_category =
  330. response.data.data.goodInfo.statistics_category
  331. }
  332. if (response.data.data.goodInfo.good_status <= 0) {
  333. this.goodInfo.goodInfoDialog.formValue.good_status = ''
  334. } else {
  335. this.goodInfo.goodInfoDialog.formValue.good_status =
  336. response.data.data.goodInfo.good_status
  337. }
  338. if (response.data.data.goodInfo.default_count <= 0) {
  339. this.goodInfo.goodInfoDialog.formValue.default_count = ''
  340. } else {
  341. this.goodInfo.goodInfoDialog.formValue.default_count =
  342. response.data.data.goodInfo.default_count
  343. }
  344. if (response.data.data.goodInfo.sign <= 0) {
  345. this.goodInfo.goodInfoDialog.formValue.sign = ''
  346. } else {
  347. this.goodInfo.goodInfoDialog.formValue.sign =
  348. response.data.data.goodInfo.sign
  349. }
  350. if (response.data.data.goodInfo.is_default <= 0) {
  351. this.goodInfo.goodInfoDialog.formValue.is_default = ''
  352. } else {
  353. this.goodInfo.goodInfoDialog.formValue.is_default =
  354. response.data.data.goodInfo.is_default.toString()
  355. }
  356. if (response.data.data.goodInfo.is_charge_use <= 0) {
  357. this.goodInfo.goodInfoDialog.formValue.is_charge_use = ''
  358. } else {
  359. this.goodInfo.goodInfoDialog.formValue.is_charge_use =
  360. response.data.data.goodInfo.is_charge_use.toString()
  361. }
  362. if (response.data.data.goodInfo.is_charge_predict <= 0) {
  363. this.goodInfo.goodInfoDialog.formValue.is_charge_predict = ''
  364. } else {
  365. this.goodInfo.goodInfoDialog.formValue.is_charge_predict =
  366. response.data.data.goodInfo.is_charge_predict.toString()
  367. }
  368. if (response.data.data.goodInfo.is_statistics_work <= 0) {
  369. this.goodInfo.goodInfoDialog.formValue.is_statistics_work = ''
  370. } else {
  371. this.goodInfo.goodInfoDialog.formValue.is_statistics_work =
  372. response.data.data.goodInfo.is_statistics_work.toString()
  373. }
  374. if (response.data.data.goodInfo.sort <= 0) {
  375. this.goodInfo.goodInfoDialog.formValue.sort = ''
  376. } else {
  377. this.goodInfo.goodInfoDialog.formValue.sort =
  378. response.data.data.goodInfo.sort.toString()
  379. }
  380. if (response.data.data.goodInfo.is_doctor_use <= 0) {
  381. this.goodInfo.goodInfoDialog.formValue.is_doctor_use = ''
  382. } else {
  383. this.goodInfo.goodInfoDialog.formValue.is_doctor_use =
  384. response.data.data.goodInfo.is_doctor_use.toString()
  385. }
  386. this.goodInfo.goodInfoDialog.formValue.agent =
  387. response.data.data.goodInfo.agent
  388. this.goodInfo.goodInfoDialog.formValue.good_number =
  389. response.data.data.goodInfo.good_number
  390. this.$refs.addConsumable.show(row.id, this.goodInfo.goodInfoDialog.formValue)
  391. }
  392. })
  393. },
  394. handleGoodInfoDelete: function(index, row) {
  395. this.$confirm('确认删除这条商品信息?', '删除商品信息', {
  396. confirmButtonText: '确定',
  397. cancelButtonText: '取消',
  398. type: 'warning'
  399. })
  400. .then(() => {
  401. let params = {
  402. id: row.id
  403. }
  404. deleteGoodInfo(params).then(response => {
  405. if (response.data.state == 0) {
  406. this.$message.error(response.data.msg)
  407. return false
  408. } else {
  409. this.goodInfo.goodInfoData.splice(index, 1)
  410. this.$message.success('删除成功')
  411. }
  412. })
  413. })
  414. .catch(() => {
  415. })
  416. },
  417. getList() {
  418. this.goodInfo.loading = true
  419. let params = {
  420. page: this.page,
  421. limit: this.limit,
  422. keyword: this.keywords,
  423. is_use:this.is_use,
  424. good_kind:this.good_kind,
  425. is_charge: this.is_charge,
  426. }
  427. getGoodInfoList(params).then(response => {
  428. if (response.data.state == 0) {
  429. this.goodInfo.loading = false
  430. this.$message.error(response.data.msg)
  431. return false
  432. } else {
  433. this.goodInfo.loading = false
  434. this.total = response.data.data.total
  435. this.goodInfo.goodInfoData = []
  436. for (let i = 0; i < response.data.data.list.length; i++) {
  437. this.goodInfo.goodInfoData.push(response.data.data.list[i])
  438. }
  439. }
  440. })
  441. },
  442. tableRowClassName({ row, rowIndex }) {
  443. //把每一行的索引放进row
  444. row.index = rowIndex
  445. },
  446. onRowClick(row, event, column) {
  447. this.goodInfo.goodInfoData = []
  448. this.goodType.tableCurrentIndex = row.index
  449. this.goodInfo.goodInfoDialog.formValue.good_id = row.id
  450. let params = {
  451. id: row.id
  452. }
  453. this.goodInfo.loading = true
  454. GetGoodInfoByGoodId(params).then(response => {
  455. if (response.data.state == 0) {
  456. this.goodInfo.loading = false
  457. this.$message.error(response.data.msg)
  458. return false
  459. } else {
  460. this.goodInfo.loading = false
  461. this.getList()
  462. // for (let i = 0; i < response.data.data.list.length; i++) {
  463. // this.goodInfo.goodInfoData.push(response.data.data.list[i])
  464. // }
  465. }
  466. })
  467. },
  468. goodInfoDialogComfirm: function(val) {
  469. if (val.isCreated == 2) {
  470. //修改
  471. val['id'] = this.goodInfo.editGoodId
  472. val['good_code'] = this.goodInfo.good_code
  473. modifyGoodInfo(val).then(response => {
  474. if (response.data.state == 0) {
  475. this.$message.error(response.data.msg)
  476. return false
  477. } else {
  478. this.$refs.addConsumable.hide()
  479. this.getList()
  480. // this.goodInfo.goodInfoData[
  481. // this.goodInfo.editGoodIndex
  482. // ].specification_name =
  483. // response.data.data.goodInfo.specification_name
  484. // this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit =
  485. // response.data.data.goodInfo.good_unit
  486. // this.goodInfo.goodInfoData[
  487. // this.goodInfo.editGoodIndex
  488. // ].buy_price = response.data.data.goodInfo.buy_price.toString()
  489. // this.goodInfo.goodInfoData[
  490. // this.goodInfo.editGoodIndex
  491. // ].sell_price = response.data.data.goodInfo.sell_price.toString()
  492. // this.goodInfo.goodInfoData[
  493. // this.goodInfo.editGoodIndex
  494. // ].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
  495. // this.goodInfo.goodInfoData[
  496. // this.goodInfo.editGoodIndex
  497. // ].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()
  498. this.$message.success('修改成功')
  499. }
  500. })
  501. } else if (val.isCreated == 1) {
  502. //新增
  503. createGoodInfo(val).then(response => {
  504. if (response.data.state == 0) {
  505. this.$message.error(response.data.msg)
  506. return false
  507. } else {
  508. this.$refs.addConsumable.hide()
  509. this.getList()
  510. // this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
  511. this.$message.success('新增成功')
  512. }
  513. })
  514. }
  515. },
  516. goodInfoDialogCancle: function() {
  517. this.$refs.addConsumable.hide()
  518. },
  519. showInfoDialog: function() {
  520. this.getAllDealer()
  521. this.getAllManufacturer()
  522. this.goodInfo.goodInfoDialog.formValue.goodType = []
  523. GetAllGoodType().then(response => {
  524. if (response.data.state == 0) {
  525. this.$message.error(response.data.msg)
  526. return false
  527. } else {
  528. for (let i = 0; i < response.data.data.goodType.length; i++) {
  529. if (response.data.data.goodType[i].type == 1) {
  530. response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
  531. }
  532. this.goodInfo.goodInfoDialog.formValue.goodType.push(
  533. response.data.data.goodType[i]
  534. )
  535. }
  536. if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
  537. this.$message.error('请先新增商品类型')
  538. return
  539. } else {
  540. this.goodInfo.goodInfoDialog.isVisibility = true
  541. this.goodInfo.goodInfoDialog.isCreated = 1
  542. }
  543. }
  544. })
  545. this.$refs.addConsumable.show()
  546. },
  547. getAllDealer: function() {
  548. this.goodInfo.goodInfoDialog.formValue.dealers = []
  549. GetAllDeals().then(response => {
  550. if (response.data.state == 0) {
  551. this.$message.error(response.data.msg)
  552. return false
  553. } else {
  554. for (let i = 0; i < response.data.data.dealer.length; i++) {
  555. this.goodInfo.goodInfoDialog.formValue.dealers.push(
  556. response.data.data.dealer[i]
  557. )
  558. }
  559. }
  560. })
  561. },
  562. getAllManufacturer: function() {
  563. this.goodInfo.goodInfoDialog.formValue.manufacturers = []
  564. GetAllManufacturer().then(response => {
  565. if (response.data.state == 0) {
  566. this.$message.error(response.data.msg)
  567. return false
  568. } else {
  569. for (let i = 0; i < response.data.data.manufacturer.length; i++) {
  570. this.goodInfo.goodInfoDialog.formValue.manufacturers.push(
  571. response.data.data.manufacturer[i]
  572. )
  573. }
  574. }
  575. })
  576. },
  577. getAllGoodType: function() {
  578. this.goodInfo.goodInfoDialog.formValue.goodType = []
  579. GetAllGoodType().then(response => {
  580. if (response.data.state == 0) {
  581. this.$message.error(response.data.msg)
  582. return false
  583. } else {
  584. for (let i = 0; i < response.data.data.goodType.length; i++) {
  585. if (response.data.data.goodType[i].type == 1) {
  586. response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
  587. }
  588. this.goodInfo.goodInfoDialog.formValue.goodType.push(
  589. response.data.data.goodType[i]
  590. )
  591. }
  592. }
  593. })
  594. },
  595. handleSizeChange(val) {
  596. this.limit = val
  597. this.getList()
  598. },
  599. handleCurrentChange(val) {
  600. this.page = val
  601. this.getList()
  602. },
  603. searchAction() {
  604. this.is_use = ""
  605. this.is_charge = ""
  606. this.good_kind = ""
  607. this.getList()
  608. },clickSelfPayment(id){
  609. this.$refs.selfPayment.show(id,2)
  610. },
  611. openForm() {
  612. this.getAllDealer()
  613. this.getAllManufacturer()
  614. this.goodInfo.goodInfoDialog.formValue.goodType = []
  615. GetAllGoodType().then(response => {
  616. if (response.data.state == 0) {
  617. this.$message.error(response.data.msg)
  618. return false
  619. } else {
  620. for (let i = 0; i < response.data.data.goodType.length; i++) {
  621. if (response.data.data.goodType[i].type == 1) {
  622. response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
  623. }
  624. this.goodInfo.goodInfoDialog.formValue.goodType.push(
  625. response.data.data.goodType[i]
  626. )
  627. }
  628. if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
  629. this.$message.error('请先新增商品类型')
  630. return
  631. } else {
  632. this.goodInfo.goodInfoDialog.isVisibility = true
  633. this.goodInfo.goodInfoDialog.isCreated = 1
  634. }
  635. }
  636. })
  637. this.goodInfo.goodInfoDialog.formValue.good_id = ''
  638. this.goodInfo.goodInfoDialog.formValue.specification_name = ''
  639. this.goodInfo.goodInfoDialog.formValue.buy_price = ''
  640. this.goodInfo.goodInfoDialog.formValue.sell_price = ''
  641. this.goodInfo.goodInfoDialog.formValue.remark = ''
  642. this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
  643. this.goodInfo.goodInfoDialog.formValue.good_type_id = ''
  644. this.goodInfo.goodInfoDialog.formValue.dealer = ''
  645. this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
  646. this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
  647. this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
  648. this.goodInfo.goodInfoDialog.formValue.good_name = ''
  649. this.goodInfo.goodInfoDialog.formValue.pinyin = ''
  650. this.goodInfo.goodInfoDialog.formValue.wubi = ''
  651. this.goodInfo.goodInfoDialog.formValue.good_kind = ''
  652. this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = ''
  653. this.goodInfo.goodInfoDialog.formValue.retail_price = ''
  654. this.goodInfo.goodInfoDialog.formValue.medical_insurance_number = ''
  655. this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
  656. this.goodInfo.goodInfoDialog.formValue.is_record = ''
  657. this.goodInfo.goodInfoDialog.formValue.statistics_category = ''
  658. this.goodInfo.goodInfoDialog.formValue.good_status = ''
  659. this.goodInfo.goodInfoDialog.formValue.default_count = ''
  660. this.goodInfo.goodInfoDialog.formValue.sign = ''
  661. this.goodInfo.goodInfoDialog.formValue.is_default = ''
  662. this.goodInfo.goodInfoDialog.formValue.is_charge_use = ''
  663. this.goodInfo.goodInfoDialog.formValue.is_charge_predict = ''
  664. this.goodInfo.goodInfoDialog.formValue.is_statistics_work = ''
  665. this.goodInfo.goodInfoDialog.formValue.sort = ''
  666. this.goodInfo.goodInfoDialog.formValue.is_doctor_use = ''
  667. this.goodInfo.goodInfoDialog.formValue.agent = ''
  668. this.goodInfo.goodInfoDialog.formValue.good_number = ''
  669. this.$refs.addConsumable.show(0)
  670. }
  671. }, created() {
  672. this.getList()
  673. this.getAllDealer()
  674. this.getAllManufacturer()
  675. this.getAllGoodType()
  676. this.goodInfo.goodInfoDialog.formValue.goodUnit = this.$store.getters.good_unit
  677. }
  678. }
  679. </script>