Browse Source

sample

master
pengjun 2 years ago
parent
commit
09a37b6f67
  1. 68
      src/views/common-settings/SampleGroup.vue
  2. 266
      src/views/fee-settings/PayMode.vue

68
src/views/common-settings/SampleGroup.vue

@ -10,7 +10,7 @@
height="240px" height="240px"
class="el-table__body-wrapper tbody" class="el-table__body-wrapper tbody"
border:stripe="true" border:stripe="true"
@row-click="rowick"
@row-click="rowick" ref="info"
highlight-current-row highlight-current-row
> >
<el-table-column prop="id" label="编号" width="300"> <el-table-column prop="id" label="编号" width="300">
@ -149,27 +149,27 @@
<el-dialog <el-dialog
:title="title == 1 ? '新增' : '修改'" :title="title == 1 ? '新增' : '修改'"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="53%"
:close-on-click-modal="false"
width="520px"
:close-on-click-modal="false" @close="closeDialog"
> >
<el-form ref="form" :model="form" label-width="80px" :rules="rules"> <el-form ref="form" :model="form" label-width="80px" :rules="rules">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="编号"> <el-form-item label="编号">
<el-input v-model="form.id" disabled></el-input>
<el-input v-model="form.id" disabled size="small"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" prop="displayName"> <el-form-item label="名称" prop="displayName">
<el-input <el-input
v-model="form.displayName"
v-model="form.displayName" size="small"
ref="refinput" ref="refinput"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="标本类型" prop="sampleTypeId"> <el-form-item label="标本类型" prop="sampleTypeId">
<el-select v-model="form.sampleTypeId" placeholder="请选择">
<el-select v-model="form.sampleTypeId" placeholder="请选择" size="small">
<el-option <el-option
v-for="item in sampleTypeId" v-for="item in sampleTypeId"
:key="item.id" :key="item.id"
@ -184,8 +184,7 @@
<el-form-item label="标本容器" prop="sampleContainerId"> <el-form-item label="标本容器" prop="sampleContainerId">
<el-select <el-select
v-model="form.sampleContainerId" v-model="form.sampleContainerId"
placeholder="请选择"
>
placeholder="请选择" size="small">
<el-option <el-option
v-for="item in sampleContainerId" v-for="item in sampleContainerId"
:key="item.id" :key="item.id"
@ -198,22 +197,24 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="6">
<el-col :span="12">
<el-form-item label="创建者"> <el-form-item label="创建者">
<el-input v-model="form.creatorName" disabled></el-input> <el-input v-model="form.creatorName" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-col :span="12">
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-input :value="form.creationTime" disabled></el-input> <el-input :value="form.creationTime" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="修改者"> <el-form-item label="修改者">
<el-input v-model="form.lastModifierName" disabled></el-input> <el-input v-model="form.lastModifierName" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-col :span="12">
<el-form-item label="修改时间"> <el-form-item label="修改时间">
<el-input <el-input
:value="form.lastModificationTime" :value="form.lastModificationTime"
@ -248,7 +249,7 @@ import {
import { specimenlist, containerlist } from "@/request/systemapi"; import { specimenlist, containerlist } from "@/request/systemapi";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { mapState } from "vuex"; import { mapState } from "vuex";
import { arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy,dddw } from "../../utlis/proFunc";
import { arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy,dddw, objCopy } from "../../utlis/proFunc";
export default { export default {
data() { data() {
@ -875,9 +876,13 @@ export default {
sampleTypeId: this.form.sampleTypeId, sampleTypeId: this.form.sampleTypeId,
sampleContainerId: this.form.sampleContainerId, sampleContainerId: this.form.sampleContainerId,
}).then((res) => { }).then((res) => {
this.$message.success("新增成功");
this.getlist();
this.dialogVisible = false;
if(res.code != -1){
this.$message.success("新增成功");
// this.getlist();
this.form.id = res.data.id
this.tableData.push(deepCopy(res.data))
this.dialogVisible = false;
}
}); });
} else if (this.title == 2) { } else if (this.title == 2) {
barcodeediting(this.form.id, { barcodeediting(this.form.id, {
@ -885,14 +890,39 @@ export default {
sampleTypeId: this.form.sampleTypeId, sampleTypeId: this.form.sampleTypeId,
sampleContainerId: this.form.sampleContainerId, sampleContainerId: this.form.sampleContainerId,
}).then((res) => { }).then((res) => {
this.$message.success("修改成功");
this.dialogVisible = false;
this.getlist();
if(res.code != -1){
this.$message.success("修改成功");
// this.getlist();
this.dialogVisible = false;
}
}); });
} }
} }
}); });
}, },
closeDialog(){
if(!this.form.id) return
let currentRow = {}
let lfind = arrayExistObj(this.tableData,'id',this.form.id)
if(lfind > -1){
objCopy(this.form,this.tableData[lfind])
currentRow = this.tableData[lfind]
}else{
currentRow = deepCopy(this.form)
lfind = this.tableData.length
this.tableData.push(currentRow)
}
if(lfind > -1){
this.$nextTick(()=>{
this.$refs['info'].setCurrentRow(currentRow)
this.rowick(currentRow)
})
}
},
// //
btnAdd() { btnAdd() {
this.dialogVisible = true; this.dialogVisible = true;

266
src/views/fee-settings/PayMode.vue

@ -1,109 +1,120 @@
<template> <template>
<div class="box">
<div style="width: 95%">
<el-card>
<div class="publiccss">支付方式</div>
<el-table
:data="tableData" border
style="width: 100%; height: 500px; margin-top: 20px"
row-key="id"
:height="tableHeight"
class="el-table__body-wrapper tbody"
@row-click="rowick"
highlight-current-row
>
<el-table-column prop="id" label="编号" min-width="80" align="center"/>
<el-table-column prop="displayName" label="名称" min-width="80" align="center"/>
<el-table-column prop="simpleCode" label="快捷码" min-width="80" align="center"/>
<el-table-column prop="isActive" label="启用" min-width="80" align="center">
<template slot-scope="scope">
<div>{{ scope.row.isActive == 'Y' ? '是':'否'}}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template>
<el-tag
class="move"
style="
cursor: move;
margin-left: 15px;
background-color: rgb(245, 245, 245);
border: none;
"
draggable="true"
>
<i
class="el-icon-d-caret"
style="width: 1rem; height: 1rem; color: rgb(113, 113, 113)"
></i>
</el-tag>
</template>
</el-table-column>
</el-table>
<!-- 新增或者编辑 -->
<el-dialog
title="修改"
:visible.sync="dialogVisible"
width="40%"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="编号">
<el-input v-model="form.id" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="名称">
<el-input v-model="form.displayName"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addoredit" class="bulletcommit"
> </el-button
<div>
<el-card>
<div slot="header">支付方式</div>
<div style="display: flex;">
<div :style="'width:' + (window.pageWidth - 45 - 110) + 'px;'">
<el-table
:data="tableData" border
row-key="id"
:height="window.pageHeight - 150"
class="el-table__body-wrapper tbody"
@row-click="rowick"
highlight-current-row
>
<el-table-column prop="id" label="编号" min-width="80" align="center"/>
<el-table-column prop="displayName" label="名称" min-width="80" align="center"/>
<el-table-column prop="simpleCode" label="快捷码" min-width="80" align="center"/>
<el-table-column prop="isActive" label="启用" min-width="80" align="center">
<template slot-scope="scope">
<div>{{ scope.row.isActive == 'Y' ? '是':'否'}}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template>
<el-tag
class="move"
style="
cursor: move;
margin-left: 15px;
background-color: rgb(245, 245, 245);
border: none;
"
draggable="true"
>
<i
class="el-icon-d-caret"
style="width: 1rem; height: 1rem; color: rgb(113, 113, 113)"
></i>
</el-tag>
</template>
</el-table-column>
</el-table>
</div>
<!-- 按钮 -->
<div style="margin-left: 10px; margin-top: 50px;">
<div>
<el-button type="" @click="editpopup" class="btnClass">编辑</el-button>
</div>
<div>
<el-button type="" @click="topping" class="btnClass"
>置顶</el-button
> >
</span>
</el-dialog>
</el-card>
</div>
<!-- -->
<div style="margin-left: 10px; margin-top: 5%" class="buttonarea">
<el-button type="" @click="editpopup" class="commonbutton"
>编辑</el-button
>
<div style="margin-top: 10px">
<el-button type="" @click="topping" class="commonbutton"
>置顶</el-button
>
</div>
<div style="margin-top: 10px">
<el-button type="" @click="toppings" class="commonbutton"
>置底</el-button
>
</div>
<div style="margin-top: 10px">
<el-button
type=""
:disabled="isshow"
@click="assertion"
class="commonbutton"
>排序</el-button
>
</div>
<div>
<el-button type="" @click="toppings" class="btnClass"
>置底</el-button
>
</div>
<div>
<el-button
type=""
:disabled="isshow"
@click="assertion"
class="btnClass"
>排序</el-button
>
</div>
<div>
<el-button
type=""
:disabled="isshow"
@click="cancellation"
class="btnClass"
>取消</el-button
>
</div>
</div>
</div> </div>
<div style="margin-top: 10px">
<el-button
type=""
:disabled="isshow"
@click="cancellation"
class="commonbutton"
>取消</el-button
</el-card>
<!-- 新增或者编辑 -->
<el-dialog
title="修改"
:visible.sync="dialogVisible"
width="600px"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="编号">
<el-input v-model="form.id" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="名称">
<el-input v-model="form.displayName"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="启用">
<el-radio v-model="form.isActive" label="Y"></el-radio>
<el-radio v-model="form.isActive" label="N"></el-radio>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addoredit" class="bulletcommit"
> </el-button
> >
</div>
</div>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -114,16 +125,16 @@ import {
paytopandbottom, paytopandbottom,
paymentdraganddrop, paymentdraganddrop,
} from "@/request/commonapi"; } from "@/request/commonapi";
import { mapState } from "vuex"
export default { export default {
data() { data() {
return { return {
isshow: true,
tableHeight: window.innerHeight - 180, //
screenHeight: window.innerHeight, // 1
isshow: true,
initTableData: [], initTableData: [],
tableData: [], tableData: [],
form: { form: {
displayName: "", displayName: "",
isActive: "Y",
}, },
dialogVisible: false, dialogVisible: false,
}; };
@ -133,21 +144,13 @@ export default {
}, },
mounted() { mounted() {
this.rowDrop(); this.rowDrop();
// window.onresize:
window.onresize = () => {
return (() => {
// window.innerHeight:
window.screenHeight = window.innerHeight;
this.screenHeight = window.screenHeight;
})();
};
}, },
watch: { watch: {
// screenHeighttable
screenHeight(val) {
this.screenHeight = val;
this.tableHeight = this.screenHeight - 180;
},
},
computed:{
...mapState(['window'])
}, },
methods: { methods: {
// //
@ -232,6 +235,7 @@ export default {
} else { } else {
paymentediting(this.form.id, { paymentediting(this.form.id, {
displayName: this.form.displayName, displayName: this.form.displayName,
isActive:this.form.isActive
}).then((res) => { }).then((res) => {
this.$message.success("修改成功"); this.$message.success("修改成功");
this.getlist(); this.getlist();
@ -245,16 +249,10 @@ export default {
this.$message.warning("请点击选择操作的数据"); this.$message.warning("请点击选择操作的数据");
} else { } else {
this.dialogVisible = true; this.dialogVisible = true;
let copy = Object.assign({}, this.form);
this.form = copy;
// invoiceidquery(this.form.payModeId).then((res) => {
// console.log(res);
// this.form = res.data;
// });
} }
}, },
rowick(row) { rowick(row) {
this.form = row;
this.form = Object.assign({},row);
}, },
getlist() { getlist() {
paymodelist().then((res) => { paymodelist().then((res) => {
@ -267,12 +265,16 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
::v-deep .el-table__header th {
/* font-size: px; */
background-color: rgb(245, 245, 245); /* 设置表头背景颜色 */
color: rgb(113, 113, 113); /* 设置表头文字颜色 */
}
.box {
display: flex;
@import '../../assets/css/global_button.css';
@import '../../assets/css/global_card.css';
@import '../../assets/css/global_dialog.css';
@import '../../assets/css/global_form.css';
@import '../../assets/css/global_input.css';
@import '../../assets/css/global_table.css';
@import '../../assets/css/global.css';
.btnClass {
width: 100px;
margin-top: 10px
} }
</style> </style>
Loading…
Cancel
Save