123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- </div>
- <div class="app-container">
- <div
- style="
- justify-content: space-between;
- margin: 0px 0 12px 0;
- display: flex;
- align-items: center;
- "
- >
- <div>
- <el-input
- size="small"
- style="width: 200px; margin-left: 10px"
- class="filter-item"
- v-model.trim="keyword"
- placeholder=""
- />
- <el-button
- size="small"
- class="filter-item"
- type="primary"
- icon="el-icon-search"
- @click="search"
- >搜索</el-button
- >
- </div>
- <div>
- <el-button size="small" type="primary" @click="AddWareHouse(1)">新增</el-button>
- <el-button size="small" type="primary" @click="toPrint">设置</el-button>
- </div>
- </div>
-
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :data="tableData"
- :class="signAndWeighBoxPatients"
- border
- >
- <el-table-column label="仓库编号" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.StorehouseCode ? scope.row.StorehouseCode : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="仓库名称" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.StorehouseName ? scope.row.StorehouseName : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="仓库地址" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.StorehouseAddress ? scope.row.StorehouseAddress : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="仓库管理员" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.StorehouseAdminName ? scope.row.StorehouseAdminName : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.StorehouseStatus == 1">启用</span>
- <span v-if="scope.row.StorehouseStatus == 0">禁用</span>
- </template>
- </el-table-column>
-
- <el-table-column label="操作" align="center" width="260px">
- <template slot-scope="scope">
- <el-tooltip class="item" content="编辑" placement="top-start">
- <el-button
- icon="el-icon-edit-outline"
- size="small"
- type="primary"
- @click="toEdit(scope.row,2)"
- >
- </el-button>
- </el-tooltip>
-
- <el-tooltip class="item" :content="scope.row.StorehouseStatus == 1?'禁用':'启用'" placement="top-start">
- <el-button
- v-if="scope.row.StorehouseStatus == 0"
- size="small"
- type="primary"
- @click="toDisable2(scope.row, scope.row.$index)"
- ><img
- src="../../../assets/purchase/set.png"
- alt=""
- style="width: 12px"
- />
- </el-button>
- <!-- 0:禁用 1:启用 -->
- <el-button
- v-if="scope.row.StorehouseStatus == 1"
- size="small"
- type="danger"
- @click="toDisable(scope.row, scope.row.$index)"
- ><img
- src="../../../assets/purchase/ban.png"
- alt=""
- style="width: 12px"
- />
- </el-button>
- </el-tooltip>
-
- <el-tooltip class="item" content="删除" placement="top-start">
- <el-button
- icon="el-icon-delete"
- size="small"
- type="danger"
- @click="toDelete(scope.row, scope.row.$index)"
- >
- </el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 50, 100, 200, 500, 1000]"
- :page-size="10"
- background
- align="right"
- style="margin-top: 20px"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- </div>
-
- <AddWareHouse ref="AddWareHouse" @init="initData" ></AddWareHouse>
- </div>
- </template>
-
- <script>
- import BreadCrumb from "@/xt_pages/components/bread-crumb";
- import { getDictionaryDataConfig, getDataConfig } from "@/utils/data";
- import { storehouselist,updatestatus,deletestorehouse } from "@/api/warehouse";
- import AddWareHouse from "./components/AddWareHouse.vue";
- export default {
- name: "stockIn",
- created() {
- var types = getDictionaryDataConfig("system", "drug_type");
- var arr = [];
- var obj = { id: 0, name: "全部" };
- arr.push(obj);
- arr.push(...types);
- this.drugType = arr;
- this.getlist();
- },
- components: {
- BreadCrumb,
- AddWareHouse,
- },
- data() {
- return {
- content:"禁用",
- Disable_:0,
- crumbs: [
- { path: false, name: "库房管理" },
- { path: "/stock/warehousequery", name: "仓库管理" },
- ],
- keyword: "",
- total: 0,
- multipleSelection: [],
- signAndWeighBoxPatients: "sign-and-weigh-box-patients",
- page: 1,
- limit: 10,
- tableData: [],
- drugType: [],
- stockOutData: [],
- };
- },
- methods: {
- initData() {
- let params = {
- limit: this.limit,
- page: this.page,
- keyword:this.keyword,
- };
- //请求分页接口
- storehouselist(params).then((response) => {
- console.log("fenyeeeeeeeeeeeeeeeeeee")
- if (response.data.state == 1) {
- this.tableData = response.data.data.list;
- this.total = response.data.data.total;
- console.log("this.tableData",this.tableData)
- }
- });
- },
-
- getlist() {
- var params = {
- keyword: this.keyword,
- page: this.page,
- limit: this.limit,
- };
- //请求分页接口
- storehouselist(params).then((response) => {
- if (response.data.state == 1) {
- this.tableData = response.data.data.list;
- this.total = response.data.data.total;
- }
- });
- },
- handleSizeChange(val) {
- this.limit = val;
- this.getlist();
- },
- handleCurrentChange(val) {
- this.page = val;
- this.getlist();
- },
-
- startTimeChange: function (val) {
- var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
-
- if (time > 0) {
- this.$message.error("开始时间不能大于结束时间");
- this.start_time = "";
- } else {
- this.getlist();
- }
- },
- endTimeChange: function (val) {
- var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
- if (time < 0) {
- this.$message.error("结束时间不能小于开始时间");
- this.end_time = "";
- } else {
- this.getlist();
- }
- },
-
- search: function () {
- this.getlist();
- },
- // 新增仓库
- AddWareHouse(val) {
- this.$nextTick(() => {
- this.$refs.AddWareHouse.show(1, val);
- })
- },
- // 编辑仓库
- toEdit(data,val) {
- this.$nextTick(() => {
- this.$refs.AddWareHouse.show(data, val);
- })
- },
- // 禁用仓库
- toDisable(val, index) {
- var params = {
- id:val.ID,
- };
- this.$confirm("是否确定将此仓库禁用?", "禁用仓库信息", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- updatestatus(params).then((res) => {
- if (res.data.state == 1) {
- this.$message.success(res.data.data.list);
- this.Disable_= 1
- }else {
- this.$message.error(res.data.msg);
- }
- })//刷新
- .then(() =>{
- this.initData();
- })
- .catch((err) => {
- console.log(err)
- })
- }).catch(() => {});
- },
- // 启用仓库
- toDisable2(val, index) {
- var params = {
- id:val.ID,
- };
- this.$confirm("是否确定将此仓库启用?", "启用仓库信息", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- updatestatus(params).then((res) => {
- if (res.data.state == 1) {
- this.$message.success(res.data.data.list);
- this.Disable_= 1
- }else {
- this.$message.error(res.data.msg);
- }
- })//刷新
- .then(() =>{
- this.initData();
- })
- .catch((err) => {
- console.log(err)
- })
- }).catch(() => {});
- },
- //删除仓库
- toDelete(val, index) {
- var params = {
- id:val.ID,
- };
- this.$confirm("是否确定将此仓库删除?", "删除仓库信息", {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }).then(() => {
- deletestorehouse(params).then((res) => {
- if (res.data.state == 1) {
- this.$message.success(res.data.data.list);
- }else {
- this.$message.error(res.data.msg);
- }
- })//刷新
- .then(() =>{
- this.initData();
- })
- .catch((err) => {
- console.log(err)
- })
- }).catch(() => {});
- },
-
- formatJson(filterVal, jsonData) {
- return jsonData.map((v) => filterVal.map((j) => v[j]));
- },
- changeTypeName() {
- this.getlist();
- },
-
- //路由跳转 ----- 仓库设置
- toPrint() {
- this.$router.push({ path: "/stock/waresetting" });
- },
-
- getTimestamp(time) {
- // 把时间日期转成时间戳
- return new Date(time).getTime() / 1000;
- },
- getDictionaryDataConfig(module, filed_name) {
- return getDictionaryDataConfig(module, filed_name);
- },
- getDataConfig(module, filed_name) {
- return getDataConfig(module, filed_name);
- },
- },
- };
- </script>
-
- <style rel="stylesheet/css" lang="scss" scoped>
- .information {
- border: 1px #dcdfe6 solid;
- padding: 30px 20px 30px 20px;
-
- .border {
- border-bottom: 1px #dcdfe6 solid;
- margin: 0px 0 20px 0;
- }
- }
-
- .title {
- background: #409eff;
- height: 44px;
- line-height: 44px;
- padding: 0 0 0 10px;
- color: #fff;
- margin: 0 0 10px 0;
- }
-
- .edit_separater {
- border-top: 1px solid rgb(233, 233, 233);
- margin-top: 15px;
- margin-bottom: 15px;
- }
- </style>
-
- <style>
- .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
- font-size: 12px;
- }
-
- .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
- background: #6fb5fa;
- }
-
- .count {
- color: #bd2c00;
- }
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
- </style>
|