dev
This commit is contained in:
parent
e1ead5394f
commit
570a0962f8
|
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="edit-panel" v-loading="isLoading" element-loading-text="正在保存......">
|
<div class="edit-panel" v-loading="isLoading" element-loading-text="正在保存......">
|
||||||
|
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<el-form :model="inventory_order_data" :rules="formRules" ref="orderForm">
|
<el-form :model="inventory_order_data" :rules="formRules" ref="orderForm">
|
||||||
<el-descriptions title="采购订单" border>
|
<el-descriptions title="采购订单" border>
|
||||||
|
|
@ -149,6 +148,7 @@ import Mask from "@/components/common/Mask.vue";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import GoodsSearch from "@/components/inventory/GoodsSearch.vue";
|
import GoodsSearch from "@/components/inventory/GoodsSearch.vue";
|
||||||
import CloseBtn from "@/components/CloseBtn.vue";
|
import CloseBtn from "@/components/CloseBtn.vue";
|
||||||
|
|
||||||
const orderForm = ref()
|
const orderForm = ref()
|
||||||
const formRules = ref({
|
const formRules = ref({
|
||||||
shippingCode: [{required: true, message: '请输入货单号', trigger: 'blur'}],
|
shippingCode: [{required: true, message: '请输入货单号', trigger: 'blur'}],
|
||||||
|
|
@ -171,20 +171,22 @@ let inventory_order_data = ref({
|
||||||
const checkProductionDate = (row: any) => {
|
const checkProductionDate = (row: any) => {
|
||||||
if (!row.productionDate) {
|
if (!row.productionDate) {
|
||||||
ElMessage.error('生产日期不能为空');
|
ElMessage.error('生产日期不能为空');
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
const productionDate = new Date(row.productionDate);
|
const productionDate = new Date(row.productionDate);
|
||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
if (productionDate > currentDate) {
|
if (productionDate > currentDate) {
|
||||||
ElMessage.error('生产日期不能晚于当前日期');
|
ElMessage.error('生产日期不能晚于当前日期');
|
||||||
row.productionDate = null; // 清空无效的生产日期
|
row.productionDate = null; // 清空无效的生产日期
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkExpiryDate = (row: any) => {
|
const checkExpiryDate = (row: any) => {
|
||||||
if (!row.expiryDate) {
|
if (!row.expiryDate) {
|
||||||
ElMessage.error('有效期不能为空');
|
ElMessage.error('有效期不能为空');
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
const productionDate = new Date(row.productionDate);
|
const productionDate = new Date(row.productionDate);
|
||||||
const expiryDate = new Date(row.expiryDate);
|
const expiryDate = new Date(row.expiryDate);
|
||||||
|
|
@ -193,10 +195,13 @@ const checkExpiryDate = (row: any) => {
|
||||||
if (expiryDate <= currentDate) {
|
if (expiryDate <= currentDate) {
|
||||||
ElMessage.error('有效期不能早于当前日期');
|
ElMessage.error('有效期不能早于当前日期');
|
||||||
row.expiryDate = null; // 清空无效的有效期
|
row.expiryDate = null; // 清空无效的有效期
|
||||||
|
return false;
|
||||||
} else if (expiryDate <= productionDate) {
|
} else if (expiryDate <= productionDate) {
|
||||||
ElMessage.error('有效期必须晚于生产日期');
|
ElMessage.error('有效期必须晚于生产日期');
|
||||||
row.expiryDate = null; // 清空无效的有效期
|
row.expiryDate = null; // 清空无效的有效期
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
|
|
@ -239,19 +244,22 @@ let confirm = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查每个药品的有效期
|
// 检查每个药品的有效期
|
||||||
table_list.value.forEach((item: any) => {
|
for (let i = 0; i < table_list.value.length; i++) {
|
||||||
checkProductionDate(item)
|
if (!checkProductionDate(table_list.value[i])) {
|
||||||
checkExpiryDate(item);
|
return
|
||||||
});
|
}
|
||||||
|
if (!checkExpiryDate(table_list.value[i])) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
let data = {
|
let data = {
|
||||||
inventoryOrder: JSON.parse(JSON.stringify(inventory_order_data.value)),
|
inventoryOrder: JSON.parse(JSON.stringify(inventory_order_data.value)),
|
||||||
inventoryOrderGoodsList: JSON.parse(JSON.stringify(table_list.value))
|
inventoryOrderGoodsList: JSON.parse(JSON.stringify(table_list.value))
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = true
|
|
||||||
post("inventory/order/create", data).then((res: any) => {
|
post("inventory/order/create", data).then((res: any) => {
|
||||||
exit()
|
exit()
|
||||||
|
isLoading.value = true
|
||||||
})
|
})
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -375,6 +383,7 @@ onMounted(() => {
|
||||||
right: 10px;
|
right: 10px;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
background-color: #F00;
|
background-color: #F00;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,69 +9,56 @@
|
||||||
show-word-limit
|
show-word-limit
|
||||||
:autosize="{ minRows: 8, maxRows: 20 }"
|
:autosize="{ minRows: 8, maxRows: 20 }"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@input="parsing"
|
|
||||||
/>
|
/>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-button type="primary" @click="save">保存</el-button>
|
<el-button type="primary" @click="save">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-descriptions title="解析后的数据" size="small" :column="2" border v-if="flag">
|
<el-descriptions title="解析后的数据" size="small" :column="2" border>
|
||||||
<el-descriptions-item
|
<!-- <el-descriptions-item-->
|
||||||
align="center"
|
<!-- align="center"-->
|
||||||
label="定点机构编码"
|
<!-- label="定点机构编码"-->
|
||||||
:span="2"
|
<!-- :span="2"-->
|
||||||
>
|
<!-- >-->
|
||||||
{{ decryptedText.fixmedinsCode }}
|
<!-- {{ decryptedText.fixmedinsCode }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item
|
<el-descriptions-item
|
||||||
align="center"
|
align="center"
|
||||||
label="证书创建时间"
|
label="证书创建时间"
|
||||||
>
|
>
|
||||||
{{ decryptedText.createDate }}
|
{{ formatDate(decryptedText.createDate) }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item
|
<el-descriptions-item
|
||||||
align="center"
|
align="center"
|
||||||
label="证书过期时间"
|
label="证书过期时间"
|
||||||
>
|
>
|
||||||
{{ decryptedText.expiryDate }}
|
{{ formatDate(decryptedText.expiryDate) }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import {onMounted, onUnmounted, ref} from "vue";
|
import {onMounted, ref} from "vue";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
|
import {formatDate} from "@/utils/dateUtils.ts";
|
||||||
|
|
||||||
const decryptedText = ref<any>({})
|
const decryptedText = ref<any>({})
|
||||||
const ciphertext = ref<string>('')
|
const ciphertext = ref<any>('')
|
||||||
const flag = ref<any>(false)
|
|
||||||
|
|
||||||
const parsing = () => {
|
|
||||||
if (ciphertext.value) {
|
|
||||||
post("common/config/parsing", {ciphertext: ciphertext.value}).then((res: any) => {
|
|
||||||
decryptedText.value = res;
|
|
||||||
flag.value = true;
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
flag.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
if (ciphertext.value) {
|
if (ciphertext.value) {
|
||||||
post("common/config/setcert", {encryptedText: ciphertext.value}).then((res: any) => {
|
post("common/auth/set", {ciphertext: ciphertext.value}).then(() => {
|
||||||
ElMessage.success("保存成功")
|
ElMessage.success("保存成功")
|
||||||
|
init()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const get = () => {
|
const init = async () => {
|
||||||
|
ciphertext.value=await post("common/auth/get");
|
||||||
|
decryptedText.value=await post("common/auth/check");
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
post("common/config/get", {key: 'common_cert'}).then((res: any) => {
|
await init()
|
||||||
ciphertext.value = res.val;
|
|
||||||
parsing()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ const showAuth = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Mask :is-show="isShowAuth" @close="isShowAuth=false" :width="600" :height="600" title="授权">
|
<Mask :is-show="isShowAuth" @close="isShowAuth=false" :width="600" :height="450" title="授权">
|
||||||
<Auth></Auth>
|
<Auth></Auth>
|
||||||
</Mask>
|
</Mask>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Mask :width="1200" :height="500" :is-show="showAdd" :top="100" @close="showAdd = false">
|
<Mask :width="1200" :height="500" :is-show="showAdd" :top="100" @close="showAdd = false">
|
||||||
<Add @close="showAdd = false"/>
|
<Add @close="showAdd = false;getCheck()"/>
|
||||||
</Mask>
|
</Mask>
|
||||||
<Mask :width="1200" :height="500" :is-show="showDetail" :top="100" @close="showDetail = false">
|
<Mask :width="1200" :height="500" :is-show="showDetail" :top="100" @close="showDetail = false">
|
||||||
<Detail :id="id" @close="showDetail = false"/>
|
<Detail :id="id" @close="showDetail = false;getCheck()"/>
|
||||||
</Mask>
|
</Mask>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Mask :width="1200" :height="700" :top="100" :is-show="is_add" @close="is_add=false" :title="open_code?'编辑':'新增'">
|
<Mask :width="1200" :top="100" :is-show="is_add" @close="is_add=false"
|
||||||
|
:title="open_code?'编辑':'新增'">
|
||||||
<AddOrder v-if="!open_code" @close="closeAddOrder"/>
|
<AddOrder v-if="!open_code" @close="closeAddOrder"/>
|
||||||
<EditOrder v-else :code="open_code" @close="is_add=false" @updateOrderDetail="init"/>
|
<EditOrder v-else :code="open_code" @close="is_add=false" @updateOrderDetail="init"/>
|
||||||
</Mask>
|
</Mask>
|
||||||
|
|
@ -70,8 +71,12 @@ onMounted(() => {
|
||||||
init()
|
init()
|
||||||
})
|
})
|
||||||
let open_add = (row: any) => {
|
let open_add = (row: any) => {
|
||||||
open_code.value = row.code
|
|
||||||
is_add.value = true
|
is_add.value = true
|
||||||
|
if (row!=null) {
|
||||||
|
open_code.value = row.code
|
||||||
|
}else{
|
||||||
|
open_code.value = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -112,6 +117,7 @@ const formatDate = (isoStr: any) => {
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@use "@/assets/scss/base.scss";
|
@use "@/assets/scss/base.scss";
|
||||||
|
|
||||||
.container-wrapper {
|
.container-wrapper {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
|
|
@ -119,12 +125,14 @@ const formatDate = (isoStr: any) => {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.content_list {
|
.content_list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-top: base.$margin-base;
|
margin-top: base.$margin-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
|
|
@ -138,6 +146,7 @@ const formatDate = (isoStr: any) => {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.full_screen {
|
.full_screen {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue