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

stockDamaged.vue 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. <template>
  2. <div>
  3. <div style="margin-bottom:10px;">
  4. <el-input
  5. size="small"
  6. style="width: 200px;"
  7. class="filter-item"
  8. v-model.trim="searchKey"
  9. placeholder="请输入耗材名称"
  10. />
  11. <el-button
  12. size="small"
  13. class="filter-item"
  14. type="primary"
  15. icon="el-icon-search"
  16. @click="search">搜索</el-button>
  17. </div>
  18. <el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
  19. <el-table-column type="selection" width="55" align="center"> </el-table-column>
  20. <el-table-column prop="date" label="耗材名称" align="center">
  21. <template slot-scope="scope">
  22. {{scope.row.good_name}}
  23. </template>
  24. </el-table-column>
  25. <el-table-column prop="date" label="耗材规格" align="center">
  26. <template slot-scope="scope">
  27. {{scope.row.specification_name}}
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="date" label="总耗损数量" align="center">
  31. <template slot-scope="scope">
  32. {{getDamageCount(scope.row.good_id)}}
  33. </template>
  34. </el-table-column>
  35. <el-table-column prop="date" label="总报损金额" align="center">
  36. <template slot-scope="scope">
  37. {{scope.row.count}}
  38. </template>
  39. </el-table-column>
  40. <el-table-column prop="name" label="操作" align="center">
  41. <template slot-scope="scope">
  42. <el-button type="primary" @click="toDamagedDetail(scope.row.good_id)">查看详情</el-button>
  43. </template>
  44. </el-table-column>
  45. <!-- <el-table-column prop="name" label="审核日期" align="center">
  46. <template slot-scope="scope">
  47. {{getTime(scope.row.checker_time)}}
  48. </template>
  49. </el-table-column> -->
  50. <!-- <el-table-column prop="name" label="核对人" align="center">
  51. <template slot-scope="scope">
  52. {{getChecker(scope.row.checker)}}
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="name" label="状态" align="center">
  56. <template slot-scope="scope">
  57. <span v-if="scope.row.checker_status == 1">已核对</span>
  58. <span v-if="scope.row.checker_status == 2">未核对</span>
  59. </template>
  60. </el-table-column> -->
  61. <!-- <el-table-column label="操作" align="center" width="200" >
  62. <template slot-scope="scope">
  63. <el-button type="primary" size="small" @click="editStockDamage(scope.row.id,scope.row.checker_status)">编辑</el-button>
  64. <el-button type="danger" size="small" @click="deleteStockDamage(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
  65. </template>
  66. </el-table-column> -->
  67. </el-table>
  68. <el-pagination
  69. @size-change="handleSizeChange"
  70. @current-change="handleCurrentChange"
  71. :page-sizes="[10, 20, 40, 100]"
  72. :page-size="10"
  73. background
  74. style="margin-top:20px;text-align: right"
  75. layout="total, sizes, prev, pager, next, jumper"
  76. :total="total"
  77. >
  78. </el-pagination>
  79. <el-dialog
  80. title="耗材报损"
  81. :visible.sync="dialogVisible"
  82. width="1200px"
  83. >
  84. <el-form :model="form" class="modifyDialog" label-width="120px">
  85. <el-form-item label="耗材ID">
  86. <el-input v-model="form.good_id" :disabled="true"></el-input>
  87. </el-form-item>
  88. <el-form-item label="耗材名称">
  89. <el-autocomplete
  90. class="checkSearch"
  91. popper-class="my-autocomplete"
  92. v-model="form.good_name"
  93. :fetch-suggestions="querySearchAsync"
  94. :trigger-on-focus="true"
  95. placeholder="请输入耗材名称"
  96. @select="handleSelect"
  97. @input="changeGoodName(scope.$index)"
  98. style="width:160px;"
  99. >
  100. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  101. <template slot-scope="{ item }">
  102. <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
  103. </template>
  104. </el-autocomplete>
  105. </el-form-item>
  106. <el-form-item label="规格">
  107. <el-input v-model="form.specification_name" :disabled="true"></el-input>
  108. </el-form-item>
  109. <el-form-item label="批号">
  110. <el-select v-model="form.number" filterable placeholder="请选择" @change="chageNumberlist">
  111. <el-option
  112. v-for="(item,index) in numberList"
  113. :key="index"
  114. :label="item.number"
  115. :value="item.number">
  116. </el-option>
  117. </el-select>
  118. </el-form-item>
  119. <el-form-item label="单位">
  120. <el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
  121. </el-form-item>
  122. <el-form-item label="进货价">
  123. <el-input v-model="form.buy_price" :disabled="true"></el-input>
  124. </el-form-item>
  125. <el-form-item label="零售价">
  126. <el-input v-model="form.packing_price" :disabled="true"></el-input>
  127. </el-form-item>
  128. <el-form-item label="报损数量">
  129. <el-input v-model="form.count"></el-input>
  130. </el-form-item>
  131. <el-form-item label="库存">
  132. <el-input v-model="form.total" :disabled="true"></el-input>
  133. </el-form-item>
  134. <el-form-item label="产地">
  135. <el-input v-model="form.good_origin_place"></el-input>
  136. </el-form-item>
  137. <el-form-item label="批准文号">
  138. <el-input v-model="form.license_number" :disabled="true"></el-input>
  139. </el-form-item>
  140. <el-form-item label="生产厂商">
  141. <el-input v-model="form.manufacturer" :disabled="true"></el-input>
  142. </el-form-item>
  143. <el-form-item label="供应商">
  144. <el-input v-model="form.dealer" :disabled="true"></el-input>
  145. </el-form-item>
  146. <el-form-item label="备注">
  147. <div style="display:flex;">
  148. <el-input v-model="form.remark"></el-input>
  149. <el-button style="margin-left:5px;" type="primary" @click="addStock">添加</el-button>
  150. </div>
  151. </el-form-item>
  152. </el-form>
  153. <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
  154. <el-table-column prop="date" label="耗材ID" width="100" align="center">
  155. <template slot-scope="scope">
  156. {{scope.row.good_id}}
  157. </template>
  158. </el-table-column>
  159. <el-table-column prop="date" label="耗材名称" width="100" align="center">
  160. <template slot-scope="scope">
  161. {{scope.row.good_name}}
  162. </template>
  163. </el-table-column>
  164. <el-table-column prop="name" label="规格" width="100" align="center">
  165. <template slot-scope="scope">
  166. {{scope.row.specification_name}}
  167. </template>
  168. </el-table-column>
  169. <el-table-column prop="name" label="单位" width="100" align="center">
  170. <template slot-scope="scope">
  171. {{scope.row.warehousing_unit}}
  172. </template>
  173. </el-table-column>
  174. <el-table-column prop="name" label="报损数量" width="100" align="center">
  175. <template slot-scope="scope">
  176. {{scope.row.count}}
  177. </template>
  178. </el-table-column>
  179. <el-table-column prop="name" label="原进货价" width="100" align="center">
  180. <template slot-scope="scope">
  181. {{scope.row.buy_price}}
  182. </template>
  183. </el-table-column>
  184. <el-table-column prop="name" label="原零售价" width="100" align="center">
  185. <template slot-scope="scope">
  186. {{scope.row.packing_price}}
  187. </template>
  188. </el-table-column>
  189. <el-table-column prop="name" label="生产厂商" width="100" align="center">
  190. <template slot-scope="scope">
  191. {{scope.row.manufacturer}}
  192. </template>
  193. </el-table-column>
  194. <el-table-column prop="name" label="产地" width="100" align="center">
  195. <template slot-scope="scope">
  196. {{scope.row.good_origin_place}}
  197. </template>
  198. </el-table-column>
  199. <el-table-column prop="name" label="批准文号" width="100" align="center">
  200. <template slot-scope="scope">
  201. {{scope.row.license_number}}
  202. </template>
  203. </el-table-column>
  204. <el-table-column prop="name" label="备注" width="100" align="center">
  205. <template slot-scope="scope">
  206. {{scope.row.remark}}
  207. </template>
  208. </el-table-column>
  209. <el-table-column fixed="right" width="100" label="操作">
  210. <template slot-scope="scope">
  211. <el-button type="text" size="small" @click="toDelete(scope.row.$index)">删除</el-button>
  212. <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
  213. </template>
  214. </el-table-column>
  215. </el-table>
  216. <span slot="footer" class="dialog-footer">
  217. <el-button @click="dialogVisible = false">取 消</el-button>
  218. <el-button type="primary" @click="saveReportStock">确 定</el-button>
  219. </span>
  220. </el-dialog>
  221. <el-dialog
  222. title="耗材报损核对"
  223. :visible.sync="checkDialogVisible"
  224. width="30%"
  225. >
  226. <span>
  227. <el-form :model="form">
  228. <el-row>
  229. <el-col>
  230. <el-form-item label="核对时间">
  231. <el-date-picker
  232. size="small"
  233. v-model="check_time"
  234. type="date"
  235. style="margin-left:5px;width:140px;"
  236. placeholder="选择日期">
  237. </el-date-picker>
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. <el-row>
  242. <el-col>
  243. <el-form-item label="核对人">
  244. <el-select v-model="checker" placeholder="请选择">
  245. <el-option
  246. v-for="item in doctorList"
  247. :key="item.admin_user_id"
  248. :label="item.user_name"
  249. :value="item.admin_user_id">
  250. </el-option>
  251. </el-select>
  252. </el-form-item>
  253. </el-col>
  254. </el-row>
  255. </el-form>
  256. </span>
  257. <span slot="footer" class="dialog-footer">
  258. <el-button @click="checkDialogVisible = false">取 消</el-button>
  259. <el-button type="primary" @click="SaveCheckedDamage">保 存</el-button>
  260. </span>
  261. </el-dialog>
  262. <el-dialog
  263. title="盘点批次详情"
  264. :visible.sync="modifyDialogVisible"
  265. width="80%">
  266. <el-form>
  267. <el-row>
  268. <el-col :span="8">
  269. <el-form-item label="入库单号:">
  270. <el-input v-model ="form.warehouseing_order" style="width:200px"></el-input>
  271. </el-form-item>
  272. </el-col>
  273. <el-col :span="8">
  274. <el-form-item label="原因:">
  275. <el-select v-model="form.type" placeholder="请选择">
  276. <el-option
  277. v-for="item in reasonList"
  278. :key="item.id"
  279. :label="item.name"
  280. :value="item.id">
  281. </el-option>
  282. </el-select>
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="8">
  286. <el-button type="primary" @click="toQuery">查询</el-button>
  287. </el-col>
  288. </el-row>
  289. <el-row style="margin-bottom:10px;">
  290. <div>总损耗数量:{{getDamageCount(good_id)}} &nbsp;&nbsp;总报损金额:{{ (getDamageCount(good_id) * price).toFixed(2) }}</div>
  291. </el-row>
  292. <el-row>
  293. <el-table
  294. :data="goodList"
  295. border
  296. style="width: 100%">
  297. <el-table-column prop="date" label="序号" width="180" align="center">
  298. <template slot-scope="scope">
  299. {{scope.$index + 1}}
  300. </template>
  301. </el-table-column>
  302. <el-table-column prop="name" label="入库单号" width="180" align="center">
  303. <template slot-scope="scope">
  304. {{scope.row.warehousing_order}}
  305. </template>
  306. </el-table-column>
  307. <el-table-column prop="address" label="损耗数量" align="center">
  308. <template slot-scope="scope">
  309. {{scope.row.count}}
  310. </template>
  311. </el-table-column>
  312. <el-table-column prop="address" label="药损比" align="center">
  313. <template slot-scope="scope">
  314. {{(scope.row.count / getDamageCount(scope.row.good_id)).toFixed(2)*100}}%
  315. </template>
  316. </el-table-column>
  317. <el-table-column prop="address" label="报损金额" align="center">
  318. <template slot-scope="scope">
  319. {{scope.row.buy_price}}
  320. </template>
  321. </el-table-column>
  322. <el-table-column prop="address" label="盘点原因" align="center">
  323. <template slot-scope="scope">
  324. <span v-if="scope.row.inventory_type == 0">默认</span>
  325. <span v-if="scope.row.inventory_type == 1">到期退货</span>
  326. <span v-if="scope.row.inventory_type == 2">异常退货</span>
  327. <span v-if="scope.row.inventory_type == 3">退货</span>
  328. <span v-if="scope.row.inventory_type == 4">人为损坏</span>
  329. <span v-if="scope.row.inventory_type == 5">不计入报损分析</span>
  330. </template>
  331. </el-table-column>
  332. </el-table>
  333. </el-row>
  334. </el-form>
  335. <span slot="footer" class="dialog-footer">
  336. <el-button @click="modifyDialogVisible = false">取 消</el-button>
  337. <el-button type="primary" @click="modifyDialogVisible = false">确 定</el-button>
  338. </span>
  339. </el-dialog>
  340. </div>
  341. </template>
  342. <script>
  343. import BreadCrumb from "../components/bread-crumb";
  344. import { uParseTime } from '@/utils/tools'
  345. import { postSearchGoodWarehouseList,saveReportStock,getReportStockList,getStockBatchNumber,getGoodWarehouseList,getWarehouseTotal,getDamageDetailByGoodId} from "@/api/stock"
  346. export default {
  347. name: "stockModifyPrice",
  348. components:{
  349. BreadCrumb
  350. },
  351. data() {
  352. return{
  353. crumbs: [
  354. { path: false, name: "库存管理" },
  355. { path: false, name: "耗材管理" },
  356. { path: false, name: "耗材报损" }
  357. ],
  358. searchKey:'',
  359. value1:'',
  360. value2:'',
  361. tableData: [],
  362. dialogVisible:false,
  363. form: {
  364. id:"",
  365. good_name: '',
  366. packing_price:'',
  367. new_price:"",
  368. count:"",
  369. remark:"",
  370. warehousing_order:"",
  371. manufacturer:"",
  372. dealer:"",
  373. license_number:"",
  374. warehousing_unit:"",
  375. specification_name:"",
  376. buy_price:"",
  377. good_id:"",
  378. packing_unit:"",
  379. good_origin_place:"",
  380. report_count:"",
  381. total:"",
  382. number:"",
  383. expiry_date:"",
  384. product_date:"",
  385. },
  386. currentIndex: 0,
  387. manufacturerList:[],
  388. dealerList:[],
  389. goodList:[],
  390. start_time:"",
  391. end_time:"",
  392. checkDialogVisible:false,
  393. ids:"",
  394. limit:10,
  395. page:1,
  396. total:0,
  397. doctorList:[],
  398. checker:this.$store.getters.xt_user.user.id,
  399. check_time:new Date(),
  400. tableList:[],
  401. editPriceDialogVisible:false,
  402. modifyPriceDialogVisible:false,
  403. id:0,
  404. numberList:[],
  405. damageList:[],
  406. modifyDialogVisible:false,
  407. reasonList:[
  408. {id:0,name:"默认"},
  409. {id:1,name:"到期退货"},
  410. {id:2,name:"异常退货"},
  411. {id:3,name:"退货"},
  412. {id:4,name:"人为损坏"},
  413. {id:5,name:"不计入报损分析"},
  414. ],
  415. goodList:[],
  416. good_name:"",
  417. price:0,
  418. good_id:0,
  419. }
  420. },
  421. methods:{
  422. search(){
  423. this.getlist()
  424. },
  425. print(){
  426. if(this.ids == ""){
  427. this.$message.error("请勾选打印数据")
  428. return false
  429. }else{
  430. this.$router.push({path:'/stock/stockDamagePrint?ids='+this.ids})
  431. }
  432. },
  433. handleSizeChange(val){
  434. this.limit = val
  435. this.getlist()
  436. },
  437. handleCurrentChange(val){
  438. this.page = val
  439. this.getlist()
  440. },
  441. changeGoodName(val){
  442. this.currentIndex = val
  443. },
  444. querySearchAsync(keyword, cb) {
  445. let key = '';
  446. if (keyword != undefined) {
  447. key = keyword
  448. }
  449. postSearchGoodWarehouseList(key).then(response => {
  450. if (response.data.state == 1) {
  451. var list = response.data.data.list
  452. console.log("列表数据",list)
  453. this.goodList = list
  454. var manufacturerList = response.data.data.manufacturerList
  455. this.manufacturerList = manufacturerList
  456. var dealer = response.data.data.dealerList
  457. this.dealerList = dealer
  458. for(let i=0;i<this.goodList.length;i++){
  459. for(let j=0;j<this.manufacturerList.length;j++){
  460. if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
  461. this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
  462. }
  463. }
  464. }
  465. for(let i=0;i<this.goodList.length;i++){
  466. for(let j=0;j<this.dealerList.length;j++){
  467. if(this.goodList[i].dealer == this.dealerList[j].id){
  468. this.goodList[i].dealer = this.dealerList[j].dealer_name
  469. }
  470. }
  471. }
  472. cb(this.goodList)
  473. } else {
  474. cb([])
  475. }
  476. })
  477. },
  478. handleSelect(val){
  479. //获取当前耗材的批号
  480. this.getStockBatchNumber(val.good_id)
  481. this.form.id = val.id
  482. this.form.good_id = val.good_id,
  483. this.form.good_name = val.good_name
  484. this.form.packing_price = val.packing_price
  485. this.form.warehousing_order = val.warehousing_order
  486. this.form.license_number = val.license_number
  487. if(this.form.dealer == 0){
  488. this.form.dealer = ""
  489. }else{
  490. this.form.dealer = val.dealer
  491. }
  492. this.form.manufacturer = val.manufacturer
  493. this.form.specification_name = val.specification_name
  494. this.form.remark = val.remark
  495. this.form.buy_price = val.buy_price
  496. this.form.warehousing_unit = val.packing_unit
  497. this.form.new_price = val.new_price
  498. this.form.expiry_date = val.expiry_date
  499. this.form.product_date = val.product_date
  500. },
  501. addStock(){
  502. if(this.form.count == ""){
  503. this.$message.error("请输入报损数量")
  504. return
  505. }
  506. var obj = {
  507. good_id:this.form.good_id,
  508. good_name:this.form.good_name,
  509. specification_name:this.form.specification_name,
  510. warehousing_unit:this.form.warehousing_unit,
  511. count:this.form.count,
  512. buy_price:this.form.buy_price.toString(),
  513. packing_price:this.form.packing_price.toString(),
  514. manufacturer:this.form.manufacturer,
  515. good_origin_place:this.form.good_origin_place,
  516. license_number:this.form.license_number,
  517. remark:this.form.remark,
  518. warehousing_order:this.form.warehousing_order,
  519. dealer:this.form.dealer,
  520. start_time:this.getTime(new Date()),
  521. number:this.form.number,
  522. warehousing_info_id:0,
  523. product_date:this.form.product_date,
  524. expiry_date:this.form.expiry_date,
  525. total:this.form.total,
  526. }
  527. this.tableData.push(obj)
  528. this.form.good_id = 0
  529. this.form.good_name = ""
  530. this.form.specification_name = ""
  531. this.form.warehousing_unit = ""
  532. this.form.count = ""
  533. this.form.buy_price = ""
  534. this.form.packing_price = ""
  535. this.form.manufacturer = ""
  536. this.form.good_origin_place = ""
  537. this.form.license_number = ""
  538. this.form.remark = ""
  539. this.form.warehousing_order = ""
  540. this.form.dealer = ""
  541. this.form.number = ""
  542. this.form.good_id = ""
  543. this.form.total= ""
  544. },
  545. saveReportStock(){
  546. for(let i = 0;i<this.tableData.length;i++){
  547. if(this.tableData[i].manufacturer == 0){
  548. this.tableData[i].manufacturer = ""
  549. }
  550. if(this.tableData[i].dealer == 0){
  551. this.tableData[i].dealer = ""
  552. }
  553. }
  554. console.log("比阿哥",this.tableData)
  555. console.log("numberlist",this.numberList)
  556. for(let i=0;i<this.tableData.length;i++){
  557. this.tableData[i].count = parseInt(this.tableData[i].count)
  558. this.tableData[i].expiry_date = parseInt(this.tableData[i].expiry_date)
  559. this.tableData[i].product_date = parseInt(this.tableData[i].product_date)
  560. this.tableData[i].total = parseInt(this.tableData[i].total)
  561. for(let j=0;j<this.numberList.length;j++){
  562. if(this.tableData[i].number == this.numberList[j].number){
  563. this.tableData[i].warehousing_info_id = this.numberList[j].id
  564. }
  565. }
  566. }
  567. var params = {
  568. tableData:this.tableData,
  569. }
  570. console.log("params",params)
  571. saveReportStock(params).then(response=>{
  572. if(response.data.state == 1){
  573. var msg = response.data.data.msg
  574. this.$message.success("保存成功")
  575. this.dialogVisible = false
  576. this.getlist()
  577. this.tableData = []
  578. this.form.good_name = ""
  579. this.form.packing_price = ""
  580. this.form.warehousing_order = ""
  581. this.form.license_number = ""
  582. this.form.dealer = ""
  583. this.form.manufacturer = ""
  584. this.form.specification_name = ""
  585. this.form.remark =""
  586. this.form.buy_price = ""
  587. this.form.warehousing_unit = ""
  588. this.form.total = ""
  589. this.form.number = ""
  590. }
  591. })
  592. },
  593. getTime(val) {
  594. if(val < 0){
  595. return ""
  596. }
  597. if(val == ""){
  598. return ""
  599. }else {
  600. return uParseTime(val, '{y}-{m}-{d}')
  601. }
  602. },
  603. getlist(){
  604. var params = {
  605. start_time:this.start_time,
  606. end_time:this.end_time,
  607. keyword:this.searchKey,
  608. limit:this.limit,
  609. page:this.page,
  610. }
  611. console.log("param23223232322323",params)
  612. getReportStockList(params).then(response=>{
  613. if(response.data.state == 1){
  614. var list = response.data.data.list
  615. console.log("list",list)
  616. this.total = response.data.data.total
  617. this.tableList = list
  618. var doctorlist = response.data.data.doctorlist
  619. this.doctorList = doctorlist
  620. var damageList = response.data.data.damageList
  621. console.log("datamagelist",damageList)
  622. this.damageList = damageList
  623. }
  624. })
  625. },
  626. exportList(){
  627. import('@/vendor/Export2Excel').then(excel => {
  628. const tHeader = ['报损编码', '报损日期', '报损数量','操作人','审核日期','核对人','状态']
  629. const filterVal = ['warehousing_order', 'start_time', 'count','user_name','check_time','checker','checker_status']
  630. for(let i=0;i<this.tableList.length;i++){
  631. this.tableList[i].start_time = this.getTime(this.tableList[i].start_time)
  632. this.tableList[i].check_time = this.getTime(this.tableList[i].check_time)
  633. this.tableList[i].checker = this.getChecker(this.tableList[i].checker)
  634. if(this.tableList[i].checker_status == 1){
  635. this.tableList[i].checker_status = "已核对"
  636. }
  637. if(this.tableList[i].checker_status == 2){
  638. this.tableList[i].checker_status = "未核对"
  639. }
  640. }
  641. const data = this.formatJson(filterVal, this.tableList)
  642. excel.export_json_to_excel({
  643. header: tHeader,
  644. data,
  645. filename: '耗材报损'
  646. })
  647. this.downloadLoading = false
  648. })
  649. },
  650. formatJson(filterVal, jsonData) {
  651. return jsonData.map(v => filterVal.map(j => v[j]));
  652. },
  653. getStockBatchNumber(id){
  654. var params = {
  655. id:id
  656. }
  657. getStockBatchNumber(params).then(response=>{
  658. if(response.data.state == 1){
  659. var list = response.data.data.list
  660. console.log("批号列表",list)
  661. this.numberList = list
  662. }
  663. })
  664. },
  665. getGoodWarehouseList(id){
  666. var params = {
  667. id:id,
  668. }
  669. getGoodWarehouseList(params).then(response=>{
  670. if(response.data.state == 1){
  671. var list = response.data.data.list
  672. this.form.total = list.stock_count
  673. console.log("list23232",list)
  674. }
  675. })
  676. },
  677. changeStartTime(val){
  678. this.start_time = this.getTime(val)
  679. this.getlist()
  680. },
  681. changeEndTime(val){
  682. this.end_time = this.getTime(val)
  683. this.getlist()
  684. },
  685. chageNumberlist(val){
  686. console.log("val2323322",val)
  687. for(let i=0;i<this.numberList.length;i++){
  688. if(this.numberList[i].number == val){
  689. this.form.warehousing_info_id = this.numberList[i].id
  690. }
  691. }
  692. this.getWarehouseTotal(this.form.warehousing_info_id)
  693. },
  694. getWarehouseTotal(id){
  695. var params = {
  696. id:id,
  697. }
  698. getWarehouseTotal(params).then(response=>{
  699. if(response.data.state == 1){
  700. var list = response.data.data.list
  701. console.log("档期批次库促",list)
  702. this.form.total = list.stock_count
  703. }
  704. })
  705. },
  706. getDamageCount(good_id){
  707. var count = 0
  708. for(let i=0;i<this.damageList.length;i++){
  709. if(good_id == this.damageList[i].good_id){
  710. count = this.damageList[i].count
  711. }
  712. }
  713. return count
  714. },
  715. toDamagedDetail(good_id){
  716. var params = {
  717. good_id:good_id,
  718. warehousing_order:this.form.warehousing_order,
  719. type:this.form.type,
  720. }
  721. getDamageDetailByGoodId(params).then(response=>{
  722. if(response.data.state == 1){
  723. var list = response.data.data.list
  724. console.log("list233232",list)
  725. this.modifyDialogVisible = true
  726. this.good_name = list[0].good_name
  727. this.price = list[0].buy_price
  728. this.good_id = list[0].good_id
  729. this.goodList = []
  730. this.goodList = list
  731. this.damageList = []
  732. this.damageList = response.data.data.damageList
  733. }
  734. })
  735. },
  736. toQuery(){
  737. this.toDamagedDetail(this.good_id)
  738. }
  739. },
  740. created(){
  741. // var nowDate = new Date();
  742. // var nowYear = nowDate.getFullYear();
  743. // var nowMonth = nowDate.getMonth() + 1;
  744. // var nowDay = nowDate.getDate();
  745. // this.end_time =
  746. // nowYear +
  747. // "-" +
  748. // (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  749. // "-" +
  750. // (nowDay < 10 ? "0" + nowDay : nowDay);
  751. // nowDate.setMonth(nowDate.getMonth() - 1);
  752. // nowYear = nowDate.getFullYear();
  753. // nowMonth = nowDate.getMonth() + 1;
  754. // nowDay = nowDate.getDate();
  755. // this.start_time =
  756. // nowYear +
  757. // "-" +
  758. // (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  759. // "-" +
  760. // (nowDay < 10 ? "0" + nowDay : nowDay);
  761. this.getlist()
  762. },
  763. mounted() {
  764. },
  765. };
  766. </script>
  767. <style rel="stylesheet/scss" lang="scss">
  768. .app-container {
  769. // margin: 20px;
  770. font-size: 15px;
  771. }
  772. .modifyDialog{
  773. display: flex;
  774. flex-wrap: wrap;
  775. margin-bottom: 10px;
  776. .el-form-item{
  777. width: 33%;
  778. }
  779. }
  780. .el-table td,
  781. .el-table th.is-leaf,
  782. .el-table--border,
  783. .el-table--group {
  784. border-color: #d0d3da;
  785. }
  786. .el-table--border::after,
  787. .el-table--group::after,
  788. .el-table::before {
  789. background-color: #d0d3da;
  790. }
  791. ::-webkit-scrollbar{
  792. height: 20px !important;
  793. }
  794. </style>