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

goodOrderQuery.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  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="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
  8. <div>
  9. <el-date-picker
  10. size="small"
  11. v-model="start_time"
  12. prefix-icon="el-icon-date"
  13. :editable="false"
  14. style="width: 196px;"
  15. type="date"
  16. placeholder="选择日期时间"
  17. align="right"
  18. format="yyyy-MM-dd"
  19. value-format="yyyy-MM-dd"
  20. @change="startTimeChange"
  21. ></el-date-picker>-
  22. <el-date-picker
  23. size="small"
  24. v-model="end_time"
  25. prefix-icon="el-icon-date"
  26. :editable="false"
  27. style="width: 196px;"
  28. type="date"
  29. placeholder="选择日期时间"
  30. align="right"
  31. format="yyyy-MM-dd"
  32. value-format="yyyy-MM-dd"
  33. @change="endTimeChange"
  34. ></el-date-picker>
  35. <span>审核状态:</span>
  36. <el-select v-model="check_id" style="width:140px;margin-right:10px;" placeholder="请选择"
  37. @change="changeTypeName">
  38. <el-option
  39. v-for="item in checkList"
  40. :key="item.id"
  41. :label="item.name"
  42. :value="item.id">
  43. </el-option>
  44. </el-select>
  45. <el-input
  46. size="small"
  47. style="width: 200px;margin-left:10px;"
  48. class="filter-item"
  49. v-model.trim="keywords"
  50. placeholder="订单编号或供应商名称"
  51. />
  52. <el-button
  53. size="small"
  54. class="filter-item"
  55. type="primary"
  56. icon="el-icon-search"
  57. @click="search"
  58. >搜索</el-button
  59. >
  60. </div>
  61. <div>
  62. <el-button size="small" type="primary" @click="toAdd">新增</el-button>
  63. </div>
  64. </div>
  65. <el-table
  66. :row-style="{ color: '#303133' }"
  67. :header-cell-style="{
  68. backgroundColor: 'rgb(245, 247, 250)',
  69. color: '#606266'
  70. }"
  71. :data="tableList"
  72. :class="signAndWeighBoxPatients"
  73. border
  74. >
  75. <el-table-column label="单据日期" align="center">
  76. <template slot-scope="scope">
  77. <span>{{getTimes(scope.row.document_date)}}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="单据编号" align="center">
  81. <template slot-scope="scope">
  82. <span>{{scope.row.good_number}}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="供应商" align="center">
  86. <template slot-scope="scope">
  87. <span>{{getName(scope.row.supplier_id)}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="关联采购订单号" align="center" width="200">
  91. <template slot-scope="scope">
  92. <span>{{scope.row.number}}</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="采购金额" align="center">
  96. <template slot-scope="scope">
  97. <span v-if="getAllBuyPrice(scope.row.orderOut)>0">{{getAllBuyPrice(scope.row.orderOut)}}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="优惠后金额" align="center">
  101. <template slot-scope="scope">
  102. {{getAllMoney(scope.row.discount_amount,scope.row.orderOut)}}
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="已付款" align="center">
  106. <template slot-scope="scope">
  107. <span v-if="scope.row.payment >0">{{scope.row.payment}}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="数量" align="center">
  111. <template slot-scope="scope">
  112. {{getAllCount(scope.row.orderOut)}}
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="订单状态" align="center">
  116. <template slot-scope="scope">
  117. <span v-if="scope.row.is_check == 2">未审核</span>
  118. <span v-if="scope.row.is_check == 1">已审核</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="制单人" align="center">
  122. <template slot-scope="scope">
  123. {{getDocName(scope.row.creater)}}
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="审核人" align="center">
  127. <template slot-scope="scope">
  128. {{getDocName(scope.row.checker)}}
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="操作" align="center" width="260px">
  132. <template slot-scope="scope">
  133. <el-button
  134. icon="el-icon-edit-outline"
  135. size="small"
  136. type="primary"
  137. @click="toClick(scope.row)"
  138. >编辑
  139. </el-button>
  140. <el-button
  141. icon="el-icon-delete"
  142. size="small"
  143. type="danger"
  144. @click="toDelete(scope.row)"
  145. >删除
  146. </el-button>
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. <el-pagination
  151. @size-change="handleSizeChange"
  152. @current-change="handleCurrentChange"
  153. :page-sizes="[10, 50, 100,200,500,1000]"
  154. :page-size="10"
  155. background
  156. align="right"
  157. style="margin-top:20px;"
  158. layout="total, sizes, prev, pager, next, jumper"
  159. :total="total"
  160. >
  161. </el-pagination>
  162. </div>
  163. </div>
  164. </template>
  165. <script>
  166. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  167. import {getAllSupply,getAllGoodOrderList,deleteGoodOrder} from "@/api/supply"
  168. import {uParseTime } from '@/utils/tools'
  169. export default {
  170. name: "stockIn",
  171. components: {
  172. },
  173. components: {
  174. BreadCrumb
  175. },
  176. data() {
  177. return {
  178. crumbs: [
  179. { path: false, name: "采购管理" },
  180. { path: "/supply/good/order/query", name: "采购单" }
  181. ],
  182. keywords: "",
  183. total: 0,
  184. multipleSelection: [],
  185. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  186. start_time: "",
  187. end_time:"",
  188. page: 1,
  189. limit: 10,
  190. goodType: [],
  191. goodInfo: [],
  192. org_id:0,
  193. types:[],
  194. tableList:[],
  195. type_name:"",
  196. checkList:[
  197. {id:0,name:"请选择"},
  198. {id:1,name:"已审核"},
  199. {id:2,name:"未审核"},
  200. ],
  201. supplyList:[],
  202. check_id:0,
  203. doctorList:[],
  204. };
  205. },
  206. methods:{
  207. toAdd(){
  208. var id = 0
  209. this.$router.push({path:"/good/order/add?id="+id})
  210. },
  211. changeTypeName(){
  212. this.getlist()
  213. },
  214. startTimeChange(){
  215. this.getlist()
  216. },
  217. endTimeChange(){
  218. this.getlist()
  219. },
  220. search(){
  221. this.getlist()
  222. },
  223. handleSizeChange(val){
  224. this.limit = val
  225. this.getlist()
  226. },
  227. handleCurrentChange(val){
  228. this.page = val
  229. this.getlist()
  230. },
  231. getAllSupply(){
  232. getAllSupply().then(response=>{
  233. if(response.data.state == 1){
  234. var supplyList = response.data.data.supplyList
  235. this.doctorList = response.data.data.doctorList
  236. for(let i=0;i<supplyList.length;i++){
  237. this.supplyList.push(supplyList[i])
  238. }
  239. }
  240. })
  241. },
  242. getTimes(time) {
  243. if (time === '') {
  244. return ''
  245. }
  246. return uParseTime(time, '{y}-{m}-{d}')
  247. },
  248. getlist(){
  249. var params = {
  250. check_id:this.check_id,
  251. start_time:this.start_time,
  252. end_time:this.end_time,
  253. keyword:this.keywords,
  254. page:this.page,
  255. limit:this.limit,
  256. }
  257. console.log("param2323322332",params)
  258. getAllGoodOrderList(params).then(response=>{
  259. if(response.data.state == 1){
  260. var list = response.data.data.list
  261. console.log("购货单列表",list)
  262. this.tableList = list
  263. var total = response.data.data.total
  264. this.total = total
  265. }
  266. })
  267. },
  268. getName(id){
  269. var name = ""
  270. for(let i=0;i<this.supplyList.length;i++){
  271. if(id == this.supplyList[i].id){
  272. name = this.supplyList[i].supplier_name
  273. }
  274. }
  275. return name
  276. },
  277. getDocName(id){
  278. var user_name = ""
  279. for(let i=0;i<this.doctorList.length;i++){
  280. if(id == this.doctorList[i].admin_user_id){
  281. user_name = this.doctorList[i].user_name
  282. }
  283. }
  284. return user_name
  285. },
  286. getAllBuyPrice(arr){
  287. var buy_price = 0
  288. if(arr!=undefined && arr.length > 0){
  289. for(let i=0;i<arr.length;i++){
  290. buy_price += (arr[i].count * arr[i].price)
  291. }
  292. }
  293. return buy_price.toFixed(2)
  294. },
  295. getAllCount(arr){
  296. var count = 0
  297. if(arr!=undefined && arr.length > 0){
  298. for(let i=0;i<arr.length;i++){
  299. count += parseInt(arr[i].count)
  300. }
  301. }
  302. if(count == 0){
  303. return ""
  304. }
  305. if(count >0){
  306. return count
  307. }
  308. },
  309. getAllMoney(paycount,arr){
  310. var all_price= 0
  311. if(arr!=undefined && arr.length > 0){
  312. for(let i=0;i<arr.length;i++){
  313. all_price += arr[i].count * arr[i].price
  314. }
  315. }
  316. if(all_price == 0){
  317. return ""
  318. }
  319. if(all_price >0){
  320. return (all_price - all_price * (paycount/100)).toFixed(2)
  321. }
  322. },
  323. toClick(val){
  324. this.$router.push({path:"/good/order/edit?id="+val.id+"&warehousing_id="+val.warehousing_id})
  325. },
  326. toDelete(val,index){
  327. console.log("val323223233223",val)
  328. if(val.is_check == 1){
  329. this.$message.error("已审核单据,不能删除!")
  330. return false
  331. }
  332. if(val.cancelOut.length >0 ){
  333. this.$message.error("已关联单据,不能删除!")
  334. return false
  335. }
  336. this.$confirm('确认删除吗?', '删除', {
  337. confirmButtonText: '确 定',
  338. cancelButtonText: '取 消',
  339. type: 'warning'
  340. }).then(() => {
  341. deleteGoodOrder(val.id).then(response => {
  342. if (response.data.state == 1) {
  343. var msg = response.data.data.msg
  344. this.tableList.splice(index, 1);
  345. this.$message.success("删除成功")
  346. } else {
  347. this.$message.error("删除失败")
  348. }
  349. })
  350. })
  351. .catch(() => {
  352. })
  353. }
  354. },
  355. created() {
  356. var now = new Date(); //当前日期
  357. var nowMonth = now.getMonth(); //当前月
  358. var nowYear = now.getFullYear(); //当前年
  359. //本月的开始时间
  360. var monthStartDate = new Date(nowYear, nowMonth, 1);
  361. this.start_time = this.getTimes(monthStartDate)
  362. this.end_time = this.getTimes(new Date())
  363. this.org_id = this.$store.getters.xt_user.org_id
  364. this.getAllSupply()
  365. this.getlist()
  366. },
  367. };
  368. </script>
  369. <style rel="stylesheet/css" lang="scss" scoped>
  370. .information {
  371. border: 1px #dcdfe6 solid;
  372. padding: 30px 20px 30px 20px;
  373. .border {
  374. border-bottom: 1px #dcdfe6 solid;
  375. margin: 0px 0 20px 0;
  376. }
  377. }
  378. .title {
  379. background: #409eff;
  380. height: 44px;
  381. line-height: 44px;
  382. padding: 0 0 0 10px;
  383. color: #fff;
  384. margin: 0 0 10px 0;
  385. }
  386. .edit_separater {
  387. border-top: 1px solid rgb(233, 233, 233);
  388. margin-top: 15px;
  389. margin-bottom: 15px;
  390. }
  391. </style>
  392. <style>
  393. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  394. font-size: 12px;
  395. }
  396. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  397. background: #6fb5fa;
  398. }
  399. .count {
  400. color: #bd2c00;
  401. }
  402. .el-table td,
  403. .el-table th.is-leaf,
  404. .el-table--border,
  405. .el-table--group {
  406. border-color: #d0d3da;
  407. }
  408. .el-table--border::after,
  409. .el-table--group::after,
  410. .el-table::before {
  411. background-color: #d0d3da;
  412. }
  413. </style>