From f3a6a69b1e9e5a950ffda00a4ecee3614e6aff25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Thu, 17 Nov 2022 16:48:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/baseurl.js | 2 +- src/assets/styles/xinyilu.scss | 494 ++++++------ src/directives.js | 14 - src/main.js | 7 +- src/views/system/OperateGoodsInfo/index.vue | 531 +------------ src/views/system/OperateGoodsInfo/indexjs.js | 471 ++++++++++++ src/views/system/StationDepartment/index.vue | 463 +----------- src/views/system/StationDepartment/indexjs.js | 311 ++++++++ src/views/system/goodsInfo/index.vue | 573 +------------- src/views/system/goodsInfo/indexjs.js | 431 +++++++++++ src/views/system/goodsOrder/index.vue | 613 ++++----------- src/views/system/goodsOrder/indexjs.js | 424 +++++++++++ src/views/system/order/index.vue | 463 +++--------- src/views/system/order/indexjs.js | 335 +++++++++ src/views/system/person/index.vue | 708 +----------------- src/views/system/person/indexjs.js | 579 ++++++++++++++ src/views/system/station/index.vue | 653 +--------------- src/views/system/station/stationjs.js | 452 +++++++++++ src/views/system/stationConsumable/index.vue | 578 +------------- src/views/system/stationConsumable/indexjs.js | 418 +++++++++++ src/views/system/stationItem/index.vue | 641 +--------------- src/views/system/stationItem/stationItemjs.js | 506 +++++++++++++ 22 files changed, 4603 insertions(+), 5064 deletions(-) delete mode 100644 src/directives.js create mode 100644 src/views/system/OperateGoodsInfo/indexjs.js create mode 100644 src/views/system/StationDepartment/indexjs.js create mode 100644 src/views/system/goodsInfo/indexjs.js create mode 100644 src/views/system/goodsOrder/indexjs.js create mode 100644 src/views/system/order/indexjs.js create mode 100644 src/views/system/person/indexjs.js create mode 100644 src/views/system/station/stationjs.js create mode 100644 src/views/system/stationConsumable/indexjs.js create mode 100644 src/views/system/stationItem/stationItemjs.js diff --git a/src/api/baseurl.js b/src/api/baseurl.js index c4f3e01..8998a23 100644 --- a/src/api/baseurl.js +++ b/src/api/baseurl.js @@ -1,3 +1,3 @@ -var baseurl = "http://192.168.16.76:8080"; +var baseurl = "http://192.168.16.30:8080"; export default baseurl \ No newline at end of file diff --git a/src/assets/styles/xinyilu.scss b/src/assets/styles/xinyilu.scss index 1442a6b..b08588f 100644 --- a/src/assets/styles/xinyilu.scss +++ b/src/assets/styles/xinyilu.scss @@ -2,272 +2,300 @@ * 通用css样式布局处理 * Copyright (c) 2019 xinyilu */ - /** 基础通用 **/ -.pt5 { - padding-top: 5px; -} -.pr5 { - padding-right: 5px; -} -.pb5 { - padding-bottom: 5px; -} -.mt5 { - margin-top: 5px; -} -.mr5 { - margin-right: 5px; -} -.mb5 { - margin-bottom: 5px; -} -.mb8 { - margin-bottom: 8px; -} -.ml5 { - margin-left: 5px; -} -.mt10 { - margin-top: 10px; -} -.mr10 { - margin-right: 10px; -} -.mb10 { - margin-bottom: 10px; -} -.ml10 { - margin-left: 10px; -} -.mt20 { - margin-top: 20px; -} -.mr20 { - margin-right: 20px; -} -.mb20 { - margin-bottom: 20px; -} -.ml20 { - margin-left: 20px; -} -.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { - font-family: inherit; - font-weight: 500; - line-height: 1.1; - color: inherit; -} + .pt5 { + padding-top: 5px; + } -.el-dialog:not(.is-fullscreen) { - margin-top: 6vh !important; -} + .pr5 { + padding-right: 5px; + } -.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body { - overflow: auto; - overflow-x: hidden; - max-height: 70vh; - padding: 10px 20px 0; -} + .pb5 { + padding-bottom: 5px; + } -.el-table { - .el-table__header-wrapper, .el-table__fixed-header-wrapper { - th { - word-break: break-word; - background-color: #f8f8f9; - color: #515a6e; - height: 40px; - font-size: 13px; - } - } - .el-table__body-wrapper { - .el-button [class*="el-icon-"] + span { - margin-left: 1px; - } - } -} + .mt5 { + margin-top: 5px; + } -/** 表单布局 **/ -.form-header { - font-size:15px; - color:#6379bb; - border-bottom:1px solid #ddd; - margin:8px 10px 25px 10px; - padding-bottom:5px -} + .mr5 { + margin-right: 5px; + } -/** 表格布局 **/ -.pagination-container { - position: relative; - height: 25px; - margin-bottom: 10px; - margin-top: 15px; - padding: 10px 20px !important; -} + .mb5 { + margin-bottom: 5px; + } -/* tree border */ -.tree-border { - margin-top: 5px; - border: 1px solid #e5e6e7; - background: #FFFFFF none; - border-radius:4px; -} + .mb8 { + margin-bottom: 8px; + } -.pagination-container .el-pagination { - right: 0; - position: absolute; -} + .ml5 { + margin-left: 5px; + } -@media ( max-width : 768px) { - .pagination-container .el-pagination > .el-pagination__jump { - display: none !important; - } - .pagination-container .el-pagination > .el-pagination__sizes { - display: none !important; - } -} + .mt10 { + margin-top: 10px; + } -.el-table .fixed-width .el-button--mini { - padding-left: 0; - padding-right: 0; - width: inherit; -} + .mr10 { + margin-right: 10px; + } -/** 表格更多操作下拉样式 */ -.el-table .el-dropdown-link { - cursor: pointer; - color: #409EFF; - margin-left: 5px; -} + .mb10 { + margin-bottom: 10px; + } -.el-table .el-dropdown, .el-icon-arrow-down { - font-size: 12px; -} + .ml10 { + margin-left: 10px; + } -.el-tree-node__content > .el-checkbox { - margin-right: 8px; -} + .mt20 { + margin-top: 20px; + } -.list-group-striped > .list-group-item { - border-left: 0; - border-right: 0; - border-radius: 0; - padding-left: 0; - padding-right: 0; -} + .mr20 { + margin-right: 20px; + } -.list-group { - padding-left: 0px; - list-style: none; -} + .mb20 { + margin-bottom: 20px; + } -.list-group-item { - border-bottom: 1px solid #e7eaec; - border-top: 1px solid #e7eaec; - margin-bottom: -1px; - padding: 11px 0px; - font-size: 13px; -} + .ml20 { + margin-left: 20px; + } -.pull-right { - float: right !important; -} + .h1, + .h2, + .h3, + .h4, + .h5, + .h6, + h1, + h2, + h3, + h4, + h5, + h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; + } -.el-card__header { - padding: 14px 15px 7px; - min-height: 40px; -} + .el-dialog:not(.is-fullscreen) { + margin-top: 6vh !important; + } -.el-card__body { - padding: 15px 20px 20px 20px; -} + .el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body { + overflow: auto; + overflow-x: hidden; + max-height: 70vh; + padding: 10px 20px 0; + } -.card-box { - padding-right: 15px; - padding-left: 15px; - margin-bottom: 10px; -} + .el-table { + .el-table__header-wrapper, + .el-table__fixed-header-wrapper { + th { + word-break: break-word; + background-color: #f8f8f9; + color: #515a6e; + height: 40px; + font-size: 13px; + } + } + .el-table__body-wrapper { + .el-button [class*="el-icon-"]+span { + margin-left: 1px; + } + } + } + /** 表单布局 **/ -/* button color */ -.el-button--cyan.is-active, -.el-button--cyan:active { - background: #20B2AA; - border-color: #20B2AA; - color: #FFFFFF; -} + .form-header { + font-size: 15px; + color: #6379bb; + border-bottom: 1px solid #ddd; + margin: 8px 10px 25px 10px; + padding-bottom: 5px + } + /** 表格布局 **/ -.el-button--cyan:focus, -.el-button--cyan:hover { - background: #48D1CC; - border-color: #48D1CC; - color: #FFFFFF; -} + .pagination-container { + position: relative; + height: 25px; + margin-bottom: 10px; + margin-top: 15px; + padding: 10px 20px !important; + } + /* tree border */ -.el-button--cyan { - background-color: #20B2AA; - border-color: #20B2AA; - color: #FFFFFF; -} + .tree-border { + margin-top: 5px; + border: 1px solid #e5e6e7; + background: #FFFFFF none; + border-radius: 4px; + } -/* text color */ -.text-navy { - color: #1ab394; -} + .pagination-container .el-pagination { + right: 0; + position: absolute; + } -.text-primary { - color: inherit; -} + @media ( max-width: 768px) { + .pagination-container .el-pagination>.el-pagination__jump { + display: none !important; + } + .pagination-container .el-pagination>.el-pagination__sizes { + display: none !important; + } + } -.text-success { - color: #1c84c6; -} + .el-table .fixed-width .el-button--mini { + padding-left: 0; + padding-right: 0; + width: inherit; + } + /** 表格更多操作下拉样式 */ -.text-info { - color: #23c6c8; -} + .el-table .el-dropdown-link { + cursor: pointer; + color: #409EFF; + margin-left: 5px; + } -.text-warning { - color: #f8ac59; -} + .el-table .el-dropdown, + .el-icon-arrow-down { + font-size: 12px; + } -.text-danger { - color: #ed5565; -} + .el-tree-node__content>.el-checkbox { + margin-right: 8px; + } -.text-muted { - color: #888888; -} + .list-group-striped>.list-group-item { + border-left: 0; + border-right: 0; + border-radius: 0; + padding-left: 0; + padding-right: 0; + } -/* image */ -.img-circle { - border-radius: 50%; -} + .list-group { + padding-left: 0px; + list-style: none; + } -.img-lg { - width: 120px; - height: 120px; -} + .list-group-item { + border-bottom: 1px solid #e7eaec; + border-top: 1px solid #e7eaec; + margin-bottom: -1px; + padding: 11px 0px; + font-size: 13px; + } -.avatar-upload-preview { - position: absolute; - top: 50%; - transform: translate(50%, -50%); - width: 200px; - height: 200px; - border-radius: 50%; - box-shadow: 0 0 4px #ccc; - overflow: hidden; -} + .pull-right { + float: right !important; + } -/* 拖拽列样式 */ -.sortable-ghost{ - opacity: .8; - color: #fff!important; - background: #42b983!important; -} + .el-card__header { + padding: 14px 15px 7px; + min-height: 40px; + } -.top-right-btn { - position: relative; - float: right; -} + .el-card__body { + padding: 15px 20px 20px 20px; + } + + .card-box { + padding-right: 15px; + padding-left: 15px; + margin-bottom: 10px; + } + /* button color */ + + .el-button--cyan.is-active, + .el-button--cyan:active { + background: #20B2AA; + border-color: #20B2AA; + color: #FFFFFF; + } + + .el-button--cyan:focus, + .el-button--cyan:hover { + background: #48D1CC; + border-color: #48D1CC; + color: #FFFFFF; + } + + .el-button--cyan { + background-color: #20B2AA; + border-color: #20B2AA; + color: #FFFFFF; + } + /* text color */ + + .text-navy { + color: #1ab394; + } + + .text-primary { + color: inherit; + } + + .text-success { + color: #1c84c6; + } + + .text-info { + color: #23c6c8; + } + + .text-warning { + color: #f8ac59; + } + + .text-danger { + color: #ed5565; + } + + .text-muted { + color: #888888; + } + /* image */ + + .img-circle { + border-radius: 50%; + } + + .img-lg { + width: 120px; + height: 120px; + } + + .avatar-upload-preview { + position: absolute; + top: 50%; + transform: translate(50%, -50%); + width: 200px; + height: 200px; + border-radius: 50%; + box-shadow: 0 0 4px #ccc; + overflow: hidden; + } + /* 拖拽列样式 */ + + .sortable-ghost { + opacity: .8; + color: #fff!important; + background: #42b983!important; + } + + .top-right-btn { + position: relative; + float: right; + } diff --git a/src/directives.js b/src/directives.js deleted file mode 100644 index 99553b1..0000000 --- a/src/directives.js +++ /dev/null @@ -1,14 +0,0 @@ -import Vue from 'vue' - -Vue.directive('loadmore', { - bind(el, binding) { - // 获取element-ui定义好的scroll盒子 - const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap') - SELECTWRAP_DOM.addEventListener('scroll', function() { - const CONDITION = this.scrollHeight - this.scrollTop === this.clientHeight; - if (CONDITION == false) { - binding.value() - } - }) - } -}) \ No newline at end of file diff --git a/src/main.js b/src/main.js index 5e41078..b432dfa 100644 --- a/src/main.js +++ b/src/main.js @@ -1,6 +1,5 @@ import Vue from 'vue' -// import directives from "./directives"; -Vue.use(directives); + import Cookies from 'js-cookie' @@ -41,10 +40,6 @@ import VueMeta from 'vue-meta' import DictData from '@/components/DictData' -import directives from "./directives"; -Vue.use(directives); - - // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey diff --git a/src/views/system/OperateGoodsInfo/index.vue b/src/views/system/OperateGoodsInfo/index.vue index 4a0d696..7e3fa53 100644 --- a/src/views/system/OperateGoodsInfo/index.vue +++ b/src/views/system/OperateGoodsInfo/index.vue @@ -9,19 +9,9 @@ label-width="100px" > - - - - + {{ + queryParams.nurseStationName + }} - - - - + @@ -378,7 +330,7 @@ type="primary" icon="el-icon-search" size="mini" - @click="addhd" + @click="info" >搜索 - + + + diff --git a/src/views/system/StationDepartment/indexjs.js b/src/views/system/StationDepartment/indexjs.js new file mode 100644 index 0000000..1194571 --- /dev/null +++ b/src/views/system/StationDepartment/indexjs.js @@ -0,0 +1,311 @@ +import { + listStationDepartment, + getStationDepartment, + delStationDepartment, + addStationDepartment, + updateStationDepartment, +} from "@/api/system/StationDepartment"; +import { getListByUser } from "@/api/system/userlist.js"; + +export default { + name: "StationDepartment", + data() { + // 验证手机号的规则 + var checkMobile = (rule, value, cb) => { + // 验证手机号的正则表达式 + const regMobile = + /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/; + if (regMobile.test(value)) { + return cb(); + } + cb(new Error("请输入正确的联系电话")); + }; + return { + nurseStationlist: [], + // 遮罩层 + loading: true, + // 选中数组 + ids: [], + // 非单个禁用 + single: true, + // 非多个禁用 + multiple: true, + // 显示搜索条件 + showSearch: true, + // 总条数 + total: 0, + total2: 0, + // 护理站部门信息表格数据 + StationDepartmentList: [], + // 弹出层标题 + title: "", + // 是否显示弹出层 + open: false, + addopen: false, + // 查询参数 + queryParams: { + pageNum: 1, + pageSize: 10, + nurseStationId: null, + departmentCode: null, + departmentName: null, + departmentPerson: null, + phone: null, + nurseStationName: null, + }, + nurseStationqueryParams: { + pageNum: 1, + pageSize: 10, + }, + // 表单参数 + form: {}, + // 表单校验 + rules: { + nurseStationDepartmentList: { + nurseStationId: [{ + required: true, + message: "请选择所属护理站", + trigger: "blur", + }, ], + departmentName: [{ + required: true, + message: "请选择科室名称", + trigger: "blur", + }, ], + departmentPerson: [{ + required: true, + message: "请选择科室负责人", + trigger: "blur", + }, ], + phone: [{ + required: true, + validator: checkMobile, + trigger: "blur", + message: "", + }, ], + }, + nurseStationId: [{ + required: true, + message: "请选择所属护理站", + trigger: "blur", + }, ], + departmentName: [{ + required: true, + message: "请选择科室名称", + trigger: "blur", + }, ], + departmentPerson: [{ + required: true, + message: "请选择科室负责人", + trigger: "blur", + }, ], + phone: [{ + required: true, + validator: checkMobile, + trigger: "blur", + message: "", + }, ], + }, + index: "", + stationid: null, + innerVisible: false, + homenumber: null, + }; + }, + created() { + this.getList(); + }, + methods: { + ParamsStation(item) { + this.innerVisible = true + this.homenumber = item + this.stationid = this.queryParams.nurseStationId; + }, + // add点击护理站名称 + nurseclick(row) { + if (this.homenumber) { + this.stationid = this.queryParams.nurseStationId + this.queryParams.nurseStationName = row.nurseStationName; + this.queryParams.nurseStationId = row.id; + } else { + this.stationid = row.id; + this.form.nurseStationDepartmentList[this.index].nurseStationName = + row.nurseStationName; + this.form.nurseStationDepartmentList[this.index].nurseStationId = row.id; + } + this.innerVisible = false; + }, + // 新增护理站按钮 + clickinnerVisible(item, index) { + this.addresetQuery(); + this.stationid = item.nurseStationId; + this.index = index; + this.innerVisible = true; + }, + //删除deldisease + deldisease(index) { + this.form.nurseStationDepartmentList.splice(index, 1); + }, + adddisease() { + var obj = { + nurseStationId: "", + departmentCode: "", + departmentName: "", + departmentPerson: "", + phone: "", + nurseStationName: "请选择所属护理站", + }; + if (this.form.nurseStationDepartmentList.length == 5) { + this.$message.error("最多只能5条"); + } else { + this.form.nurseStationDepartmentList.push(obj); + } + }, + /** 查询护理站部门信息列表 */ + getList() { + this.loading = true; + listStationDepartment(this.queryParams).then((response) => { + this.StationDepartmentList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 取消按钮 + cancel() { + this.open = false; + this.addopen = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + id: null, + nurseStationId: null, + departmentCode: null, + departmentName: null, + departmentPerson: null, + phone: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + nurseStationName: null, + nurseStationId: null, + nurseStationDepartmentList: [{ + nurseStationId: "", + departmentCode: "", + departmentName: "", + departmentPerson: "", + phone: "", + nurseStationName: "请选择所属护理站", + }, ], + }; + this.resetForm("form"); + }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + innerVisiblecancel() { + this.innerVisible = false; + }, + /** 重置按钮操作 */ + resetQuery() { + this.resetForm("queryForm"); + this.queryParams = { + pageNum: 1, + pageSize: 10, + nurseStationId: null, + departmentCode: null, + departmentName: null, + departmentPerson: null, + phone: null, + nurseStationName: null, + }; + this.handleQuery(); + }, + addresetQuery() { + this.nurseStationqueryParams = { + pageNum: 1, + pageSize: 10, + }; + this.info(); + }, + //护理站list + info() { + this.loading = true + getListByUser(this.nurseStationqueryParams).then((res) => { + this.nurseStationlist = res.rows; + this.total2 = res.total; + this.loading = false + }); + }, + // 多选框选中数据 + handleSelectionChange(selection) { + this.ids = selection.map((item) => item.id); + this.single = selection.length !== 1; + this.multiple = !selection.length; + }, + /** 新增按钮操作 */ + handleAdd() { + this.homenumber = null + this.reset(); + this.addopen = true; + // this.nurseStationName="", + this.title = "添加护理站部门信息"; + }, + /** 修改按钮操作 */ + handleUpdate(row) { + const id = row.id || this.ids; + getStationDepartment(id).then((response) => { + this.form = response.data; + this.open = true; + this.title = "修改护理站部门信息"; + }); + }, + /** 提交按钮 */ + submitForm() { + this.$refs["form"].validate((valid) => { + if (valid) { + if (this.form.id != null) { + updateStationDepartment(this.form).then((response) => { + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + }); + } else { + addStationDepartment(this.form).then((response) => { + this.$modal.msgSuccess("新增成功"); + this.addopen = false; + this.getList(); + }); + } + } + }); + }, + /** 删除按钮操作 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal + .confirm("是否确认删除护理站部门信息的数据项?") + .then(function() { + return delStationDepartment(ids); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }) + .catch(() => {}); + }, + /** 导出按钮操作 */ + handleExport() { + this.download( + "system/StationDepartment/export", { + ...this.queryParams, + }, + `StationDepartment_${new Date().getTime()}.xlsx` + ); + }, + }, +}; \ No newline at end of file diff --git a/src/views/system/goodsInfo/index.vue b/src/views/system/goodsInfo/index.vue index 5943a38..7e8f0c9 100644 --- a/src/views/system/goodsInfo/index.vue +++ b/src/views/system/goodsInfo/index.vue @@ -9,19 +9,9 @@ label-width="100px" > - - - - + {{ + queryParams.nurseStationName + }} - - - - 取 消 - - + @@ -457,546 +443,23 @@ :total="total2" :page.sync="getListByUserquery.pageNum" :limit.sync="getListByUserquery.pageSize" - @pagination="handleQuery2" + @pagination="info" /> - --> + diff --git a/src/views/system/goodsInfo/indexjs.js b/src/views/system/goodsInfo/indexjs.js new file mode 100644 index 0000000..918023e --- /dev/null +++ b/src/views/system/goodsInfo/indexjs.js @@ -0,0 +1,431 @@ +import { + getGoodsInfo, + delGoodsInfo, + addGoodsInfo, + updateGoodsInfo, + updatePicture, + goodsInfoList, + goodsCategory, + editGoodsWhetherShelf, +} from "@/api/system/goodsInfo"; +import editor from "@/components/Editor"; +import { getListByUser } from "@/api/system/userlist.js"; +import stationAcatar from "../stationAvatar/index.vue"; +import baseurl from "@/api/baseurl.js"; + +export default { + components: { stationAcatar, editor }, + name: "OperateGoodsInfo", + data() { + return { + imgone: "", + imageUrl: "", //商品图片 + value: "", + datas: null, + // 遮罩层 + loading: true, + // 选中数组 + ids: [], + // 非单个禁用 + single: true, + // 非多个禁用 + multiple: true, + // 显示搜索条件 + showSearch: true, + // 总条数 + total: 0, + total2: 0, + // 商品基本信息表格数据 + goodsInfoList: [], + // 护理站列表 + nurseStationlist: [], + // 查询商品分类列表 + goodsCategorylist: [], + // 弹出层标题 + title: "", + // 是否显示弹出层 + open: false, + // open2: false, + innerVisible: false, + // StationName: "请选择所属护理站", + nursetotal: 0, + nurseStationId: null, + goods: [{ + value: "BUSINESS", + label: "买卖", + }, + { + value: "LEASE", + label: "租赁", + }, + ], + options: [{ + value: 0, + label: "否", + }, + { + value: 1, + label: "是", + }, + ], + goodDetailsLists: [], + ids: 9999999, + // 查询参数 + shangjia: { + id: null, + whetherShelf: null, + }, + getListByUserquery: { + pageNum: 1, + pageSize: 10, + }, + queryParams: { + id: null, + pageNum: 1, + pageSize: 10, + storeInfoId: null, + nurseStationId: null, + goodsCategoryId: null, + goodsName: null, + whetherShelf: null, + shelfTime: null, + goodsPictureUrl: null, + goodsRemark: null, + goodsUnit: null, + goodsPurpose: null, + sort: null, + // mame:null, + }, + //权限查询 + getListByUserquery: { + pageNum: 1, + pageSize: 10, + }, + // 表单参数 + form: { + nurseStationName: "", + nurseStationId: "", + }, + // 表单校验 + rules: { + goodsName: [ + { required: true, message: "请输入商品名称", trigger: "blur" }, + ], + goodsCategoryId: [ + { required: true, message: "请选择商品分类名称", trigger: "blur" }, + ], + nurseStationId: [ + { required: true, message: "请选择所属护理站", trigger: "blur" }, + ], + goodsPurpose: [ + { required: true, message: "请选择商品用途", trigger: "blur" }, + ], + goodsUnit: [ + { required: true, message: "请输入商品度量单位", trigger: "blur" }, + ], + goodsPictureUrl: [ + { required: true, message: "请输入选择图片", trigger: "blur" }, + ], + }, + stationid: null, + }; + }, + created() { + this.getList(); + this.info(); + }, + methods: { + addcancel() { + this.innerVisible = false + }, + upwhetherShelf(row) { + if (row.whetherShelf == false) { + var obj = { + id: row.goodsInfoId, + whetherShelf: 0, + }; + } else if (row.whetherShelf == true) { + var obj = { + id: row.goodsInfoId, + whetherShelf: 1, + }; + } + editGoodsWhetherShelf(obj).then((res) => { + if (obj.whetherShelf == 0) { + this.$modal.msgSuccess("已修改上架状态为未上架"); + } else { + this.$modal.msgSuccess("已修改上架状态为上架"); + } + this.getList(); + }); + }, + /** 查询商品基本信息列表 */ + getList() { + this.loading = true; + goodsInfoList(this.queryParams).then((response) => { + response.rows.forEach((e) => { + if (e.whetherShelf == 1) { + e.whetherShelf = true; + } else if (e.whetherShelf == 0) { + e.whetherShelf = false; + } + }); + this.goodsInfoList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 添加 + addgoodAttributeDetail() { + if (this.goodDetailsLists.length == 5) { + this.$message.error("最多只能5条"); + } else { + this.ids++; + var obj = { + attributePitureUrl: "", + goodsPrice: "", + goodsStock: "", + sort: "", + ids: this.ids, + }; + this.goodDetailsLists.push(obj); + } + }, + // 删除 + delgoodAttributeDetail(item) { + if (item.ids && !item.attributeDetailsId) { + if (this.goodDetailsLists.length == 1) { + this.$message.error("最后一条不可删除"); + } else { + this.goodDetailsLists = this.goodDetailsLists.filter( + (e) => e.ids != item.ids + ); + } + } else if (!item.ids && item.attributeDetailsId) { + if (this.goodDetailsLists.length == 1) { + this.$message.error("最后一条不可删除"); + } else { + this.goodDetailsLists = this.goodDetailsLists.filter( + (e) => e.attributeDetailsId != item.attributeDetailsId + ); + } + } + }, + // 取消按钮 + cancel() { + var obj = { pictureUrlList: [] }; + if (this.imgone != this.form.goodsPictureUrl) { + obj.pictureUrlList.push(this.form.goodsPictureUrl); + } + if (obj.pictureUrlList.length > 0) { + updatePicture(obj).then((res) => {}); + } + this.open = false; + this.reset(); + this.StationName = "请选择所属护理站"; + this.goodDetailsLists = [{ + attributeName: "", + goodAttributeDetailsLists: [{ + attributePitureUrl: "", + goodsPrice: "", + goodsStock: "", + sort: "", + }, ], + }, ]; + }, + //护理站页面选择护理站 + nurseclick(item) { + this.queryParams.nurseStationName = item.nurseStationName; + this.queryParams.nurseStationId = item.id; + this.stationid = item.id + this.innerVisible = false; + }, + //页面所属护理站 + ParamsStation(item) { + this.title = '选择护理站' + this.innerVisible = true + this.stationid = this.queryParams.nurseStationId; + }, + //护理站列表 + info() { + goodsCategory().then((res) => { + this.goodsCategorylist = res.rows; + }); + getListByUser(this.getListByUserquery).then((res) => { + this.nurseStationlist = res.rows; + this.total2 = res.total; + }); + }, + handleQuery2() { + this.info(); + }, + resetQuery2() { + this.resetForm("queryForm"); + this.getListByUserquery = { + pageNum: 1, + pageSize: 10, + } + this.handleQuery2(); + }, + // 表单重置 + reset() { + this.form = { + id: null, + storeInfoId: null, + nurseStationId: null, + goodsCategoryId: null, + goodsName: null, + // goodsCode: null, + whetherShelf: null, + shelfTime: null, + goodsPictureUrl: null, + goodsRemark: null, + goodsUnit: null, + goodsPurpose: null, + sort: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + }; + this.goodDetailsLists = [{ + attributePitureUrl: "", + goodsPrice: "", + goodsStock: "", + sort: "", + ids: 9999999, + }, ]; + this.resetForm("form"); + }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 重置按钮操作 */ + resetQuery() { + if (this.nurseStationlist[0].isAdmin == "1") { + this.resetForm("queryForm"); + this.queryParams = { + pageNum: 1, + pageSize: 10, + }; + } else { + this.queryParams.pageNum = 1; + this.queryParams.pageSize = 10; + this.queryParams.goodsName = null; + this.queryParams.goodsCategoryName = null; + this.queryParams.goodsPurpose = null; + this.queryParams.whetherShelf = null; + } + this.handleQuery(); + }, + // 多选框选中数据 + handleSelectionChange(selection) { + this.ids = selection.map((item) => item.goodsInfoId); + this.single = selection.length !== 1; + this.multiple = !selection.length; + }, + /** 新增按钮操作 */ + handleAdd() { + this.reset(); + this.form.nurseStationName = this.nurseStationlist[0].nurseStationName; + this.form.nurseStationId = this.nurseStationlist[0].id; + this.title = "商品基本信息"; + this.StationName = "请选择所属护理站"; + this.goodDetailsLists = [{ + attributePitureUrl: "", + goodsPrice: "", + goodsStock: "", + sort: "", + ids: 9999999, + }, ]; + this.open = true; + }, + /** 修改按钮操作 */ + handleUpdate(row) { + const id = row.goodsInfoId || this.ids; + getGoodsInfo(id).then((response) => { + this.form = response.data[0]; + this.form.nurseStationName = row.nurseStationName; + this.imgone = this.form.goodsPictureUrl; + if (response.data[0].goodAttributeDetailsLists) { + this.goodDetailsLists = response.data[0].goodAttributeDetailsLists; + } + this.open = true; + this.title = "修改商品基本信息"; + }); + }, + + /** 提交按钮 */ + submitForm() { + this.form.goodAttributeDetailsLists = []; + this.form.goodDetailsLists = this.goodDetailsLists; + this.$refs["form"].validate((valid) => { + if (valid) { + if (this.form.goodsInfoId != null) { + this.form.id = this.form.goodsInfoId; + updateGoodsInfo(this.form).then((response) => { + var obj = { pictureUrlList: [] }; + if (this.imgone != this.form.goodsPictureUrl) { + obj.pictureUrlList.push(this.imgone); + } + if (obj.pictureUrlList.length > 0) { + updatePicture(obj).then((res) => {}); + } + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + }); + } else { + // this.nurseStationId=this.form.nurseStationId + addGoodsInfo(this.form).then((response) => { + this.$modal.msgSuccess("新增成功"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 删除按钮操作 */ + handleDelete(row) { + this.$confirm("是否确认删除订单信息的数据项?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + var obj = { pictureUrlList: [] }; + obj.pictureUrlList.push(row.goodsPictureUrl); + updatePicture(obj).then((res) => {}); + + delGoodsInfo(row.goodsInfoId).then((res) => { + this.$message.success("删除成功"); + this.getList(); + }); + }) + .catch(() => {}); + }, + imgUrl(imgUrl) { + this.form.goodsPictureUrl = imgUrl; + }, + attributePitureUrl(imgUrl) {}, + attributePitureitem(item) { + let items = JSON.parse(item); + if (items.ids && !items.id) { + this.goodDetailsLists.forEach((e) => { + if (e.ids == items.ids) { + e.attributePitureUrl = items.attributePitureUrl; + } + }); + } else if (!items.ids && items.attributeDetailsId) { + this.goodDetailsLists.forEach((e) => { + if (e.attributeDetailsId == items.attributeDetailsId) { + e.attributePitureUrl = items.attributePitureUrl; + } + }); + } + }, + }, +}; \ No newline at end of file diff --git a/src/views/system/goodsOrder/index.vue b/src/views/system/goodsOrder/index.vue index 18613a4..624cc1d 100644 --- a/src/views/system/goodsOrder/index.vue +++ b/src/views/system/goodsOrder/index.vue @@ -8,21 +8,11 @@ v-show="showSearch" label-width="90px" > - - - - - - + + {{ + queryParams.nurseStationName + }} + 重置 - 刷新商品订单 @@ -80,15 +74,10 @@ prop="orderNo" width="190" /> - + - + - + --> - - - - + + + @@ -290,6 +296,7 @@ diff --git a/src/views/system/goodsOrder/index.vue b/src/views/system/goodsOrder/index.vue index 624cc1d..cdff701 100644 --- a/src/views/system/goodsOrder/index.vue +++ b/src/views/system/goodsOrder/index.vue @@ -47,13 +47,6 @@ 重置 - 刷新商品订单 @@ -171,15 +164,6 @@ v-hasPermi="['system:goodsOrder:editExpressNo']" >录入物流单号 - 不可录入物流单号 重置 - 刷新预约订单 派单 - 派单 取消预约 - 取消预约