Browse Source

feat:[资源库管理][麻精药管理]新增列表,锁定

refactor:[资源库管理][钥匙管理]重构页面
luojie
15881625488@163.com 3 weeks ago
parent
commit
cef11b3927
11 changed files with 300 additions and 45 deletions
  1. +6
    -15
      src/api/business/mjy/mjy.js
  2. +10
    -0
      src/api/business/public/public.js
  3. +11
    -10
      src/api/business/zcg/zcg.js
  4. +6
    -0
      src/lang/en.js
  5. +7
    -2
      src/lang/zh.js
  6. +104
    -0
      src/views/business/comps/select/SelectZcg.vue
  7. +129
    -0
      src/views/business/resource/mjy/comps/Sd.vue
  8. +15
    -4
      src/views/business/resource/mjy/list.vue
  9. +4
    -4
      src/views/business/resource/zcg/comps/Ysff.vue
  10. +3
    -3
      src/views/business/resource/zcg/comps/Ysgh.vue
  11. +5
    -7
      src/views/business/resource/zcg/list.vue

+ 6
- 15
src/api/business/mjy/mjy.js View File

@ -18,29 +18,20 @@ export function mjy_info(query) {
})
}
// 钥匙发放
export function mjy_yygh(data) {
// 锁定
export function mjy_sd(data) {
return request({
url: '/system/business/mjy/ysgh',
method: 'post',
data: data
})
}
//钥匙归还
export function mjy_yyff(data) {
return request({
url: '/system/business/mjy/ysff',
url: '/system/business/mjy/sd',
method: 'post',
data: data
})
}
//批量钥匙归还
export function mjy_ysghBatch(data) {
//批量锁定
export function mjy_sdBatch(data) {
return request({
url: '/system/business/mjy/ysghBatch',
url: '/system/business/mjy/sdBatch',
method: 'post',
data: data
})

+ 10
- 0
src/api/business/public/public.js View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询暂存柜列表
export function public_zcgList(query) {
return request({
url: '/system/business/public/zcgList',
method: 'get',
params: query
})
}

+ 11
- 10
src/api/business/zcg/zcg.js View File

@ -18,8 +18,8 @@ export function zcg_info(query) {
})
}
// 钥匙发放
export function zcg_yygh(data) {
// 钥匙归还
export function zcg_ysgh(data) {
return request({
url: '/system/business/zcg/ysgh',
method: 'post',
@ -27,21 +27,22 @@ export function zcg_yygh(data) {
})
}
//钥匙归还
export function zcg_yyff(data) {
//批量钥匙归还
export function zcg_ysghBatch(data) {
return request({
url: '/system/business/zcg/ysff',
url: '/system/business/zcg/ysghBatch',
method: 'post',
data: data
})
}
//批量钥匙归还
export function zcg_ysghBatch(data) {
//钥匙发放
export function zcg_ysff(data) {
return request({
url: '/system/business/zcg/ysghBatch',
url: '/system/business/zcg/ysff',
method: 'post',
data: data
})
}
}

+ 6
- 0
src/lang/en.js View File

@ -20,6 +20,12 @@ export default {
confirmDelete: 'confirm delete?',
startDate:'start date',
endDate:'end date',
password:'password',
signer:'signer',
remark:'remark',
qmyy:'签名意义',
lock:'lock',
unlock:'unlock',
},
menu: {
PersonalCenter: 'Personal Center',

+ 7
- 2
src/lang/zh.js View File

@ -20,6 +20,12 @@ export default {
confirmDelete: '确认删除?',
startDate:'开始日期',
endDate:'结束日期',
password:'密码',
signer:'签名人',
qmyy:'签名意义',
remark:'备注',
lock:'锁定',
unlock:'解锁',
},
menu: {
PersonalCenter: '个人中心',
@ -234,8 +240,7 @@ export default {
xgkc:'修改库存',
shxgkc:'审核修改库存',
shbj:'审核编辑',
sd:'锁定',
js:'解锁',
gd:'归档',
jd:'解档',
jy:'借阅',

+ 104
- 0
src/views/business/comps/select/SelectZcg.vue View File

@ -0,0 +1,104 @@
<template>
<div>
<el-select style="width:100%" v-model="selected" :placeholder="$t('form.placeholderSelect')" :disabled="readonly" :multiple="multiple" @change="handleChange" :filterable="filterable">
<el-option v-for="item in list" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</div>
</template>
<script>
import { public_zcgList } from "@/api/business/public/public";
export default {
name: "SelectZcg",
components: {},
props: {
value: {
type: [Number, String , Array],
default: '',
},
readonly: {
type: Boolean,
default: false
},
multiple: {
type: Boolean,
default: true
},
filterable: {
type: Boolean,
default: true
},
placeholder: {
type: String,
default: ''
},
storeId: {
type: [Number, String ],
default: getStoreId()
}
},
watch: {
value: {
immediate: true,
handler(v) {
if(!this.multiple){
this.selected = v ? parseInt(v) : ''
}else{
if(v){
//,
let arr = v.split(',')
let s = []
_.forEach(arr,a=>{
s.push(parseInt(a))
})
this.selected = s
}else{
this.selected = []
}
}
}
},
storeId: {
immediate: true,
handler(v) {
this.queryParam.storeId = v
this.getList()
}
},
},
data() {
return {
selected: '',
list: [],
queryParam:{
storeId:''
}
};
},
mounted() {
this.getList()
},
methods: {
getList() {
this.list = []
public_zcgList(this.queryParam).then(response => {
this.list = response.data || []
})
},
handleChange(val) {
this.$emit('input', this.multiple ? (val && val.length>0 ? val.join(','): ''):(val || ''))
//,
let res;
if(this.multiple){
res = this.list.filter(item=> {
return val.includes(item.id)
})
}else {
res = this.list.find(item=> item.id === val)
}
this.$emit('change', res)
},
}
};
</script>

+ 129
- 0
src/views/business/resource/mjy/comps/Sd.vue View File

@ -0,0 +1,129 @@
G<template>
<div class="app-container">
<!-- 锁定弹窗 -->
<el-dialog :title="$t('form.lock')" :visible.sync="open" width="500px" append-to-body
:close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
<el-input type="text" :value="form.qmyy" maxlength="50" disabled
:placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('form.remark')" prop="remark">
<el-input type="textarea" v-model="form.remark" :rows="2" maxlength="500"
:placeholder="$t('form.placeholderInput')">
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('form.signer')">
<el-input type="text" v-model="nickName" maxlength="50" disabled
:placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('form.password')" prop="sdrmm">
<el-input type="text" v-model="form.sdrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button>
<el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mjy_sd, mjy_sdBatch } from "@/api/business/mjy/mjy"
import { mapGetters } from 'vuex'
export default {
name: "MjySd",
data() {
return {
isBatch: false,
ids: [],
selectList: [],
open: false,
form: {},
rules: {
sdrmm: [{
required: true,
message: ' ',
trigger: 'blur'
}]
}
}
},
computed: {
...mapGetters([
'nickName'
]),
},
created() {
},
methods: {
showBatch(val) {
this.reset()
this.isBatch = true
this.form.ids = val.map(item => item.id)
this.selectList = val
this.open = true
},
cancel() {
this.open = false
},
reset() {
this.form = {
id: null,
ids: null,
mc: null,
bh: null,
qmyy: '锁定麻精药',
sdrmm: null
}
this.resetForm("form")
},
show(row) {
this.reset()
this.isBatch = false
this.form.ids = []
this.selectList = []
this.form.id = row.id
this.form.mc = row.mc
this.form.bh = row.bh
this.open = true
},
save() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.isBatch) {
mjy_sdBatch(this.form).then(response => {
this.open = false
this.$emit('callback')
})
} else {
mjy_sd(this.form).then(response => {
this.open = false
this.$emit('callback')
})
}
}
})
}
}
}
</script>

+ 15
- 4
src/views/business/resource/mjy/list.vue View File

@ -153,11 +153,11 @@
v-hasPermi="['business:resource:mjy:shxgkc']">{{
$t('page.business.zykgl.mjy.shxgkc') }}</el-button>
<!-- 锁定 -->
<el-button size="mini" type="text" @click="handleghys(scope.row)" v-hasPermi="['business:resource:mjy:sd']">{{
$t('page.business.zykgl.mjy.sd') }}</el-button>
<el-button size="mini" type="text" @click="handleSd(scope.row)" v-hasPermi="['business:resource:mjy:sd']">{{
$t('form.lock') }}</el-button>
<!-- 解锁 -->
<el-button size="mini" type="text" @click="handleghys(scope.row)" v-hasPermi="['business:resource:mjy:js']">{{
$t('page.business.zykgl.mjy.js') }}</el-button>
$t('form.unlock') }}</el-button>
<!-- 归档 -->
<el-button size="mini" type="text" @click="handleghys(scope.row)" v-hasPermi="['business:resource:mjy:gd']">{{
$t('page.business.zykgl.mjy.gd') }}</el-button>
@ -177,14 +177,18 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 锁定 -->
<Sd ref="Sd" @callback="handleQuery" />
</div>
</template>
<script>
import { mjy_list, mjy_info } from "@/api/business/mjy/mjy"
import { mjy_list } from "@/api/business/mjy/mjy"
import Sd from "./comps/Sd";
export default {
name: "Mjy",
components: { Sd },
data() {
return {
daterange: [],
@ -212,6 +216,13 @@ export default {
this.getList()
},
methods: {
handlePlsd(){
debugger
this.$refs.Sd.showBatch(this.selectList)
},
handleSd(row){
this.$refs.Sd.show(row)
},
getList() {
if (this.daterange != null && this.daterange.length > 0) {
this.queryParams.startDate = this.daterange[0]

+ 4
- 4
src/views/business/resource/zcg/comps/Ysff.vue View File

@ -19,15 +19,15 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('page.business.zykgl.zcg.qmyy')" prop="qmyy">
<el-input type="text" :value="$t('page.business.zykgl.zcg.ysff')" maxlength="50" disabled
<el-form-item :label="$t('form.qmyy')" prop="qmyy">
<el-input type="text" :value="form.qmyy" maxlength="50" disabled
:placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item :label="$t('page.business.zykgl.zcg.remark')" prop="remark">
<el-form-item :label="$t('form.remark')" prop="remark">
<el-input type="textarea" v-model="form.remark" :rows="2" maxlength="500"
:placeholder="$t('form.placeholderInput')">
</el-input>
@ -85,7 +85,7 @@ import { zcg_yyff } from "@/api/business/zcg/zcg"
import { mapGetters } from 'vuex'
export default {
name: "Zcg",
name: "ZcgYsff",
data() {
return {
open: false,

+ 3
- 3
src/views/business/resource/zcg/comps/Ysgh.vue View File

@ -75,7 +75,7 @@ G