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

stockDamaged.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  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;margin-bottom:10px;">
  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. </el-date-picker>
  31. <el-date-picker
  32. size="small"
  33. v-model="end_time"
  34. type="date"
  35. style="margin-left:5px;width:140px;"
  36. placeholder="选择日期">
  37. </el-date-picker>
  38. </div>
  39. <div>
  40. <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
  41. <el-button size="small" type="primary">核对</el-button>
  42. <el-button size="small" type="primary" @click="print">打印</el-button>
  43. <el-button size="small" type="primary">导出</el-button>
  44. </div>
  45. </div>
  46. <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
  47. <el-table-column
  48. prop="date"
  49. label="报损编码">
  50. </el-table-column>
  51. <el-table-column
  52. prop="date"
  53. label="报损日期">
  54. </el-table-column>
  55. <el-table-column
  56. prop="name"
  57. label="操作人">
  58. </el-table-column>
  59. <el-table-column
  60. prop="name"
  61. label="审核日期">
  62. </el-table-column>
  63. <el-table-column
  64. prop="name"
  65. label="核对人">
  66. </el-table-column>
  67. <el-table-column
  68. prop="name"
  69. label="状态">
  70. </el-table-column>
  71. <el-table-column
  72. label="操作">
  73. <template slot-scope="scope">
  74. <el-button type="text" size="small">删除</el-button>
  75. <el-button type="text" size="small">编辑</el-button>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <el-pagination
  80. @size-change="handleSizeChange"
  81. @current-change="handleCurrentChange"
  82. :page-sizes="[5, 10, 50, 100]"
  83. :page-size="5"
  84. background
  85. style="margin-top:20px;text-align: right"
  86. layout="total, sizes, prev, pager, next, jumper"
  87. :total="total"
  88. >
  89. </el-pagination>
  90. </div>
  91. <el-dialog
  92. title="耗材报损"
  93. :visible.sync="dialogVisible"
  94. width="1200px"
  95. >
  96. <el-form :model="form" class="modifyDialog" label-width="120px">
  97. <el-form-item label="耗材ID">
  98. <el-input v-model="form.good_id"></el-input>
  99. </el-form-item>
  100. <el-form-item label="耗材名称">
  101. <el-autocomplete
  102. class="checkSearch"
  103. popper-class="my-autocomplete"
  104. v-model="form.good_name"
  105. :fetch-suggestions="querySearchAsync"
  106. :trigger-on-focus="true"
  107. placeholder="请输入耗材名称"
  108. @select="handleSelect"
  109. @input="changeGoodName(scope.$index)"
  110. style="width:160px;"
  111. >
  112. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  113. <template slot-scope="{ item }">
  114. <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
  115. </template>
  116. </el-autocomplete>
  117. </el-form-item>
  118. <el-form-item label="规格">
  119. <el-input v-model="form.specification_name"></el-input>
  120. </el-form-item>
  121. <el-form-item label="单位">
  122. <el-input v-model="form.warehousing_unit"></el-input>
  123. </el-form-item>
  124. <el-form-item label="进货价">
  125. <el-input v-model="form.buy_price"></el-input>
  126. </el-form-item>
  127. <el-form-item label="零售价">
  128. <el-input v-model="form.packing_price"></el-input>
  129. </el-form-item>
  130. <el-form-item label="新零售价">
  131. <el-input v-model="form.new_price"></el-input>
  132. </el-form-item>
  133. <el-form-item label="报损数量">
  134. <el-input v-model="form.count"></el-input>
  135. </el-form-item>
  136. <el-form-item label="库存">
  137. <el-input v-model="form.total"></el-input>
  138. </el-form-item>
  139. <el-form-item label="产地">
  140. <el-input v-model="form.good_origin_place"></el-input>
  141. </el-form-item>
  142. <el-form-item label="批准文号">
  143. <el-input v-model="form.license_number"></el-input>
  144. </el-form-item>
  145. <el-form-item label="生产厂商">
  146. <el-input v-model="form.manufacturer"></el-input>
  147. </el-form-item>
  148. <el-form-item label="备注">
  149. <div style="display:flex;">
  150. <el-input v-model="form.remark"></el-input>
  151. <el-button style="margin-left:5px;" type="primary" @click="addStock">添加</el-button>
  152. </div>
  153. </el-form-item>
  154. </el-form>
  155. <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
  156. <el-table-column prop="date" label="耗材ID" width="100">
  157. <template slot-scope="scope">
  158. {{scope.row.good_id}}
  159. </template>
  160. </el-table-column>
  161. <el-table-column prop="date" label="耗材名称" width="100">
  162. <template slot-scope="scope">
  163. {{scope.row.good_name}}
  164. </template>
  165. </el-table-column>
  166. <el-table-column prop="name" label="规格" width="100">
  167. <template slot-scope="scope">
  168. {{scope.row.specification_name}}
  169. </template>
  170. </el-table-column>
  171. <el-table-column prop="name" label="单位" width="100">
  172. <template slot-scope="scope">
  173. {{scope.row.warehousing_unit}}
  174. </template>
  175. </el-table-column>
  176. <el-table-column prop="name" label="报损数量" width="100">
  177. <template slot-scope="scope">
  178. {{scope.row.count}}
  179. </template>
  180. </el-table-column>
  181. <el-table-column prop="name" label="原进货价" width="100">
  182. <template slot-scope="scope">
  183. {{scope.row.buy_price}}
  184. </template>
  185. </el-table-column>
  186. <el-table-column prop="name" label="原零售价" width="100">
  187. <template slot-scope="scope">
  188. {{scope.row.packing_price}}
  189. </template>
  190. </el-table-column>
  191. <el-table-column prop="name" label="新零售价" width="100">
  192. <template slot-scope="scope">
  193. {{scope.row.new_price}}
  194. </template>
  195. </el-table-column>
  196. <el-table-column prop="name" label="生产厂商" width="100">
  197. <template slot-scope="scope">
  198. {{scope.row.manufacturer}}
  199. </template>
  200. </el-table-column>
  201. <el-table-column prop="name" label="产地" width="100">
  202. <template slot-scope="scope">
  203. {{scope.row.good_origin_place}}
  204. </template>
  205. </el-table-column>
  206. <el-table-column prop="name" label="批准文号" width="100">
  207. <template slot-scope="scope">
  208. {{scope.row.license_number}}
  209. </template>
  210. </el-table-column>
  211. <el-table-column prop="name" label="备注" width="100">
  212. <template slot-scope="scope">
  213. {{scope.row.remark}}
  214. </template>
  215. </el-table-column>
  216. <el-table-column fixed="right" width="100" label="操作">
  217. <template slot-scope="scope">
  218. <el-button type="text" size="small">删除</el-button>
  219. <el-button type="text" size="small">编辑</el-button>
  220. </template>
  221. </el-table-column>
  222. </el-table>
  223. <span slot="footer" class="dialog-footer">
  224. <el-button @click="dialogVisible = false">取 消</el-button>
  225. <el-button type="primary" @click="saveReportStock">确 定</el-button>
  226. </span>
  227. </el-dialog>
  228. </div>
  229. </template>
  230. <script>
  231. import BreadCrumb from "../components/bread-crumb";
  232. import { uParseTime } from '@/utils/tools'
  233. import { postSearchGoodWarehouseList,saveReportStock} from "@/api/stock"
  234. export default {
  235. name: "stockModifyPrice",
  236. components:{
  237. BreadCrumb
  238. },
  239. data() {
  240. return{
  241. crumbs: [
  242. { path: false, name: "库存管理" },
  243. { path: false, name: "耗材管理" },
  244. { path: false, name: "耗材报损" }
  245. ],
  246. searchKey:'',
  247. value1:'',
  248. value2:'',
  249. tableData: [],
  250. dialogVisible:false,
  251. form: {
  252. id:"",
  253. good_name: '',
  254. packing_price:'',
  255. new_price:"",
  256. count:"",
  257. remark:"",
  258. warehousing_order:"",
  259. manufacturer:"",
  260. dealer:"",
  261. license_number:"",
  262. warehousing_unit:"",
  263. specification_name:"",
  264. buy_price:"",
  265. good_id:"",
  266. packing_unit:"",
  267. good_origin_place:"",
  268. report_count:"",
  269. total:"",
  270. },
  271. total: 0,
  272. currentIndex: 0,
  273. manufacturerList:[],
  274. dealerList:[],
  275. goodList:[],
  276. start_time:"",
  277. end_time:"",
  278. }
  279. },
  280. methods:{
  281. search(){
  282. },
  283. print(){
  284. this.$router.push({path:'/stock/stockModifyPricePrint'})
  285. },
  286. handleSizeChange(){},
  287. handleCurrentChange(){},
  288. changeGoodName(val){
  289. this.currentIndex = val
  290. },
  291. querySearchAsync(keyword, cb) {
  292. let key = '';
  293. if (keyword != undefined) {
  294. key = keyword
  295. }
  296. postSearchGoodWarehouseList(key).then(response => {
  297. if (response.data.state == 1) {
  298. var list = response.data.data.list
  299. console.log("列表数据",list)
  300. this.goodList = list
  301. var manufacturerList = response.data.data.manufacturerList
  302. this.manufacturerList = manufacturerList
  303. var dealer = response.data.data.dealerList
  304. this.dealerList = dealer
  305. for(let i=0;i<this.goodList.length;i++){
  306. for(let j=0;j<this.manufacturerList.length;j++){
  307. if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
  308. this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
  309. }
  310. }
  311. }
  312. for(let i=0;i<this.goodList.length;i++){
  313. for(let j=0;j<this.dealerList.length;j++){
  314. if(this.goodList[i].dealer == this.dealerList[j].id){
  315. this.goodList[i].dealer = this.dealerList[j].dealer_name
  316. }
  317. }
  318. }
  319. cb(this.goodList)
  320. } else {
  321. cb([])
  322. }
  323. })
  324. },
  325. handleSelect(val){
  326. console.log("val23232323",val)
  327. this.form.id = val.id
  328. this.form.good_id = val.good_id,
  329. this.form.good_name = val.good_name
  330. this.form.packing_price = val.packing_price
  331. this.form.warehousing_order = val.warehousing_order
  332. this.form.license_number = val.license_number
  333. this.form.dealer = val.dealer
  334. this.form.manufacturer = val.manufacturer
  335. this.form.specification_name = val.specification_name
  336. this.form.remark = val.remark
  337. this.form.buy_price = val.buy_price
  338. this.form.warehousing_unit = val.packing_unit
  339. this.form.total = val.total
  340. this.form.new_price = val.new_price
  341. },
  342. addStock(){
  343. var obj = {
  344. good_id:this.form.good_id,
  345. good_name:this.form.good_name,
  346. specification_name:this.form.specification_name,
  347. warehousing_unit:this.form.warehousing_unit,
  348. count:parseInt(this.form.count),
  349. buy_price:this.form.buy_price.toString(),
  350. packing_price:this.form.packing_price.toString(),
  351. manufacturer:this.form.manufacturer,
  352. good_origin_place:this.form.good_origin_place,
  353. license_number:this.form.license_number,
  354. remark:this.form.remark,
  355. new_price:this.form.new_price.toString(),
  356. warehousing_order:this.form.warehousing_order,
  357. dealer:this.form.dealer,
  358. start_time:this.getTime(new Date()),
  359. }
  360. this.tableData.push(obj)
  361. },
  362. saveReportStock(){
  363. var params = {
  364. tableData:this.tableData,
  365. }
  366. console.log("params",params)
  367. saveReportStock(params).then(response=>{
  368. if(response.data.state == 1){
  369. var msg = response.data.data.msg
  370. this.$message.success("保存成功")
  371. this.dialogVisible = false
  372. }
  373. })
  374. },
  375. getTime(val) {
  376. if(val < 0){
  377. return ""
  378. }
  379. if(val == ""){
  380. return ""
  381. }else {
  382. return uParseTime(val, '{y}-{m}-{d}')
  383. }
  384. },
  385. getlist(){
  386. getReportStockList().then(response=>{
  387. })
  388. }
  389. },
  390. created(){
  391. this.getlist()
  392. },
  393. mounted() {
  394. },
  395. };
  396. </script>
  397. <style rel="stylesheet/scss" lang="scss">
  398. .app-container {
  399. // margin: 20px;
  400. font-size: 15px;
  401. }
  402. .modifyDialog{
  403. display: flex;
  404. flex-wrap: wrap;
  405. margin-bottom: 10px;
  406. .el-form-item{
  407. width: 33%;
  408. }
  409. }
  410. .el-table td,
  411. .el-table th.is-leaf,
  412. .el-table--border,
  413. .el-table--group {
  414. border-color: #d0d3da;
  415. }
  416. .el-table--border::after,
  417. .el-table--group::after,
  418. .el-table::before {
  419. background-color: #d0d3da;
  420. }
  421. ::-webkit-scrollbar{
  422. height: 20px !important;
  423. }
  424. </style>