Commit 1e97357a authored by gengchunlei's avatar gengchunlei

同意书、供应商合并

parents 4b70b3ec 44ff79a9
This diff is collapsed.
......@@ -55,6 +55,7 @@
created() {
//获取妇幼权限和登录基本信息
// document.cookie = 'bGNnd3lwdF9hdA=8f26b5cc-1d66-4b31-8b86-26d916209e1e;'//昆明市
document.cookie = 'bGNnd3lwdF9hdA=5028cd4d-4491-4351-9448-4b357d8f1591;'//云南省
let cookieToken = getCookie('bGNnd3lwdF9hdA')
if (cookieToken) {//根据cookie获取token并调用接口获取菜单并设置初始选中菜单
......
<template>
<a-tree-select
v-model="value"
tree-data-simple-mode
allowClear
:tree-data="treeData"
placeholder="请选择"
:load-data="onLoadData"
/>
</template>
<script>
/**
* 所有地区选择控件
*/
export default {
name: "allAreaSelect",
created() {
this.getDataList(53);
},
data() {
return {
value: undefined,
treeData: [],
};
},
watch: {
value(value) {
this.$emit('input', value);
},
},
methods: {
getDataList(areaCode) {
let treeData = [];
this.$api.common.fetchAreaByCode(areaCode).then(({code, data}) => {
if (code === "SUCCESS") {
data.forEach(x => {
let item = {
id: x.areaCode,
pId: 0,
value: x.areaCode,
title: x.areaName,
isLeaf: x.areaLevel == 5 ? true : false
};
treeData.push(item);
});
this.treeData = treeData;
}
});
},
onLoadData(treeNode) {
let that = this;
return new Promise(resolve => {
this.$api.common.fetchAreaByCode(treeNode.value).then(({code, data}) => {
let treeData = [];
if (code === "SUCCESS") {
console.log(data)
data.forEach(x => {
let item = {
id: x.areaCode,
pId: treeNode.value,
value: x.areaCode,
title: x.areaName,
isLeaf: x.areaLevel == 5 ? true : false
};
treeData.push(item);
});
that.treeData = that.treeData.concat(treeData);
resolve();
}
});
});
},
},
}
</script>
<style scoped>
</style>
......@@ -13,6 +13,11 @@
name: "baiduEditor",
created() {
},
watch: {
content(content) {
this.$emit('input', content);
}
},
beforeDestroy() {
},
data() {
......
......@@ -2,18 +2,10 @@
<div>
<div style="text-align: center;font-size: 16px;font-weight: bold;"><span>知情同意书</span></div>
<a-form-model ref="formRef" :model="formData" :rules="formRules" style="margin-top: 20px">
<a-row>
<!-- <a-col :span="11">
<a-form-model-item label="模板名称" prop="name" :label-col="{span: 5}"
:wrapper-col="{span: 18}">
<a-input placeholder="请输入模板名称" :disabled="formDisabled" v-model="formData.name"></a-input>
</a-form-model-item>
</a-col>-->
</a-row>
<a-row>
<a-col :span="24">
<!--label="模板内容"-->
<a-form-model-item prop="content":wrapper-col="{span: 24}">
<a-form-model-item prop="content" :wrapper-col="{span: 24}">
<baiduEditor ref="baiduEditor" v-model="formData.content"></baiduEditor>
</a-form-model-item>
</a-col>
......@@ -29,7 +21,7 @@
<script>
import typeSelect from "../../components/commonSelect/typeSelect";
import baiduEditor from "../../components/baiduEditor";
import {closedDetail} from "../../utils/common";
import {closedDetail, isBlank} from "../../utils/common";
export default {
components: {typeSelect, baiduEditor},
......@@ -38,6 +30,7 @@
return {
// form表单
formData: {
id: "",
content: ""
},
formRules: {
......@@ -46,16 +39,23 @@
]
},
formDisabled: false,
modeType: "update"
}
},
created() {
let that = this;
this.$api.systemManage.getTemplateById(1).then(res => {
let vm = this;
this.$api.common.fetchConsentInfo().then(res => {
if (res.code == 'SUCCESS') {
this.formData = res.data;
if (isBlank(res.data)) {
this.modeType = 'add';
} else {
setTimeout(function () {
that.$refs.baiduEditor.setContent(that.formData.content, that.formDisabled);
}, 300)
vm.$refs.baiduEditor.setContent(res.data.content,false)
},500);
this.formData.content = res.data.content;
this.formData.id = res.data.id;
}
}
})
},
......@@ -70,12 +70,20 @@
title: '确定提交吗?',
okType: 'success',
onOk: () => {
vm.$api.systemManage.addTemplate(this.formData).then(res => {
if (this.modeType === "add") {
vm.$api.common.fetchAddConsentInfo(this.formData).then(res => {
if (res.code === 'SUCCESS') {
vm.$message.success('操作成功!')
}
})
} else {
vm.$api.common.fetchUpdateConsentInfo(this.formData).then(res => {
if (res.code === 'SUCCESS') {
vm.$message.success('操作成功!')
}
})
}
},
onCancel: () => {
},
......@@ -92,9 +100,10 @@
<style lang="less">
.edui-default .edui-toolbar .edui-combox .edui-combox-body {
line-height: 21px!important;
line-height: 21px !important;
}
.edui-default .edui-button-body, .edui-splitbutton-body, .edui-menubutton-body, .edui-combox-body {
line-height: 20px!important;
line-height: 20px !important;
}
</style>
......@@ -10,15 +10,18 @@
</a-select>
</a-form-item>
<a-form-item label="品牌">
<!--v-price="{digit:4}"-->
<a-input v-model="searchForm.brandName" placeholder="请输入品牌" style="width: 250px"></a-input>
<a-select v-model="searchForm.brandId" placeholder="请选择" style="width: 250px">
<a-select-option value="">全部</a-select-option>
<a-select-option v-for="item in brandList" :key="item.enumValue" :value="item.enumValue">
{{item.enumName}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="入库日期">
<a-date-picker v-model="searchForm.enterDate" format="YYYY-MM-DD" style="width: 250px"
/>
<a-date-picker v-model="searchForm.enterDate" format="YYYY-MM-DD" style="width: 250px"/>
</a-form-item>
<a-button class="search_btn" style="float: right;margin-left: 10px" @click="restSearchForm">清空</a-button>
<a-button type="primary" class="search_btn" style="float: right" @click="searchList">搜索</a-button>
<a-button type="primary" class="search_btn" @click="searchList">搜索</a-button>
<a-button class="search_btn" style="margin-left: 10px" @click="restSearchForm">清空</a-button>
<div style="clear: both"></div>
</a-form>
......@@ -47,12 +50,15 @@
</a-list>
</div>
</div>
<span style="padding: 5px 16px;color: #FF4D80">已选择叶酸{{selectedRowKeys.length}}<a-icon type="down" style="margin-left:10px;font-size: 10px"/> </span>
<span style="padding: 5px 16px;color: #FF4D80">已选择叶酸{{selectedRowKeys.length}}<a-icon type="down"
style="margin-left:10px;font-size: 10px"/> </span>
</a-popover>
</div>
<div style="margin-top: 16px;margin-bottom: 10px">
<a-button type="primary" class="search_btn btn_space" @click="openModal">库存录入</a-button>
<a-button type="primary" class="search_btn btn_space" :disabled="selectedRowKeys.length <= 0" @click="toAdd">调拨分配</a-button>
<a-button type="primary" class="search_btn btn_space" :disabled="selectedRowKeys.length <= 0"
@click="toAdd">调拨分配
</a-button>
<a-button type="primary" class="search_btn btn_space">导出Excel</a-button>
</div>
......@@ -90,8 +96,9 @@
</div>
</template>
<script>
import {isEmptyParams} from "../../utils/common";
import {isNotBlank, isEmptyParams} from "../../utils/common";
import moment from 'moment'
const columns = [
{
title: '品牌',
......@@ -153,6 +160,7 @@
searchForm: {
brandName: '',
supplierId: '',
brandId:'',
enterDate: undefined
},
pagination: {
......@@ -164,19 +172,21 @@
columns,
tableData: [],
loading: false,
allSupplyInfo:[],
selectedRowKeys:[],
allSupplyInfo: [],
brandList: [],
selectedRowKeys: [],
selectedVisible: false,
selectedRowList:[],
selectedRowList: [],
}
},
created() {
this.getInStockList()
this.getAllSupply()
this.getInStockList();
this.getAllSupply();
this.brandList = JSON.parse(sessionStorage.getItem("allEnum"))["folacin_stock_record_brand_id"];
},
methods: {
getAllSupply() {
let par= {}
let par = {}
this.$api.common.fetchAllSupply(par).then(({data = []}) => {
this.allSupplyInfo = data
})
......@@ -187,12 +197,16 @@
},
getInStockList() {
this.loading = true
let pars = isEmptyParams(this.searchForm)
let pars = isEmptyParams(this.searchForm);
if (isNotBlank( pars.enterDate)){
pars.enterDate = moment(pars.enterDate).format('YYYY-MM-DD')
}
let par = {
...pars,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
}
console.log(par);
this.$api.stockManage.fetchInStockList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data
this.tableData = dataList
......@@ -228,8 +242,8 @@
}
},
delSelectedKey(index) {
this.selectedRowKeys.splice(index,1)
this.selectedRowList.splice(index,1)
this.selectedRowKeys.splice(index, 1)
this.selectedRowList.splice(index, 1)
if (this.selectedRowKeys.length == 0) {
this.selectedVisible = false
}
......@@ -247,13 +261,13 @@
},
// 库存录入按钮
openModal() {
this.$router.push({path:'/inStock/add', query:{}})
this.$router.push({path: '/inStock/add', query: {}})
},
toAdd() {
this.$router.push({path:'/inStock/addMaterialDistribution', query: {selected:this.selectedRowKeys}})
this.$router.push({path: '/inStock/addMaterialDistribution', query: {selected: this.selectedRowKeys}})
},
toDetail(record) {
this.$router.push({path:'/inStock/inStockManageDetail', query: record})
this.$router.push({path: '/inStock/inStockManageDetail', query: record})
}
},
}
......@@ -273,7 +287,8 @@
.btn_space {
margin-right: 5px;
}
/* .search_form {
/* .search_form {
margin-top: -17px;
border: 1px solid rgba(255,77,128, .2);
border-top: 0px;
......
......@@ -32,21 +32,19 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="12">
<a-form-model-item label="联系地址"
prop="address"
:labelCol="{span: 3}"
:wrapperCol="{span: 20}">
<a-input v-model="formData.address"
placeholder="请输入联系地址"></a-input>
prop="areaCode">
<allAreaSelect v-model="formData.areaCode"></allAreaSelect>
{{formData.areaName}}
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="详细地址"
prop="batchId"
prop="address"
:labelCol="{span: 3}"
:wrapperCol="{span: 20}">
<a-input v-model="formData.stockNum"
<a-input v-model="formData.address"
placeholder="请输入详细地址"></a-input>
</a-form-model-item>
</a-col>
......@@ -66,98 +64,75 @@
</div>
<div style="text-align: center">
<a-button class="search_btn btn_space" @click="goBack">取消</a-button>
<a-button type="primary" class="search_btn btn_space" :loading="subLoad" style="margin-left: 10px" @click="submitForm">保存</a-button>
<a-button type="primary" class="search_btn btn_space" :loading="subLoad" style="margin-left: 10px"
@click="submitForm">保存
</a-button>
</div>
</a-card>
</div>
</template>
<script>
import moment from 'moment'
import {closedDetail} from "../../../utils/common";
import allAreaSelect from '../../../components/allAreaSelect'
import {checkPhone, closedDetail} from "../../../utils/common";
export default {
components: {},
components: {allAreaSelect},
data() {
return {
subLoad: false,
// form表单
formData: {
breedId: undefined,
batchNumber: undefined,
medicalId: undefined,
factoryId: undefined,
supplyName: undefined,
classify: undefined,
unitPrice: undefined,
batchId: undefined,
produceDate: undefined,
expireDate: undefined,
stockNum: undefined,
supplierName: undefined,
contactsName: undefined,
contactsPhone: undefined,
// supplierName: undefined,
// contactsName: undefined,
// contactsPhone: undefined,
},
formRules: {
supplierName: [
{required: true, message: '请输入供应商名称'}
{required: true, message: '请选择供应商名称', trigger: 'change'},
],
contactsName:[
{required: true, message: '请输入联系人'}
contactsName: [
{required: true, message: '请输入联系人', trigger: 'change'}
],
contactsPhone: [
{required: true, message: '请输入联系人电话'}
],
medicalId: [
{required: true, message: '请选择品种名称'}
],
factoryId: [
{required: true, message: '请选择生产厂家', trigger: 'change'}
],
batchId: [
{required: true, message: '请输入生产批次', trigger: 'change'}
{required: true, message: '请输入联系人电话', trigger: 'change'},
{validator: checkPhone},
],
stockNum: [
{required: true, message: '请输入药具数量', trigger: 'change'}
areaCode: [
{required: true, message: '请选择联系地址', trigger: 'change'}
],
produceDate: [
{required: true, message: '请选择日期', trigger: 'change'}
],
expireDate: [
{required: true, message: '请选择日期', trigger: 'change'}
],
unitPrice: [
{required: true, message: '请输入单价'}
address: [
{required: true, message: '请输入详细地址', trigger: 'change'}
],
},
routerParams: {}
queryParams: {}
}
},
created() {
this.routerParams = this.$route.query
if (this.routerParams.flag == 'update') {
this.getSupplyDetail(this.routerParams)
this.queryParams = this.$route.query;
if (this.queryParams.modeType === "update") {
this.$api.common.fetchSupplyById(this.queryParams.id).then(res => {
if (res.code === 'SUCCESS') {
this.formData = res.data;
}
}).catch(() => {
});
}
},
methods: {
getSupplyDetail(record) {
let par = {
id: record.id
}
this.$api.supplyManage.fetchSupplyDetail(par).then(({data}) => {
})
},
// 弹窗确定按钮
submitForm() {
let vm = this
let vm = this;
this.$refs.formRef.validate(valid => {
if (valid) {
vm.subLoad = true
let par = {
...vm.formData
}
vm.$api.stockManage.addHistoryStock(par).then(res => {
};
if (this.queryParams.modeType === 'add') {
vm.$api.common.fetchAddSupply(par).then(res => {
this.subLoad = false;
if (res.code === 'SUCCESS') {
vm.$message.success('保存成功!')
......@@ -167,10 +142,22 @@
this.subLoad = false
})
}
if (this.queryParams.modeType === 'update') {
vm.$api.common.fetchSupplUpdate(par).then(res => {
this.subLoad = false;
if (res.code === 'SUCCESS') {
vm.$message.success('修改成功!')
vm.goBack()
}
}).catch(() => {
this.subLoad = false
})
}
}
});
},
goBack() {
closedDetail('/supplyManage/add','/Home/supplyManage')
closedDetail('/supplyManage/add', '/Home/supplyManage')
}
},
}
......
......@@ -7,8 +7,8 @@
<a-form-item label="状态">
<a-select v-model="searchForm.status" placeholder="请选择" style="width: 250px">
<a-select-option value="">全部</a-select-option>
<a-select-option v-for="item in allFactoryInfo" :key="item.id" :value="item.id">
{{item.factoryName}}
<a-select-option v-for="item in allFactoryInfo" :key="item.enumValue" :value="item.enumValue">
{{item.enumName}}
</a-select-option>
</a-select>
</a-form-item>
......@@ -27,22 +27,19 @@
:loading="loading"
:pagination="false"
>
<template slot="statusInfo" slot-scope="record">
{{record.statusName}}
</template>
<template slot="action" slot-scope="record">
<a-button type="link" size="small" @click="toUpdate(record)">修改</a-button>
<!--<a-button type="link" size="small" @click="toUpdate(record)">修改</a-button>-->
<a-popconfirm
:title="'确定' + (record.status === 0 ? '禁用' : '启用') + '该供应商吗?'"
:title="'确定' + (record.status === 1 ? '停用' : '启用') + '该供应商吗?'"
ok-text="是"
cancel-text="否"
@confirm="changeStatus(record)"
:disabled="record.status == '0'"
>
<a href="#">{{record.status === 0 ? '禁用' : '启用'}}</a>
<a href="#">{{record.status === 1 ? '停用' : '启用'}}</a>
</a-popconfirm>
<a-button type="link" size="small" @click="updateSupply(record)">修改</a-button>
<a-button type="link" size="small" @click="deleteConfirm(record)">删除</a-button>
</template>
</a-table>
<a-pagination
......@@ -61,7 +58,6 @@
</template>
<script>
import {isEmptyParams} from "../../utils/common";
import moment from 'moment'
const columns = [
{
title: '供应商名称',
......@@ -91,12 +87,12 @@
{
title: '状态',
width: 70,
scopedSlots: {customRender: 'statusInfo'},
dataIndex: 'statusName'
},
{
title: '操作',
align: 'center',
width: 110,
width: 150,
scopedSlots: {customRender: 'action'},
},
]
......@@ -106,7 +102,7 @@
return {
// 搜索框对象
searchForm: {
supplierName:undefined,
supplierName: undefined,
status: ''
},
pagination: {
......@@ -118,27 +114,28 @@
columns,
tableData: [],
loading: false,
allFactoryInfo:[]
allFactoryInfo: []
}
},
created() {
this.getInStockList()
this.getSupplyList();
this.allFactoryInfo = JSON.parse(sessionStorage.getItem("allEnum"))["public_state"];
},
methods: {
searchList() {
this.pagination.pageIndex = 1
this.getInStockList()
this.pagination.pageIndex = 1;
this.getSupplyList()
},
getInStockList() {
this.loading = true
getSupplyList() {
this.loading = true;
let pars = isEmptyParams(this.searchForm)
let par = {
...pars,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
}
this.$api.stockManage.fetchInStockList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data
this.$api.common.fetchSupplyPageList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data;
this.tableData = dataList
this.pagination.total = total
this.loading = false
......@@ -150,37 +147,30 @@
showSizeChange(pageNum, pageSize) {
this.pagination.pageIndex = 1;
this.pagination.pageSize = pageSize;
this.getInStockList()
this.getSupplyList()
},
change(pageNum, pageSize) {
this.pagination.pageIndex = pageNum;
this.pagination.pageSize = pageSize;
this.getInStockList()
this.getSupplyList()
},
restSearchForm() {
this.searchForm = {
idCar:undefined
idCar: undefined
}
this.searchList()
},
toAdd() {
this.$router.push({path:'/supplyManage/add', query: {flag: 'add'}})
},
toUpdate(record) {
let par = {
...record,
flag: 'update'
}
this.$router.push({path:'/supplyManage/add',query: par})
this.$router.push({path:'/supplyManage/add'})
},
changeStatus(record) {
let par = {
...record,
id: record.id,
status: record.status === 0 ? 1 : 0,
}
this.$api.networkManage.fetchUpdateNetwork(par).then(res => {
this.$api.common.fetchSupplUpdate(par).then(res => {
if (res.code === 'SUCCESS') {
this.getInStockList()
this.getSupplyList()
}
})
},
......@@ -190,13 +180,10 @@
title: '确定删除该条数据吗?',
okType: 'danger',
onOk: () => {
let par = {
id: record.id
}
this.$api.systemManage.deleteRoleOneById(par).then(res => {
this.$api.common.fetchSupplDelete(record.id).then(res => {
if (res.code === 'SUCCESS') {
this.pagination.pageIndex = 1;
this.getInStockList()
this.getSupplyList()
this.$message.success('删除成功!')
}
})
......@@ -207,6 +194,9 @@
},
});
},
updateSupply(record) {
this.$router.push({path: '/supplyManage/add', query: {modeType: "update", id: record.id}});
}
},
}
</script>
......@@ -225,6 +215,7 @@
.btn_space {
margin-right: 5px;
}
/* .search_form {
margin-top: -16px;
border: 1px solid rgba(255,77,128, .2);
......
import moment from 'moment';
import storeInfo from '../../store/index'
import router from "../../router";
......@@ -7,7 +6,7 @@ import router from "../../router";
export const singleArr = (arr, val) => {
let newArr = arr.concat()
let len = newArr.length;
if (val){
if (val) {
for (let i = 0; i < len; i++) {
for (let j = i + 1; j < len; j++) {
if (newArr[i][val] == newArr[j][val]) {
......@@ -33,21 +32,21 @@ export const singleArr = (arr, val) => {
}
//删除关闭详情的页面
export const closedDetail = (url, goToUrl) => {
export const closedDetail = (url, goToUrl) => {
if (goToUrl) {
window.sessionStorage.setItem('activeItem', goToUrl)
window.sessionStorage.setItem('activeKey', goToUrl)
storeInfo.commit('changeActKey', goToUrl)
router.push(goToUrl)
}
}
}
//判断对象values是否为空 并返回不为空对象
export const isEmptyParams = (obj) => {
let obje = {}
Object.assign(obje, obj)
for ( let key in obje ){
if (obje[key] === '' || typeof obje[key] === 'undefined' || obje[key] === null || obje[key].length == 0){
for (let key in obje) {
if (obje[key] === '' || typeof obje[key] === 'undefined' || obje[key] === null || obje[key].length == 0) {
delete obje[key]
}
}
......@@ -55,36 +54,38 @@ export const isEmptyParams = (obj) => {
}
//数组转为树形结构
// toTree(数组,父id,父id属性key, id当前节点id key)
export const toTree = (list,parId,pId,id) => {
// toTree(数组,父id,父id属性key, id当前节点id key)
export const toTree = (list, parId, pId, id) => {
let len = list.length
function loop(parId){
function loop(parId) {
let res = [];
for(let i = 0; i < len; i++){
for (let i = 0; i < len; i++) {
let item = list[i]
if(item[pId] == parId){
if (item[pId] == parId) {
item.children = loop(item[id])
res.push(item)
}
}
return res
}
return loop(parId)
}
//树形数据转数组
export const treeToArray = (source) => {
export const treeToArray = (source) => {
let res = []
const fn = (source)=>{
source.forEach(el=>{
const fn = (source) => {
source.forEach(el => {
res.push(el)
el.children && el.children.length>0 ? fn(el.children) : ""
el.children && el.children.length > 0 ? fn(el.children) : ""
})
}
return res
}
}
//删除树状结构数据中空children
//删除树状结构数据中空children
export const removeEmptyChildren = (data) => {
data.forEach(item => {
if (item.children === null || item.children.length === 0) {
......@@ -156,10 +157,28 @@ export const getEnumByFlag = (enumFlag) => {
//读取cookie
export const getCookie = name => {
let arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
let arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
};
//判断一对象是否是空白
export const isBlank = obj => {
if (obj == null || obj == undefined || obj == '' || obj == ' ') {
return true;
}
if (obj === null || obj === undefined || obj === '' || obj === ' ') {
return true;
}
if (obj == {} || obj == []) {
return true
}
return false;
};
export const isNotBlank = obj => {
return !isBlank(obj)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment