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

stockModifyPrice.vue 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div style="display: flex;align-items: center;justify-content: space-between;">
  8. <div>
  9. <el-input
  10. size="small"
  11. style="width: 200px;"
  12. class="filter-item"
  13. v-model.trim="searchKey"
  14. placeholder="请输入单据编号或操作人姓名"
  15. />
  16. <el-button
  17. size="small"
  18. class="filter-item"
  19. type="primary"
  20. icon="el-icon-search"
  21. @click="search"
  22. >搜索</el-button
  23. >
  24. <el-date-picker
  25. size="small"
  26. v-model="start_time"
  27. type="date"
  28. style="margin-left:5px;width:140px;"
  29. placeholder="选择日期"
  30. @change="changeStartTime">
  31. </el-date-picker>
  32. <el-date-picker
  33. size="small"
  34. v-model="end_time"
  35. type="date"
  36. style="margin-left:5px;width:140px;"
  37. placeholder="选择日期"
  38. @change="changeEndTime">
  39. </el-date-picker>
  40. </div>
  41. <div>
  42. <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
  43. <el-button size="small" type="primary" @click="toCheck">核对</el-button>
  44. <!-- <el-button size="small" type="primary" @click="print">打印</el-button>
  45. <el-button size="small" type="primary" @click="toExport">导出</el-button> -->
  46. </div>
  47. </div>
  48. <div>
  49. <div style="width:100%;margin-right:10px;margin-top:10px">
  50. <el-table :data="tableList" border :height="tableHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
  51. <el-table-column type="selection" width="55" align="center"> </el-table-column>
  52. <el-table-column prop="date" label="单据编码" width="100">
  53. <template slot-scope="scope" align="center">
  54. {{scope.row.warehousing_order}}
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="耗材名称" width="100" align="center">
  58. <template slot-scope="scope">
  59. {{scope.row.good_name}}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="规格" width="100" align="center">
  63. <template slot-scope="scope">
  64. {{scope.row.specification_name}}
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="单位" width="100" align="center">
  68. <template slot-scope="scope">
  69. {{scope.row.packing_unit}}
  70. </template>
  71. </el-table-column>
  72. <!-- <el-table-column label="调价数量" width="100" align="center">
  73. <template slot-scope="scope">
  74. {{scope.row.count}}
  75. </template>
  76. </el-table-column> -->
  77. <el-table-column label="原进货价" width="100" align="center">
  78. <template slot-scope="scope">
  79. {{scope.row.buy_price}}
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="原零售价" width="100" align="center">
  83. <template slot-scope="scope">
  84. {{scope.row.packing_price}}
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="现零价" width="100" align="center">
  88. <template slot-scope="scope">
  89. {{scope.row.new_price}}
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="生产厂商" width="100" align="center">
  93. <template slot-scope="scope">
  94. {{scope.row.manufacturer}}
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="经销商" width="100" align="center">
  98. <template slot-scope="scope">
  99. {{scope.row.dealer}}
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="操作人" width="100" align="center">
  103. <template slot-scope="scope">
  104. {{getDoctor(scope.row.creater)}}
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="核对人" width="100" align="center">
  108. <template slot-scope="scope">
  109. {{getDoctor(scope.row.checker)}}
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="状态" width="100" align="center">
  113. <template slot-scope="scope">
  114. <span v-if="scope.row.checker_status == 2">未核对</span>
  115. <span v-if="scope.row.checker_status == 1">已核对</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column prop="date" label="调价日期" width="100" align="center">
  119. <template slot-scope="scope">
  120. {{getTime(scope.row.start_time)}}
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="备注" width="100" align="center">
  124. <template slot-scope="scope">
  125. {{scope.row.remark}}
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="操作" align="center" width="200">
  129. <template slot-scope="scope">
  130. <el-button type="primary" size="small" @click="modifyPrice(scope.row.id,scope.row.checker_status)">编辑</el-button>
  131. <el-button type="danger" size="small" @click="deleteStockPrice(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. <el-pagination
  136. @size-change="handleSizeChange"
  137. @current-change="handleCurrentChange"
  138. :page-sizes="[10, 20, 40, 100]"
  139. :page-size="10"
  140. background
  141. style="margin-top:20px;text-align: right"
  142. layout="total, sizes, prev, pager, next, jumper"
  143. :total="total">
  144. </el-pagination>
  145. </div>
  146. </div>
  147. </div>
  148. <el-dialog
  149. title="库房调价"
  150. :visible.sync="dialogVisible"
  151. width="1200px">
  152. <el-form :model="form" class="modifyDialog" label-width="120px">
  153. <el-form-item label="耗材名称">
  154. <!-- <el-input v-model="form.name"></el-input> -->
  155. <el-autocomplete
  156. class="checkSearch"
  157. popper-class="my-autocomplete"
  158. v-model="form.good_name"
  159. :fetch-suggestions="querySearchAsync"
  160. :trigger-on-focus="true"
  161. placeholder="请输入耗材名称"
  162. @select="handleSelect"
  163. @input="changeGoodName(scope.$index)"
  164. style="width:160px;"
  165. >
  166. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  167. <template slot-scope="{ item }">
  168. <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
  169. </template>
  170. </el-autocomplete>
  171. </el-form-item>
  172. <el-form-item label="规格">
  173. <el-input v-model="form.specification_name" :disabled="true"></el-input>
  174. </el-form-item>
  175. <el-form-item label="原价格">
  176. <el-input v-model="form.packing_price" :disabled="true"></el-input>
  177. </el-form-item>
  178. <el-form-item label="现价格">
  179. <el-input v-model="form.new_price"></el-input>
  180. </el-form-item>
  181. <el-form-item label="生产商">
  182. <el-input v-model="form.manufacturer" :disabled="true"></el-input>
  183. </el-form-item>
  184. <el-form-item label="供应商">
  185. <el-input v-model="form.dealer" :disabled="true"></el-input>
  186. </el-form-item>
  187. <el-form-item label="备注" style="width:66%;">
  188. <div style="display:flex;">
  189. <el-input v-model="form.remark"></el-input>
  190. <el-button style="margin-left:5px;" type="primary" @click="addPrice">添加</el-button>
  191. </div>
  192. </el-form-item>
  193. </el-form>
  194. <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
  195. <el-table-column prop="date" label="单据编号" width="100" align="center">
  196. <template slot-scope="scope">
  197. {{scope.row.warehousing_order}}
  198. </template>
  199. </el-table-column>
  200. <el-table-column prop="date" label="耗材名称" width="100" align="center">
  201. <template slot-scope="scope">
  202. {{scope.row.good_name}}
  203. </template>
  204. </el-table-column>
  205. <el-table-column prop="name" label="规格" width="100" align="center">
  206. <template slot-scope="scope">
  207. {{scope.row.specification_name}}
  208. </template>
  209. </el-table-column>
  210. <el-table-column prop="name" label="单位" width="100" align="center">
  211. <template slot-scope="scope">
  212. {{scope.row.warehousing_unit}}
  213. </template>
  214. </el-table-column>
  215. <el-table-column prop="name" label="原进货价" width="100" align="center">
  216. <template slot-scope="scope">
  217. {{scope.row.buy_price}}
  218. </template>
  219. </el-table-column>
  220. <el-table-column prop="name" label="原零售价" width="100" align="center">
  221. <template slot-scope="scope">
  222. {{scope.row.packing_price}}
  223. </template>
  224. </el-table-column>
  225. <el-table-column prop="name" label="新零售价" width="100" align="center">
  226. <template slot-scope="scope">
  227. {{scope.row.new_price}}
  228. </template>
  229. </el-table-column>
  230. <el-table-column prop="manufacturer" label="生产厂商" width="100" align="center">
  231. <template slot-scope="scope">
  232. {{scope.row.manufacturer}}
  233. </template>
  234. </el-table-column>
  235. <el-table-column prop="name" label="批准文号" width="100" align="center">
  236. <template slot-scope="scope">
  237. {{scope.row.license_number}}
  238. </template>
  239. </el-table-column>
  240. <el-table-column prop="name" label="经销商" width="100" align="center">
  241. <template slot-scope="scope">
  242. {{scope.row.dealer}}
  243. </template>
  244. </el-table-column>
  245. <el-table-column prop="name" label="备注" width="100" align="center">
  246. <template slot-scope="scope">
  247. {{scope.row.remark}}
  248. </template>
  249. </el-table-column>
  250. <el-table-column
  251. fixed="right"
  252. width="100"
  253. label="操作">
  254. <template slot-scope="scope">
  255. <el-button type="text" size="small" @click="deletePrice(scope.$index)">删除</el-button>
  256. <el-button type="text" size="small" @click="editPrice(scope.row)">编辑</el-button>
  257. </template>
  258. </el-table-column>
  259. </el-table>
  260. <span slot="footer" class="dialog-footer">
  261. <el-button @click="dialogVisible = false">取 消</el-button>
  262. <el-button type="primary" @click="saveAdjustPrice">确 定</el-button>
  263. </span>
  264. </el-dialog>
  265. <!-- 编辑调价 -->
  266. <el-dialog
  267. title="编辑"
  268. :visible.sync="editPriceDialogVisible"
  269. width="50%">
  270. <span>
  271. <el-form :model="form">
  272. <el-row>
  273. <el-col>
  274. <el-form-item label="耗材名称:">
  275. <el-autocomplete
  276. class="checkSearch"
  277. popper-class="my-autocomplete"
  278. v-model="form.good_name"
  279. :fetch-suggestions="querySearchAsync"
  280. :trigger-on-focus="true"
  281. placeholder="请输入耗材名称"
  282. @select="handleSelect"
  283. @input="changeGoodName(scope.$index)"
  284. style="width:160px;"
  285. >
  286. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  287. <template slot-scope="{ item }">
  288. <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
  289. </template>
  290. </el-autocomplete>
  291. </el-form-item>
  292. <el-form-item label="规格">
  293. <el-input v-model="form.specification_name" style="width:200px" :disabled="true"></el-input>
  294. </el-form-item>
  295. <el-form-item label="生产厂商">
  296. <el-input v-model="form.manufacturer" style="width:200px" :disabled="true"></el-input>
  297. </el-form-item>
  298. <el-form-item label="供应商">
  299. <el-input v-model="form.dealer" style="width:200px" :disabled="true"></el-input>
  300. </el-form-item>
  301. <el-form-item label="原价格:">
  302. <el-input v-model="form.packing_price" style="width:200px" :disabled="true"></el-input>
  303. </el-form-item>
  304. <el-form-item label="现价格:">
  305. <el-input v-model="form.new_price" style="width:200px"></el-input>
  306. </el-form-item>
  307. <el-form-item label="备注:">
  308. <el-input v-model="form.remark" style="width:200px"></el-input>
  309. </el-form-item>
  310. </el-col>
  311. </el-row>
  312. </el-form>
  313. </span>
  314. <span slot="footer" class="dialog-footer">
  315. <el-button @click="editPriceDialogVisible = false">取 消</el-button>
  316. <el-button type="primary" @click="upatePrice">保存</el-button>
  317. </span>
  318. </el-dialog>
  319. <el-dialog
  320. title="耗材调价核对"
  321. :visible.sync="checkDialogVisible"
  322. width="30%"
  323. >
  324. <span>
  325. <el-form :model="form">
  326. <el-row>
  327. <el-col>
  328. <el-form-item label="核对时间">
  329. <el-date-picker
  330. size="small"
  331. v-model="check_time"
  332. type="date"
  333. style="margin-left:5px;width:140px;"
  334. placeholder="选择日期">
  335. </el-date-picker>
  336. </el-form-item>
  337. </el-col>
  338. </el-row>
  339. <el-row>
  340. <el-col>
  341. <el-form-item label="核对人">
  342. <el-select v-model="checker" placeholder="请选择">
  343. <el-option
  344. v-for="item in doctorList"
  345. :key="item.admin_user_id"
  346. :label="item.user_name"
  347. :value="item.admin_user_id">
  348. </el-option>
  349. </el-select>
  350. </el-form-item>
  351. </el-col>
  352. </el-row>
  353. </el-form>
  354. </span>
  355. <span slot="footer" class="dialog-footer">
  356. <el-button @click="checkDialogVisible = false">取 消</el-button>
  357. <el-button type="primary" @click="SaveCheckedPrice">保 存</el-button>
  358. </span>
  359. </el-dialog>
  360. <el-dialog
  361. title="耗材调价编辑"
  362. :visible.sync="modifyDialogVisible"
  363. width="30%"
  364. >
  365. <span>
  366. <el-form :model="form">
  367. <el-row>
  368. <el-col>
  369. <el-form-item label="耗材名称:">
  370. <el-autocomplete
  371. class="checkSearch"
  372. popper-class="my-autocomplete"
  373. v-model="form.good_name"
  374. :fetch-suggestions="querySearchAsync"
  375. :trigger-on-focus="true"
  376. placeholder="请输入耗材名称"
  377. @select="handleSelect"
  378. @input="changeGoodName(scope.$index)"
  379. style="width:160px;"
  380. >
  381. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  382. <template slot-scope="{ item }">
  383. <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
  384. </template>
  385. </el-autocomplete>
  386. </el-form-item>
  387. <el-form-item label="规格:">
  388. <el-input v-model="form.specification_name" style="width:200px" :disabled="true"></el-input>
  389. </el-form-item>
  390. <el-form-item label="原价格:">
  391. <el-input v-model="form.packing_price" style="width:200px" :disabled="true"></el-input>
  392. </el-form-item>
  393. <el-form-item label="现价格:">
  394. <el-input v-model="form.new_price" style="width:200px"></el-input>
  395. </el-form-item>
  396. <el-form-item label="生产商">
  397. <el-input v-model="form.manufacturer" style="width:200px" :disabled="true"></el-input>
  398. </el-form-item>
  399. <el-form-item label="供应商">
  400. <el-input v-model="form.dealer" style="width:200px" :disabled="true"></el-input>
  401. </el-form-item>
  402. <el-form-item label="备注:">
  403. <el-input v-model="form.remark" style="width:200px"></el-input>
  404. </el-form-item>
  405. </el-col>
  406. </el-row>
  407. </el-form>
  408. </span>
  409. <span slot="footer" class="dialog-footer">
  410. <el-button @click="modifyDialogVisible = false">取 消</el-button>
  411. <el-button type="primary" @click="updateStockPrice">保 存</el-button>
  412. </span>
  413. </el-dialog>
  414. </div>
  415. </template>
  416. <script>
  417. import BreadCrumb from "../components/bread-crumb";
  418. import { postSearchGoodWarehouseList,saveAdjustPrice,getAllStockPrice,SaveCheckedPrice,getModifyPriceDetail,updateStockPrice,deleteStockPrice} from "@/api/stock"
  419. import { uParseTime } from '@/utils/tools'
  420. export default {
  421. name: "stockModifyPrice",
  422. components:{
  423. BreadCrumb
  424. },
  425. data() {
  426. return{
  427. crumbs: [
  428. { path: false, name: "库存管理" },
  429. { path: false, name: "耗材管理" },
  430. { path: false, name: "耗材调价" }
  431. ],
  432. tableHeight: '',
  433. fullHeight: document.documentElement.clientHeight,
  434. searchKey:'',
  435. value1:'',
  436. value2:'',
  437. tableData: [],
  438. dialogVisible:false,
  439. form: {
  440. id:"",
  441. good_name: '',
  442. packing_price:'',
  443. new_price:"",
  444. count:"",
  445. remark:"",
  446. warehousing_order:"",
  447. manufacturer:"",
  448. dealer:"",
  449. license_number:"",
  450. warehousing_unit:"",
  451. specification_name:"",
  452. buy_price:"",
  453. good_id:"",
  454. packing_unit:"",
  455. },
  456. goodList:[],
  457. manufacturerList:[],
  458. dealerList:[],
  459. currentIndex: 0,
  460. editPriceDialogVisible:false,
  461. tableList:[],
  462. doctorList:[],
  463. start_time:"",
  464. end_time:"",
  465. ids:"",
  466. check_time:new Date(),
  467. checker:this.$store.getters.xt_user.user.id,
  468. checkDialogVisible:false,
  469. limit:10,
  470. page:1,
  471. total:0,
  472. modifyDialogVisible:false,
  473. id:0,
  474. }
  475. },
  476. methods:{
  477. search(){
  478. this.getAllStockPrice()
  479. },
  480. print(){
  481. if(this.ids == ""){
  482. this.$message.error("请勾选打印数据")
  483. return
  484. }
  485. this.$router.push({path:'/stock/stockModifyPricePrint?ids='+this.ids})
  486. },
  487. querySearchAsync(keyword, cb) {
  488. let key = '';
  489. if (keyword != undefined) {
  490. key = keyword
  491. }
  492. postSearchGoodWarehouseList(key).then(response => {
  493. if (response.data.state == 1) {
  494. var list = response.data.data.list
  495. console.log("列表数据",list)
  496. this.goodList = list
  497. var manufacturerList = response.data.data.manufacturerList
  498. this.manufacturerList = manufacturerList
  499. var dealer = response.data.data.dealerList
  500. this.dealerList = dealer
  501. for(let i=0;i<this.goodList.length;i++){
  502. for(let j=0;j<this.manufacturerList.length;j++){
  503. if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
  504. this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
  505. }
  506. }
  507. }
  508. for(let i=0;i<this.goodList.length;i++){
  509. for(let j=0;j<this.dealerList.length;j++){
  510. if(this.goodList[i].dealer == this.dealerList[j].id){
  511. this.goodList[i].dealer = this.dealerList[j].dealer_name
  512. }
  513. }
  514. }
  515. cb(this.goodList)
  516. } else {
  517. cb([])
  518. }
  519. })
  520. },
  521. changeGoodName(val){
  522. this.currentIndex = val
  523. },
  524. handleSelect(val){
  525. console.log("val23232323",val)
  526. this.form.id = val.id
  527. this.form.good_id = val.good_id,
  528. this.form.good_name = val.good_name
  529. this.form.packing_price = val.packing_price
  530. this.form.warehousing_order = val.warehousing_order
  531. this.form.license_number = val.license_number
  532. if(val.dealer == 0){
  533. this.form.dealer = ""
  534. }else{
  535. this.form.dealer = val.dealer
  536. }
  537. // if(this.form.manufacturer == 0){
  538. // this.form.manufacturer = ""
  539. // }else{
  540. // this.form.manufacturer = val.manufacturer
  541. // }
  542. this.form.manufacturer = val.manufacturer
  543. this.form.specification_name = val.specification_name
  544. this.form.remark = val.remark
  545. this.form.buy_price = val.buy_price
  546. this.form.warehousing_unit = val.packing_unit
  547. },
  548. addPrice(){
  549. if(this.form.new_price == ""){
  550. this.$message.error("请输入现价格")
  551. return
  552. }
  553. var obj = {
  554. id:this.form.id,
  555. good_name:this.form.good_name,
  556. specification_name:this.form.specification_name,
  557. warehousing_order:this.form.warehousing_order,
  558. good_name:this.form.good_name,
  559. packing_price:this.form.packing_price,
  560. license_number:this.form.license_number,
  561. dealer:this.form.dealer,
  562. manufacturer:this.form.manufacturer,
  563. warehousing_unit:this.form.warehousing_unit,
  564. start_time:this.getTime(new Date()),
  565. count:this.form.count,
  566. new_price:this.form.new_price,
  567. remark:this.form.remark,
  568. buy_price:this.form.buy_price,
  569. good_id:this.form.good_id,
  570. }
  571. this.tableData.push(obj)
  572. this.form.good_name = ""
  573. this.form.specification_name = ""
  574. this.form.warehousing_order = ""
  575. this.form.good_name = ""
  576. this.form.packing_price = ""
  577. this.form.license_number= ""
  578. this.form.dealer = ""
  579. this.form.manufacturer = ""
  580. this.form.warehousing_unit = ""
  581. this.form.count = ""
  582. this.form.new_price = ""
  583. this.form.remark = ""
  584. this.form.buy_price= ""
  585. },
  586. getTime(val) {
  587. if(val < 0){
  588. return ""
  589. }
  590. if(val == ""){
  591. return ""
  592. }else {
  593. return uParseTime(val, '{y}-{m}-{d}')
  594. }
  595. },
  596. deletePrice(index){
  597. this.tableData.splice(index,1)
  598. },
  599. editPrice(row){
  600. console.log("row232233223",row)
  601. this.form.good_name = row.good_name
  602. this.form.packing_price = row.packing_price
  603. this.form.packing_unit = row.packing_unit
  604. this.form.new_price = row.new_price
  605. this.form.count = row.count
  606. this.form.remark = row.remark
  607. this.form.id = row.id
  608. this.form.specification_name = row.specification_name
  609. this.form.manufacturer = row.manufacturer
  610. this.form.dealer = row.dealer
  611. this.editPriceDialogVisible = true
  612. },
  613. upatePrice(){
  614. if(this.form.new_price == ""){
  615. this.$message.error("请输入现价格")
  616. return false
  617. }
  618. for(let i=0;i<this.tableData.length;i++){
  619. if(this.form.id == this.tableData[i].id){
  620. this.tableData[i].good_name = this.form.good_name
  621. this.tableData[i].packing_price = this.form.packing_price
  622. this.tableData[i].new_price = this.form.new_price
  623. this.tableData[i].count = this.form.count
  624. this.tableData[i].remark = this.form.remark
  625. }
  626. }
  627. this.editPriceDialogVisible = false
  628. this.form.good_name = ""
  629. this.form.packing_price = ""
  630. this.form.new_price = ""
  631. this.form.count = ""
  632. this.form.remark = ""
  633. },
  634. saveAdjustPrice(){
  635. for(let i=0;i<this.tableData.length;i++){
  636. this.tableData[i].buy_price = this.tableData[i].buy_price.toString()
  637. this.tableData[i].packing_price = this.tableData[i].packing_price.toString()
  638. this.tableData[i].new_price = this.tableData[i].new_price.toString()
  639. // this.tableData[i].count = parseInt(this.tableData[i].count)
  640. this.tableData[i].count = 0
  641. if(this.tableData[i].dealer == 0){
  642. this.tableData[i].dealer = ""
  643. }
  644. if(this.tableData[i].manufacturer == 0){
  645. this.tableData[i].manufacturer = ""
  646. }
  647. }
  648. var params= {
  649. tableData:this.tableData,
  650. }
  651. console.log("parasm222",params)
  652. saveAdjustPrice(params).then(response=>{
  653. if(response.data.state == 1){
  654. var msg = response.data.data.msg
  655. console.log("msg",msg)
  656. this.$message.success("保存成功!")
  657. this.dialogVisible = false
  658. this.tableData = []
  659. this.getAllStockPrice()
  660. }
  661. })
  662. },
  663. getAllStockPrice(){
  664. var params = {
  665. keyword:this.searchKey,
  666. start_time:this.start_time,
  667. end_time:this.end_time,
  668. limit:this.limit,
  669. page:this.page,
  670. }
  671. console.log("params",params)
  672. getAllStockPrice(params).then(response=>{
  673. if(response.data.state == 1){
  674. var list = response.data.data.list
  675. console.log("zhognguoffs",list)
  676. this.tableList = list
  677. var doctor = response.data.data.doctor
  678. console.log("doctor",doctor)
  679. this.doctorList = doctor
  680. this.total = response.data.data.total
  681. }
  682. })
  683. },
  684. getDoctor(id){
  685. var user_name = ""
  686. for(let i=0;i<this.doctorList.length;i++){
  687. if(id == this.doctorList[i].admin_user_id){
  688. user_name = this.doctorList[i].user_name
  689. }
  690. }
  691. return user_name
  692. },
  693. changePrice(val){
  694. console.log("val23232322323",val)
  695. var arr = []
  696. for(let i=0;i<val.length;i++){
  697. arr.push(val[i].id)
  698. }
  699. var str = arr.join(",")
  700. console.log("str",str)
  701. this.ids = str
  702. },
  703. toCheck(){
  704. if(this.ids.length <=0){
  705. this.$message.error("请勾选核对数据")
  706. return
  707. }else{
  708. this.checkDialogVisible = true
  709. }
  710. },
  711. SaveCheckedPrice(){
  712. var params = {
  713. ids:this.ids,
  714. check_time:this.getTime(this.check_time),
  715. checker:this.checker,
  716. }
  717. console.log("params",params)
  718. SaveCheckedPrice(params).then(response=>{
  719. if(response.data.state == 1){
  720. var adjustPrice = response.data.data.adjustPrice
  721. this.$message.success("保存成功")
  722. this.getAllStockPrice()
  723. this.checkDialogVisible = false
  724. }
  725. })
  726. },
  727. handleSizeChange(val){
  728. this.limit = val
  729. this.getAllStockPrice()
  730. },
  731. handleCurrentChange(val){
  732. this.page = val
  733. this.getAllStockPrice()
  734. },
  735. toExport(){
  736. import('@/vendor/Export2Excel').then(excel => {
  737. for(let i=0;i<this.tableList.length;i++){
  738. this.tableList[i].start_time = this.getTime(this.tableList[i].start_time)
  739. this.tableList[i].creater = this.getDoctor(this.tableList[i].creater)
  740. this.tableList[i].checker = this.getDoctor(this.tableList[i].checker)
  741. }
  742. console.log("表格",this.tableList)
  743. const tHeader = ['单据编码','调价日期','操作人','审核人','耗材名称','规格','生产厂家','批注文书','经销商','数量','原零价','现零价','进货价','零售总价','批号','生产日期','有效日期']
  744. const filterVal = ['warehousing_order', 'start_time','creater','checker','good_name','specification_name','manufacturer','license_number','dealer','count','packing_price','new_price','buy_price','','','','']
  745. console.log("table",this.tableList)
  746. const data = this.formatJson(filterVal, this.tableList)
  747. excel.export_json_to_excel({
  748. header: tHeader,
  749. data,
  750. filename: '调价明细表'
  751. })
  752. this.downloadLoading = false
  753. })
  754. },
  755. formatJson(filterVal, jsonData) {
  756. return jsonData.map(v => filterVal.map(j => v[j]));
  757. },
  758. modifyPrice(id,check_status){
  759. if(check_status == 1){
  760. this.$message.error("已核对不能编辑")
  761. return
  762. }
  763. getModifyPriceDetail(id).then(response=>{
  764. if(response.data.state == 1){
  765. var info = response.data.data.detail
  766. console.log("info",info)
  767. this.id = info.id
  768. this.good_id = info.good_id,
  769. this.form.good_name = info.good_name
  770. if(info.new_price == 0){
  771. this.form.new_price = ""
  772. }else{
  773. this.form.new_price = info.new_price
  774. }
  775. this.form.specification_name = info.specification_name
  776. this.form.packing_price = info.packing_price
  777. this.form.remark = info.remark
  778. this.form.manufacturer = info.manufacturer
  779. this.form.dealer = info.dealer
  780. this.modifyDialogVisible = true
  781. }
  782. })
  783. },
  784. updateStockPrice(){
  785. if(this.form.new_price == ""){
  786. this.$message.error("请输入现价格")
  787. return
  788. }
  789. var params = {
  790. new_price:this.form.new_price.toString(),
  791. id:this.id,
  792. packing_price:this.form.packing_price.toString(),
  793. remark:this.form.remark,
  794. good_id:this.form.good_id,
  795. good_name:this.form.good_name,
  796. manufacturer:this.form.manufacturer,
  797. dealer:this.form.dealer,
  798. }
  799. console.log("params",params)
  800. updateStockPrice(params).then(response=>{
  801. if(response.data.state == 1){
  802. var adjust = response.data.data.adjust
  803. this.$message.success("保存成功")
  804. this.modifyDialogVisible = false
  805. this.getAllStockPrice()
  806. }
  807. })
  808. },
  809. deleteStockPrice(id,check_status,index){
  810. if(check_status == 1){
  811. this.$message.error("已核对不能编辑")
  812. return
  813. }
  814. this.$confirm('是否删除所选内容?', '提示', {
  815. confirmButtonText: '确定',
  816. cancelButtonText: '取消',
  817. type: 'warning'
  818. }).then(() => {
  819. let params = {
  820. id:id,
  821. }
  822. console.log("id23232322332233223",id)
  823. deleteStockPrice(params).then(response => {
  824. if (response.data.state == 1) {
  825. var msg = response.data.data.msg
  826. this.$message.success("保存成功")
  827. this.tableList.splice(index,1)
  828. }
  829. })
  830. }).catch(() => {
  831. this.loading = false
  832. });
  833. },
  834. changeStartTime(val){
  835. this.start_time = this.getTime(val)
  836. this.getAllStockPrice()
  837. },
  838. changeEndTime(val){
  839. this.end_time = this.getTime(val)
  840. this.getAllStockPrice()
  841. }
  842. },
  843. created(){
  844. let tableHeight = document.body.clientHeight - 200;
  845. this.tableHeight = tableHeight
  846. this.getAllStockPrice()
  847. },
  848. mounted() {
  849. const that = this;
  850. window.onresize = () => {
  851. return (() => {
  852. window.fullHeight = document.documentElement.clientHeight;
  853. that.fullHeight = window.fullHeight
  854. })()
  855. }
  856. },
  857. watch: {
  858. fullHeight(val) {
  859. if (!this.timer) {
  860. this.fullHeight = val
  861. let tableHeight = val - 200
  862. this.tableHeight = tableHeight
  863. this.timer = true
  864. let that = this
  865. setTimeout(function() {
  866. that.timer = false
  867. }, 400)
  868. }
  869. }
  870. }
  871. };
  872. </script>
  873. <style rel="stylesheet/scss" lang="scss">
  874. .app-container {
  875. // margin: 20px;
  876. font-size: 15px;
  877. }
  878. .modifyDialog{
  879. display: flex;
  880. flex-wrap: wrap;
  881. margin-bottom: 10px;
  882. .el-form-item{
  883. width: 33%;
  884. }
  885. }
  886. .el-table td,
  887. .el-table th.is-leaf,
  888. .el-table--border,
  889. .el-table--group {
  890. border-color: #d0d3da;
  891. }
  892. .el-table--border::after,
  893. .el-table--group::after,
  894. .el-table::before {
  895. background-color: #d0d3da;
  896. }
  897. ::-webkit-scrollbar{
  898. height: 20px !important;
  899. }
  900. </style>