Commit 597e51e2 authored by gengchunlei's avatar gengchunlei

bug修改

parent ac7f98ac
......@@ -54,7 +54,7 @@
},
created() {
//获取妇幼权限和登录基本信息
// document.cookie = 'bGNnd3lwdF9hdA=4f0aa588-ba25-4d21-a200-e94cd6dcc1cc;'//昆明市
// document.cookie = 'bGNnd3lwdF9hdA=4bace827-4931-44f1-9e4f-82f9838734be;'//昆明市
// document.cookie = 'bGNnd3lwdF9hdA=' + sessionStorage.getItem("loginToken") + ';'//云南省
let cookieToken = getCookie('bGNnd3lwdF9hdA');
console.log('tokenInfo',cookieToken)
......
......@@ -60,7 +60,7 @@
:rows="5"
:maxLength="200"
v-model="formData.remarks"
placeholder="请输入备注(最多可输入200字)"></a-textarea>
placeholder="请输入备注,最多可输入200字"></a-textarea>
</a-form-model-item>
</a-form-model>
</div>
......
......@@ -52,8 +52,11 @@
<a-descriptions-item label="入库时间" v-if="detailInfo.status == 2">
{{detailInfo.receiveDate || '--'}}
</a-descriptions-item>
<a-descriptions-item label="备注" :span="3">
{{detailInfo.remarks || '--'}}
</a-descriptions-item>
</a-descriptions>
<a-form-model ref="formRef"
<!--<a-form-model ref="formRef"
:labelCol="{span: 4}"
:wrapperCol="{span: 16}"
style="margin-top: 20px"
......@@ -69,7 +72,7 @@
v-model="detailInfo.remarks"
placeholder="请输入备注"></a-textarea>
</a-form-model-item>
</a-form-model>
</a-form-model>-->
</div>
</div>
<div style="text-align: center;margin-top: 16px">
......
......@@ -85,34 +85,36 @@
},
{
title: '单价(元)',
width:'90px',
dataIndex: 'unitPrice',
ellipsis: true
},
{
title: '规格',
dataIndex: 'specs',
ellipsis: true
width:'70px',
},
{
title: '分配数量',
dataIndex: 'sendNum',
ellipsis: true
width:'100px',
},
{
title: '入库状态',
// dataIndex: 'statusName',
// ellipsis: true,
width:'100px',
scopedSlots: {customRender: 'statusNameInfo'},
},
{
title: '入库日期',
dataIndex: 'receiveDate',
ellipsis: true
width: '110px',
},
{
title: '操作',
align: 'center',
fixed: 'right',
width:'140px',
scopedSlots: {customRender: 'action'},
},
]
......
......@@ -29,7 +29,9 @@
:pagination="false"
>
<template slot="statusName" slot-scope="record">
<a-button type="link" size="small">{{record.statusName}}</a-button>
<a-badge status="success" v-if="record.status == 2" />
<a-badge status="warning" v-if="record.status == 1"/>
<span>{{record.statusName}}</span>
</template>
<a-table
slot="expandedRowRender"
......@@ -38,8 +40,10 @@
:data-source="record.detailedList"
:pagination="false"
>
<template slot="statusName" slot-scope="record">
<a-button type="link" size="small">{{record.statusName}}</a-button>
<template slot="statusNameInfo" slot-scope="record">
<a-badge status="success" v-if="record.status == 2" />
<a-badge status="warning" v-if="record.status == 1"/>
<span>{{record.statusName}}</span>
</template>
</a-table>
</a-table>
......@@ -145,7 +149,7 @@
{
title: '收货状态',
width:"160px",
scopedSlots: {customRender: 'statusName'},
scopedSlots: {customRender: 'statusNameInfo'},
ellipsis: true
},
{
......
......@@ -21,8 +21,10 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-model-item label="姓名" prop="womanName">
<a-input placeholder="请输入姓名" :disabled="disabled"
v-model="formData.womanName"></a-input>
<a-input v-toInputNum="{num: 15}"
placeholder="请输入姓名,最多可输入15个字"
:disabled="disabled"
v-model="formData.womanName"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
......@@ -74,16 +76,23 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-model-item label="姓名" prop="manName">
<a-input placeholder="请输入姓名" v-model="formData.manName"
<a-input
v-toInputNum="{num: 15}"
placeholder="请输入姓名,最多可输入15个字"
v-model="formData.manName"
:disabled="disabled"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="证件类型" prop="menCertificateType">
<a-select v-model="formData.menCertificateType" placeholder="请选择"
:disabled="disabled">
<a-select v-model="formData.menCertificateType"
placeholder="请选择"
:disabled="disabled"
>
<a-select-option v-for="item in certificateTypeList"
:key="item.enumValue" :value="item.enumValue"
:key="item.enumValue"
:value="item.enumValue"
>
{{item.enumName}}
</a-select-option>
......@@ -116,13 +125,13 @@
<a-form-model-item label="现住地址" prop="presentCode" :labelCol="{span: 3}"
:wrapperCol="{span: 20}">
<!--<a-input placeholder="请输入现住地址" v-model="formData.presentCode"></a-input>-->
<!--@click.native="initLoadAreaData"-->
<a-cascader v-model="formData.presentCode"
change-on-select
:disabled="disabled"
:options="areaInfo"
:fieldNames="fieldNames"
:load-data="loadAreaData"
@click.native="initLoadAreaData"
placeholder="请选择"/>
</a-form-model-item>
</a-col>
......@@ -130,7 +139,10 @@
<a-col :span="24">
<a-form-model-item label="详细地址" prop="nowAddress" :labelCol="{span: 3}"
:wrapperCol="{span: 20}">
<a-input placeholder="请输入详细地址" v-model="formData.nowAddress"
<a-input
v-toInputNum="{num: 100}"
placeholder="请输入详细地址,最多可输入100个字"
v-model="formData.nowAddress"
:disabled="disabled"></a-input>
</a-form-model-item>
</a-col>
......@@ -164,14 +176,14 @@
</div>
</a-card>
</a-form-model-item>
</a-col>
</a-col>-->
<a-col :span="21" :offset="3" v-if="routerParams.routerFlag == 'update'">
<a-form-model-item :wrapperCol="{span: 23}">
<div style="border: 1px dashed #EEEEEE">
<img style="width: 100%;height: 160px" :src="formData.consentUrl">
</div>
</a-form-model-item>
</a-col>-->
</a-col>
<!-- <a-col :span="21" :offset="3">
<a-form-model-item :wrapperCol="{span: 23}">
<div style="border: 1px dashed #EEEEEE">
......@@ -322,7 +334,11 @@
{required: true, message: '请选择证件类型'}
],
womenIdCard: [
{required: true, message: '请输入证件号码'}
{required: true, message: '请输入证件号码'},
{
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
message:'请输入正确的身份证号'
}
],
// oncePregnant: [
// {required: true, message: '请选择是否曾经怀孕'}
......@@ -337,7 +353,11 @@
{required: true, message: '请选择证件类型'}
],
menIdCard: [
{required: true, message: '请输入证件号码'}
{required: true, message: '请输入证件号码'},
{
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
message:'请输入正确的身份证号'
}
],
telephone: [
{required: true, message: '请输入联系电话'},
......@@ -410,6 +430,7 @@
this.signedModeList = getEnumByFlag('folacin_resident_info_signed_mode')
this.getBookHtmlContent()
this.getAllDoctorList()
this.initLoadAreaData()
if (this.routerParams.routerFlag == 'update') {//从申请过来的发放
this.disabled = true;
this.getStockListDetail()
......@@ -476,6 +497,9 @@
targetOption.loading = false;
data.forEach(item => {
item['isLeaf'] = false
if (item.areaLevel >=5) {
item['isLeaf'] = true
}
})
if (targetOption.areaCode == 0) {
this.areaInfo = [...data]
......
......@@ -78,7 +78,7 @@
@click="showVisible=true"/>
</a-descriptions-item>
</a-descriptions>
<div class="card_info">
<!-- <div class="card_info">
<a-card class="book" :headStyle="{background: '#FAFAFA'}" v-if="routerParams.source == 2">
<div slot="title" style="text-align: center;">
<span style="color: #262626;font-size: 14px">知情同意书</span>
......@@ -88,7 +88,7 @@
</div>
</div>
</a-card>
</div>
</div>-->
<div v-if="routerParams.source == 2">
<img style="width: 100%;height: 160px" :src="detailInfo.applySignUrl">
</div>
......
......@@ -28,7 +28,7 @@
</a-form-item>
<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="float: right;line-height: 32px;background-color: #E6F7FF;margin-top: 16px;cursor: pointer"
<div style="float: right;line-height: 32px;background-color: #FFF1F0;margin-top: 16px;cursor: pointer"
@click="showSelectedMedical"
v-if="selectedRowKeys.length > 0"
>
......
......@@ -16,7 +16,11 @@
<a-row>
<a-col :span="8">
<a-form-model-item label="发货人姓名" prop="sendContact">
<a-input placeholder="请填写发货人" v-model="formData.sendContact"></a-input>
<a-input
v-toInputNum="{num:15}"
placeholder="请填写发货人,最多可输入15个字"
v-model="formData.sendContact"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="8">
......@@ -44,7 +48,11 @@
</a-col>
<a-col :span="8">
<a-form-model-item label="收货人姓名" prop="receiver">
<a-input placeholder="请填写收货人" v-model="formData.receiver"></a-input>
<a-input
v-toInputNum="{num:15}"
placeholder="请填写收货人,最多可输入15个字"
v-model="formData.receiver"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="8">
......@@ -69,7 +77,7 @@
<a-form-model-item :prop="'detailedList.' + index + '.sendNum'"
:rules="formRules.sendNum" class="tab_input_r">
<a-input type="number"
v-toInt
v-toInt="{notNum: 0}"
v-model="record.sendNum"
placeholder="请输入分配数量"
style="width: 150px;"
......
......@@ -13,7 +13,7 @@
<a-col :span="12">
<a-form-model-item label="供应商" prop="supplierId">
<a-select v-model="formData.supplierId"
placeholder="请选择"
placeholder="请选择供应商"
:dropdownMatchSelectWidth="false"
@click.native="getAllSupply"
>
......@@ -26,7 +26,7 @@
<a-col :span="12">
<a-form-model-item label="品牌" prop="brandId">
<a-select v-model="formData.brandId"
placeholder="品牌名称"
placeholder="请选择叶酸品牌"
:dropdownMatchSelectWidth="false"
>
<a-select-option v-for="item in brandNameList" :key="item.enumValue"
......@@ -37,8 +37,10 @@
</a-col>
<a-col :span="12">
<a-form-model-item label="批次号" prop="batchNumber">
<a-input v-model="formData.batchNumber"
placeholder="请输入批次号"></a-input>
<a-input
v-toInputNum="{num:10}"
v-model="formData.batchNumber"
placeholder="请输入批次号,最多可输入10个字"></a-input>
</a-form-model-item>
</a-col>
......@@ -55,11 +57,16 @@
</a-form-model-item>
</a-col>
<a-col :span="12">
<!-- @change="changeUnitPrice({digit:2, maxNum: 10000})"-->
<a-form-model-item label="单价" prop="unitPrice">
<a-input v-price
<a-input
v-price="{digit:2, maxNum:10000}"
v-model="formData.unitPrice"
suffix="元"
placeholder="请输入单价,保留2位小数"></a-input>
placeholder="0~10000,最多保留2位小数"
>
<span slot="addonAfter"></span>
</a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
......@@ -70,9 +77,9 @@
</a-col>
<a-col :span="12">
<a-form-model-item label="数量" prop="number">
<a-input v-toInt
<a-input v-toInt="{maxNum:10000000}"
v-model="formData.number"
placeholder="请输入数量">
placeholder="0~10000000">
<a-select slot="addonAfter" v-model="formData.specs" default-value="瓶"
style="width: 60px">
<a-select-option value="瓶">
......@@ -95,8 +102,9 @@
<a-col :span="12">
<a-form-model-item label="入库经手人" prop="handler">
<a-input
v-toInputNum="{num:15}"
v-model="formData.handler"
placeholder="请输入入库经手人"></a-input>
placeholder="请输入入库经手人,最多可输入15个字"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
......@@ -228,6 +236,21 @@
}
});
},
changeUnitPrice(val) {
if (val.maxNum && this.formData.unitPrice > val.maxNum) {
this.formData.unitPrice = val.maxNum
}
let num = new RegExp(`(^[\\-0-9][0-9]*(.[0-9]+)?)$`) // 是否为数字
let littleNum = new RegExp(`^(0|[1-9]\\d{0,${val.digit}})(\\.\\d{1,${val.digit}})?$`)//自定义小数位数
if (this.formData.unitPrice &&!num.test(+this.formData.unitPrice)) {
this.formData.unitPrice = this.formData.unitPrice.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
}
if (this.formData.unitPrice && !littleNum.test(+this.formData.unitPrice)) {
this.formData.unitPrice = this.formData.unitPrice.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
this.formData.unitPrice = this.formData.unitPrice.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
this.formData.unitPrice = this.formData.unitPrice.replace(new RegExp(`^(.*\\..{${defu}}).*$`), "$1");//只能输入自定义个小数
}
},
goBack() {
closedDetail('/inStock/add', '/Home/inStock')
}
......
......@@ -2,7 +2,7 @@
<div class="inStockManage">
<a-form layout="inline" class="search_form">
<a-form-item label="供应商名称">
<a-select v-model="searchForm.supplierId" placeholder="请选择" style="width: 250px">
<a-select v-model="searchForm.supplierId" placeholder="请选择" style="width: 200px">
<a-select-option value="">全部</a-select-option>
<a-select-option v-for="item in allSupplyInfo" :key="item.id" :value="item.id">
{{item.supplierName}}
......@@ -10,7 +10,7 @@
</a-select>
</a-form-item>
<a-form-item label="品牌">
<a-select v-model="searchForm.brandId" placeholder="请选择" style="width: 250px">
<a-select v-model="searchForm.brandId" placeholder="请选择" style="width: 200px">
<a-select-option value="">全部</a-select-option>
<a-select-option v-for="item in brandList" :key="item.enumValue" :value="item.enumValue">
{{item.enumName}}
......@@ -18,7 +18,7 @@
</a-select>
</a-form-item>
<a-form-item label="入库日期">
<dateRangePicker :date.sync="searchForm.date"></dateRangePicker>
<dateRangePicker :date.sync="searchForm.date" style="width: 240px"></dateRangePicker>
</a-form-item>
<a-button type="primary" icon="search" class="search_btn" @click="searchList">搜索</a-button>
<a-button class="search_btn ant-table-btn" icon="sync" style="margin-left: 10px" @click="restSearchForm">清空</a-button>
......@@ -41,8 +41,8 @@
v-if="unitInfo.level==3||unitInfo.level==4"
@click="toAdd">调拨分配
</a-button>
<a-button type="primary" class="search_btn btn_space">导出Excel</a-button>
<div style="display: inline-block;line-height: 32px;background-color: #E6F7FF;cursor: pointer"
<!-- <a-button type="primary" class="search_btn btn_space">导出Excel</a-button>-->
<div style="display: inline-block;line-height: 32px;background-color: #FFF1F0;cursor: pointer"
@click="showSelectedMedical"
v-if="selectedRowKeys.length > 0"
>
......
......@@ -15,14 +15,17 @@
prop="supplierName"
:labelCol="{span: 3}"
:wrapperCol="{span: 20}">
<a-input v-model="formData.supplierName"
placeholder="请输入供应商名称"></a-input>
<a-input v-toInputNum="{num:10}"
v-model="formData.supplierName"
placeholder="请输入供应商名称,最多可输入50字"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="联系人" prop="contactsName">
<a-input v-model="formData.contactsName"
placeholder="请输入联系人"></a-input>
<a-input
v-toInputNum="{num: 15}"
v-model="formData.contactsName"
placeholder="请输入联系人,最多可输入15个字"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
......@@ -49,8 +52,10 @@
prop="address"
:labelCol="{span: 3}"
:wrapperCol="{span: 20}">
<a-input v-model="formData.address"
placeholder="请输入详细地址"></a-input>
<a-input
v-toInputNum="{num: 100}"
v-model="formData.address"
placeholder="请输入详细地址,最多可输入100个字"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
......@@ -150,6 +155,9 @@
targetOption.loading = false;
data.forEach(item => {
item['isLeaf'] = false
if (item.areaLevel >=5) {
item['isLeaf'] = true
}
})
if (targetOption.areaCode == 0) {
this.areaInfo = [...data]
......
......@@ -6,11 +6,17 @@ import Vue from 'vue'
Vue.directive('toInputNum', {
// 指令的定义
inserted: function(el, binding, vnode) {
el.addEventListener('input', function () {
let dom = null
if (el.tagName == 'INPUT') {
dom = el
} else {
dom = el.querySelector('input')
}
dom.addEventListener('input', function () {
if (binding.value) {
checkValue(el, binding.value.num)
checkValue(dom, binding.value.num)
} else {
checkValue(el, 50)
checkValue(dom, 50)
}
})
function checkValue(el, defu) {
......
import Vue from 'vue'
//input 限制输入正整数
//v-toInt
//v-toInt={maxNum: 最大值,notNum:不等于}
Vue.directive('toInt', {
// 指令的定义
inserted: function(el, binding, vnode) {
el.addEventListener("input", function() {
let dom = null
if (el.tagName == 'INPUT') {
dom = el
} else {
dom = el.querySelector('input')
}
dom.addEventListener("input", function() {
//进行验证
checkedfun(el);
if (binding.value) {
checkedfun(dom, binding.value.maxNum, binding.value.notNum)
} else {
checkedfun(dom, null, null)
}
});
function checkedfun(el) {
let reg = new RegExp("^[0-9]*$");
function checkedfun(el, maxNum, notNum) {
if (maxNum && el.value > maxNum) {
el.value = maxNum
el.dispatchEvent(new Event("input"));//调用input事件使vue v-model绑定更新
}
if (typeof (notNum) !=='undefined' && el.value === notNum.toString()) {
el.value = ''
el.dispatchEvent(new Event("input"));//调用input事件使vue v-model绑定更新
}
let reg = new RegExp("^[0-9]*$");
if (!reg.test(el.value)) {
el.value = el.value.replace(/[^0-9]+/g, "");
el.dispatchEvent(new Event("input"));//调用input事件使vue v-model绑定更新
......
import Vue from 'vue'
//input 限制输入正整数以及自定义小数位数
//v-price
//v-price="{digit:4}"
//v-price="{digit:小数位数,maxNum:最大值}"
Vue.directive('price', {
inserted: function (el, binding, vnode) {
el.addEventListener('input', function () {
let dom = null
if (el.tagName == 'INPUT') {
dom = el
} else {
dom = el.querySelector('input')
}
dom.addEventListener('input', function () {
if (binding.value) {
checkValue(el, binding.value.digit)
checkValue(dom, binding.value.digit,binding.value.maxNum)
} else {
checkValue(el, 3)
checkValue(dom, 3, null)
}
})
function checkValue(el, defu) {
function checkValue(el, defu, maxNum) {
if (maxNum && el.value > maxNum) {
el.value = maxNum
el.dispatchEvent(new Event("input"));//调用input事件使vue v-model绑定更新
}
let num = new RegExp(`(^[\\-0-9][0-9]*(.[0-9]+)?)$`) // 是否为数字
let reg = new RegExp("^[0-9]*$");//正整数
let littleNum = new RegExp(`^(0|[1-9]\\d{0,${defu}})(\\.\\d{1,${defu}})?$`)//自定义小数位数
if (el.value &&!num.test(+el.value)) {
el.value = el.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
el.dispatchEvent(new Event("input"));//调用input事件使vue v-model绑定更新
}
if (el.value && !littleNum.test(+el.value)) {
if (el.value && !littleNum.test(+el.value) && !reg.test(+el.value)) {
el.value = el.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
el.value = el.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
el.value = el.value.replace(new RegExp(`^(.*\\..{${defu}}).*$`), "$1");//只能输入自定义个小数
......@@ -27,5 +38,4 @@ Vue.directive('price', {
}
}
}
})
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