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

goodOrderQuery.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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,scope.row.$index)"
  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. getAllGoodOrderList(params).then(response=>{
  258. if(response.data.state == 1){
  259. var list = response.data.data.list
  260. this.tableList = list
  261. var total = response.data.data.total
  262. this.total = total
  263. }
  264. })
  265. },
  266. getName(id){
  267. var name = ""
  268. for(let i=0;i<this.supplyList.length;i++){
  269. if(id == this.supplyList[i].id){
  270. name = this.supplyList[i].supplier_name
  271. }
  272. }
  273. return name
  274. },
  275. getDocName(id){
  276. var user_name = ""
  277. for(let i=0;i<this.doctorList.length;i++){
  278. if(id == this.doctorList[i].admin_user_id){
  279. user_name = this.doctorList[i].user_name
  280. }
  281. }
  282. return user_name
  283. },
  284. getAllBuyPrice(arr){
  285. var buy_price = 0
  286. if(arr!=undefined && arr.length > 0){
  287. for(let i=0;i<arr.length;i++){
  288. buy_price += (arr[i].count * arr[i].price)
  289. }
  290. }
  291. return buy_price.toFixed(2)
  292. },
  293. getAllCount(arr){
  294. var count = 0
  295. if(arr!=undefined && arr.length > 0){
  296. for(let i=0;i<arr.length;i++){
  297. count += parseInt(arr[i].count)
  298. }
  299. }
  300. if(count == 0){
  301. return ""
  302. }
  303. if(count >0){
  304. return count
  305. }
  306. },
  307. getAllMoney(paycount,arr){
  308. var all_price= 0
  309. if(arr!=undefined && arr.length > 0){
  310. for(let i=0;i<arr.length;i++){
  311. all_price += arr[i].count * arr[i].price
  312. }
  313. }
  314. if(all_price == 0){
  315. return ""
  316. }
  317. if(all_price >0){
  318. return (all_price - paycount).toFixed(2)
  319. }
  320. },
  321. toClick(val){
  322. this.$router.push({path:"/good/order/edit?id="+val.id+"&warehousing_id="+val.warehousing_id})
  323. },
  324. toDelete(val,index){
  325. if(val.is_check == 1){
  326. this.$message.error("已审核单据,不能删除!")
  327. return false
  328. }
  329. if(val.cancelOut.length >0 ){
  330. this.$message.error("已关联单据,不能删除!")
  331. return false
  332. }
  333. this.$confirm('确认删除吗?', '删除', {
  334. confirmButtonText: '确 定',
  335. cancelButtonText: '取 消',
  336. type: 'warning'
  337. }).then(() => {
  338. deleteGoodOrder(val.id).then(response => {
  339. if (response.data.state == 1) {
  340. var msg = response.data.data.msg
  341. this.tableList.splice(index, 1);
  342. this.$message.success("删除成功")
  343. this.getlist()
  344. } else {
  345. this.$message.error("删除失败")
  346. }
  347. })
  348. })
  349. .catch(() => {
  350. })
  351. }
  352. },
  353. created() {
  354. var now = new Date(); //当前日期
  355. var nowMonth = now.getMonth(); //当前月
  356. var nowYear = now.getFullYear(); //当前年
  357. //本月的开始时间
  358. var monthStartDate = new Date(nowYear, nowMonth, 1);
  359. this.start_time = this.getTimes(monthStartDate)
  360. this.end_time = this.getTimes(new Date())
  361. this.org_id = this.$store.getters.xt_user.org_id
  362. this.getAllSupply()
  363. this.getlist()
  364. },
  365. };
  366. </script>
  367. <style rel="stylesheet/css" lang="scss" scoped>
  368. .information {
  369. border: 1px #dcdfe6 solid;
  370. padding: 30px 20px 30px 20px;
  371. .border {
  372. border-bottom: 1px #dcdfe6 solid;
  373. margin: 0px 0 20px 0;
  374. }
  375. }
  376. .title {
  377. background: #409eff;
  378. height: 44px;
  379. line-height: 44px;
  380. padding: 0 0 0 10px;
  381. color: #fff;
  382. margin: 0 0 10px 0;
  383. }
  384. .edit_separater {
  385. border-top: 1px solid rgb(233, 233, 233);
  386. margin-top: 15px;
  387. margin-bottom: 15px;
  388. }
  389. /deep/ .el-table__body-wrapper::-webkit-scrollbar {
  390. width: 10px;
  391. height: 10px;
  392. }
  393. </style>
  394. <style>
  395. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  396. font-size: 12px;
  397. }
  398. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  399. background: #6fb5fa;
  400. }
  401. .count {
  402. color: #bd2c00;
  403. }
  404. .el-table td,
  405. .el-table th.is-leaf,
  406. .el-table--border,
  407. .el-table--group {
  408. border-color: #d0d3da;
  409. }
  410. .el-table--border::after,
  411. .el-table--group::after,
  412. .el-table::before {
  413. background-color: #d0d3da;
  414. }
  415. </style>