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

query.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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
  8. style="
  9. justify-content: space-between;
  10. margin: 0px 0 12px 0;
  11. display: flex;
  12. align-items: center;
  13. "
  14. >
  15. <div>
  16. <el-input
  17. size="small"
  18. style="width: 200px; margin-left: 10px"
  19. class="filter-item"
  20. v-model.trim="keyword"
  21. placeholder=""
  22. />
  23. <el-button
  24. size="small"
  25. class="filter-item"
  26. type="primary"
  27. icon="el-icon-search"
  28. @click="search"
  29. >搜索</el-button
  30. >
  31. </div>
  32. <div>
  33. <el-button size="small" type="primary" @click="AddWareHouse(1)">新增</el-button>
  34. <el-button size="small" type="primary" @click="toPrint">设置</el-button>
  35. </div>
  36. </div>
  37. <el-table
  38. :row-style="{ color: '#303133' }"
  39. :header-cell-style="{
  40. backgroundColor: 'rgb(245, 247, 250)',
  41. color: '#606266',
  42. }"
  43. :data="tableData"
  44. :class="signAndWeighBoxPatients"
  45. border
  46. >
  47. <el-table-column label="仓库编号" align="center">
  48. <template slot-scope="scope">
  49. <span>{{ scope.row.StorehouseCode ? scope.row.StorehouseCode : "" }}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="仓库名称" align="center">
  53. <template slot-scope="scope">
  54. <span>{{ scope.row.StorehouseName ? scope.row.StorehouseName : "" }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="仓库地址" align="center">
  58. <template slot-scope="scope">
  59. <span>{{ scope.row.StorehouseAddress ? scope.row.StorehouseAddress : "" }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="仓库管理员" align="center">
  63. <template slot-scope="scope">
  64. <span>{{ scope.row.StorehouseAdminName ? scope.row.StorehouseAdminName : "" }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="状态" align="center">
  68. <template slot-scope="scope">
  69. <span v-if="scope.row.StorehouseStatus == 1">启用</span>
  70. <span v-if="scope.row.StorehouseStatus == 0">禁用</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="操作" align="center" width="260px">
  74. <template slot-scope="scope">
  75. <el-tooltip class="item" content="编辑" placement="top-start">
  76. <el-button
  77. icon="el-icon-edit-outline"
  78. size="small"
  79. type="primary"
  80. @click="toEdit(scope.row,2)"
  81. >
  82. </el-button>
  83. </el-tooltip>
  84. <el-tooltip class="item" :content="scope.row.StorehouseStatus == 1?'禁用':'启用'" placement="top-start">
  85. <el-button
  86. v-if="scope.row.StorehouseStatus == 0"
  87. size="small"
  88. type="primary"
  89. @click="toDisable2(scope.row, scope.row.$index)"
  90. ><img
  91. src="../../../assets/purchase/set.png"
  92. alt=""
  93. style="width: 12px"
  94. />
  95. </el-button>
  96. <!-- 0:禁用 1:启用 -->
  97. <el-button
  98. v-if="scope.row.StorehouseStatus == 1"
  99. size="small"
  100. type="danger"
  101. @click="toDisable(scope.row, scope.row.$index)"
  102. ><img
  103. src="../../../assets/purchase/ban.png"
  104. alt=""
  105. style="width: 12px"
  106. />
  107. </el-button>
  108. </el-tooltip>
  109. <el-tooltip class="item" content="删除" placement="top-start">
  110. <el-button
  111. icon="el-icon-delete"
  112. size="small"
  113. type="danger"
  114. @click="toDelete(scope.row, scope.row.$index)"
  115. >
  116. </el-button>
  117. </el-tooltip>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <el-pagination
  122. @size-change="handleSizeChange"
  123. @current-change="handleCurrentChange"
  124. :page-sizes="[10, 50, 100, 200, 500, 1000]"
  125. :page-size="10"
  126. background
  127. align="right"
  128. style="margin-top: 20px"
  129. layout="total, sizes, prev, pager, next, jumper"
  130. :total="total"
  131. >
  132. </el-pagination>
  133. </div>
  134. <AddWareHouse ref="AddWareHouse" @init="initData" ></AddWareHouse>
  135. </div>
  136. </template>
  137. <script>
  138. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  139. import { getDictionaryDataConfig, getDataConfig } from "@/utils/data";
  140. import { storehouselist,updatestatus,deletestorehouse } from "@/api/warehouse";
  141. import AddWareHouse from "./components/AddWareHouse.vue";
  142. export default {
  143. name: "stockIn",
  144. created() {
  145. var types = getDictionaryDataConfig("system", "drug_type");
  146. var arr = [];
  147. var obj = { id: 0, name: "全部" };
  148. arr.push(obj);
  149. arr.push(...types);
  150. this.drugType = arr;
  151. this.getlist();
  152. },
  153. components: {
  154. BreadCrumb,
  155. AddWareHouse,
  156. },
  157. data() {
  158. return {
  159. content:"禁用",
  160. Disable_:0,
  161. crumbs: [
  162. { path: false, name: "库房管理" },
  163. { path: "/stock/warehousequery", name: "仓库管理" },
  164. ],
  165. keyword: "",
  166. total: 0,
  167. multipleSelection: [],
  168. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  169. page: 1,
  170. limit: 10,
  171. tableData: [],
  172. drugType: [],
  173. stockOutData: [],
  174. };
  175. },
  176. methods: {
  177. initData() {
  178. let params = {
  179. limit: this.limit,
  180. page: this.page,
  181. keyword:this.keyword,
  182. };
  183. //请求分页接口
  184. storehouselist(params).then((response) => {
  185. console.log("fenyeeeeeeeeeeeeeeeeeee")
  186. if (response.data.state == 1) {
  187. this.tableData = response.data.data.list;
  188. this.total = response.data.data.total;
  189. console.log("this.tableData",this.tableData)
  190. }
  191. });
  192. },
  193. getlist() {
  194. var params = {
  195. keyword: this.keyword,
  196. page: this.page,
  197. limit: this.limit,
  198. };
  199. //请求分页接口
  200. storehouselist(params).then((response) => {
  201. if (response.data.state == 1) {
  202. this.tableData = response.data.data.list;
  203. this.total = response.data.data.total;
  204. }
  205. });
  206. },
  207. handleSizeChange(val) {
  208. this.limit = val;
  209. this.getlist();
  210. },
  211. handleCurrentChange(val) {
  212. this.page = val;
  213. this.getlist();
  214. },
  215. startTimeChange: function (val) {
  216. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  217. if (time > 0) {
  218. this.$message.error("开始时间不能大于结束时间");
  219. this.start_time = "";
  220. } else {
  221. this.getlist();
  222. }
  223. },
  224. endTimeChange: function (val) {
  225. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  226. if (time < 0) {
  227. this.$message.error("结束时间不能小于开始时间");
  228. this.end_time = "";
  229. } else {
  230. this.getlist();
  231. }
  232. },
  233. search: function () {
  234. this.getlist();
  235. },
  236. // 新增仓库
  237. AddWareHouse(val) {
  238. this.$nextTick(() => {
  239. this.$refs.AddWareHouse.show(1, val);
  240. })
  241. },
  242. // 编辑仓库
  243. toEdit(data,val) {
  244. this.$nextTick(() => {
  245. this.$refs.AddWareHouse.show(data, val);
  246. })
  247. },
  248. // 禁用仓库
  249. toDisable(val, index) {
  250. var params = {
  251. id:val.ID,
  252. };
  253. this.$confirm("是否确定将此仓库禁用?", "禁用仓库信息", {
  254. confirmButtonText: "确 定",
  255. cancelButtonText: "取 消",
  256. type: "warning",
  257. }).then(() => {
  258. updatestatus(params).then((res) => {
  259. if (res.data.state == 1) {
  260. this.$message.success(res.data.data.list);
  261. this.Disable_= 1
  262. }else {
  263. this.$message.error(res.data.msg);
  264. }
  265. })//刷新
  266. .then(() =>{
  267. this.initData();
  268. })
  269. .catch((err) => {
  270. console.log(err)
  271. })
  272. }).catch(() => {});
  273. },
  274. // 启用仓库
  275. toDisable2(val, index) {
  276. var params = {
  277. id:val.ID,
  278. };
  279. this.$confirm("是否确定将此仓库启用?", "启用仓库信息", {
  280. confirmButtonText: "确 定",
  281. cancelButtonText: "取 消",
  282. type: "warning",
  283. }).then(() => {
  284. updatestatus(params).then((res) => {
  285. if (res.data.state == 1) {
  286. this.$message.success(res.data.data.list);
  287. this.Disable_= 1
  288. }else {
  289. this.$message.error(res.data.msg);
  290. }
  291. })//刷新
  292. .then(() =>{
  293. this.initData();
  294. })
  295. .catch((err) => {
  296. console.log(err)
  297. })
  298. }).catch(() => {});
  299. },
  300. //删除仓库
  301. toDelete(val, index) {
  302. var params = {
  303. id:val.ID,
  304. };
  305. this.$confirm("是否确定将此仓库删除?", "删除仓库信息", {
  306. confirmButtonText: "确 定",
  307. cancelButtonText: "取 消",
  308. type: "warning",
  309. }).then(() => {
  310. deletestorehouse(params).then((res) => {
  311. if (res.data.state == 1) {
  312. this.$message.success(res.data.data.list);
  313. }else {
  314. this.$message.error(res.data.msg);
  315. }
  316. })//刷新
  317. .then(() =>{
  318. this.initData();
  319. })
  320. .catch((err) => {
  321. console.log(err)
  322. })
  323. }).catch(() => {});
  324. },
  325. formatJson(filterVal, jsonData) {
  326. return jsonData.map((v) => filterVal.map((j) => v[j]));
  327. },
  328. changeTypeName() {
  329. this.getlist();
  330. },
  331. //路由跳转 ----- 仓库设置
  332. toPrint() {
  333. this.$router.push({ path: "/stock/waresetting" });
  334. },
  335. getTimestamp(time) {
  336. // 把时间日期转成时间戳
  337. return new Date(time).getTime() / 1000;
  338. },
  339. getDictionaryDataConfig(module, filed_name) {
  340. return getDictionaryDataConfig(module, filed_name);
  341. },
  342. getDataConfig(module, filed_name) {
  343. return getDataConfig(module, filed_name);
  344. },
  345. },
  346. };
  347. </script>
  348. <style rel="stylesheet/css" lang="scss" scoped>
  349. .information {
  350. border: 1px #dcdfe6 solid;
  351. padding: 30px 20px 30px 20px;
  352. .border {
  353. border-bottom: 1px #dcdfe6 solid;
  354. margin: 0px 0 20px 0;
  355. }
  356. }
  357. .title {
  358. background: #409eff;
  359. height: 44px;
  360. line-height: 44px;
  361. padding: 0 0 0 10px;
  362. color: #fff;
  363. margin: 0 0 10px 0;
  364. }
  365. .edit_separater {
  366. border-top: 1px solid rgb(233, 233, 233);
  367. margin-top: 15px;
  368. margin-bottom: 15px;
  369. }
  370. </style>
  371. <style>
  372. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  373. font-size: 12px;
  374. }
  375. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  376. background: #6fb5fa;
  377. }
  378. .count {
  379. color: #bd2c00;
  380. }
  381. .el-table td,
  382. .el-table th.is-leaf,
  383. .el-table--border,
  384. .el-table--group {
  385. border-color: #d0d3da;
  386. }
  387. .el-table--border::after,
  388. .el-table--group::after,
  389. .el-table::before {
  390. background-color: #d0d3da;
  391. }
  392. </style>