编辑/详情 页面样式 dialogTitle

pull/3/head
qiuhongwu 9 months ago
parent 4bdeaf65ba
commit 75874a7533

@ -27,8 +27,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="whId" label="盘点仓库" required> <el-form-item prop="whId" label="盘点仓库" required>
<el-select v-model="formData.whId" placeholder="下拉选择" clearable disabled class="!w-400px" <el-select v-model="formData.whId" placeholder="下拉选择" clearable disabled class="!w-400px" @change="handleWh">
@change="handleWh">
<el-option v-for="dict in whList" :key="dict.id" :label="dict.wh_name" :value="dict.id" /> <el-option v-for="dict in whList" :key="dict.id" :label="dict.wh_name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -40,8 +39,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="status" label="单据状态"> <el-form-item prop="status" label="单据状态">
<el-select v-model="formData.status" placeholder="下拉选择" clearable class="!w-400px" disabled> <el-select v-model="formData.status" placeholder="下拉选择" clearable class="!w-400px" disabled>
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_MAT_CHECK_STATUS)" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_MAT_CHECK_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" />
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -50,8 +48,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="checkType" label="盘点类型"> <el-form-item prop="checkType" label="盘点类型">
<el-select v-model="formData.checkType" clearable class="!w-400px" disabled> <el-select v-model="formData.checkType" clearable class="!w-400px" disabled>
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_MAT_CHECK_TYPE)" :key="dict.value" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_MAT_CHECK_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
:label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -62,8 +59,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="排除库存为0的物料?" prop="noZero"> <el-form-item label="排除库存为0的物料?" prop="noZero">
<el-radio-group v-model="formData.noZero" disabled> <el-radio-group v-model="formData.noZero" disabled>
<el-radio v-for="dict in getIntDictOptions(DICT_TYPE.HELI_COMMON_IS_OR_NOT)" :key="dict.value" <el-radio v-for="dict in getIntDictOptions(DICT_TYPE.HELI_COMMON_IS_OR_NOT)" :key="dict.value" :label="dict.value">
:label="dict.value">
{{ dict.label }} {{ dict.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
@ -73,15 +69,14 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="盘点开始日期" prop="checkTime"> <el-form-item label="盘点开始日期" prop="checkTime">
<el-date-picker v-model="formData.checkTime" value-format="x" placeholder="盘点开始时间" <el-date-picker v-model="formData.checkTime" value-format="x" placeholder="盘点开始时间" class="!w-220px" disabled />
class="!w-220px" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="20"> <el-col :span="16">
<el-form-item label="备注" prop="description"> <el-form-item label="备注" prop="description">
<el-input type="textarea" v-model="formData.description" show-word-limit maxlength="200" disabled /> <el-input type="textarea" v-model="formData.description" show-word-limit maxlength="200" disabled />
</el-form-item> </el-form-item>
@ -99,8 +94,7 @@
<el-col> <el-col>
<el-button class="hl-addbutton" type="primary" size="large" v-bind:disabled="ctrView || ctrSave" @click="openMatForm"></el-button> <el-button class="hl-addbutton" type="primary" size="large" v-bind:disabled="ctrView || ctrSave" @click="openMatForm"></el-button>
</el-col> </el-col>
<el-form ref="matSubFormRef" :model="formData.matItemDOList" :rules="subFormRules" <el-form ref="matSubFormRef" :model="formData.matItemDOList" :rules="subFormRules" v-loading="subFormLoading" label-width="0">
v-loading="subFormLoading" label-width="0">
<el-table :data="formData.matItemDOList" class="hl-table"> <el-table :data="formData.matItemDOList" class="hl-table">
<el-table-column prop="cid" label="序号" :width="80" /> <el-table-column prop="cid" label="序号" :width="80" />
<el-table-column prop="matCode" label="物料编码" min-width="120" align="center" /> <el-table-column prop="matCode" label="物料编码" min-width="120" align="center" />
@ -109,7 +103,7 @@
<el-table-column prop="shortName" label="物料简称" min-width="120" align="center" /> <el-table-column prop="shortName" label="物料简称" min-width="120" align="center" />
<el-table-column prop="matSpec" label="规格/型号" min-width="120" align="center" /> <el-table-column prop="matSpec" label="规格/型号" min-width="120" align="center" />
<el-table-column prop="matBrand" label="品牌" min-width="120" align="center" /> <el-table-column prop="matBrand" label="品牌" min-width="120" align="center" />
<el-table-column prop="rgId" min-width="120" align="center"> <el-table-column prop="rgId" min-width="140" align="center">
<template #header> <span class="hl-table_header">*</span>库区 </template> <template #header> <span class="hl-table_header">*</span>库区 </template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.rgId`" :rules="subFormRules.rgId" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.rgId`" :rules="subFormRules.rgId" class="mb-0px!">
@ -119,13 +113,12 @@
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="pnId" min-width="140" align="center"> <el-table-column prop="pnId" min-width="180" align="center">
<template #header> <span class="hl-table_header">*</span>库位 </template> <template #header> <span class="hl-table_header">*</span>库位 </template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.pnId`" :rules="subFormRules.pnId" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.pnId`" :rules="subFormRules.pnId" class="mb-0px!">
<el-select v-model="scope.row.pnId" placeholder="" style="width: 100%" @change="(val)=>handlePn(val,scope)" v-bind:disabled="ctrView || ctrSave"> <el-select v-model="scope.row.pnId" placeholder="" style="width: 100%" @change="(val)=>handlePn(val,scope)" v-bind:disabled="ctrView || ctrSave">
<el-option v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name" <el-option v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name" :value="dict.id" />
:value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
@ -134,18 +127,29 @@
<el-table-column prop="storageOkQty" min-width="120" align="center"> <el-table-column prop="storageOkQty" min-width="120" align="center">
<template #header> <span class="hl-table_header">*</span>盘点数量</template> <template #header> <span class="hl-table_header">*</span>盘点数量</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.storageOkQty`" :rules="subFormRules.storageOkQty" <el-form-item :prop="`${scope.$index}.storageOkQty`" :rules="subFormRules.storageOkQty" class="mb-0px!">
class="mb-0px!">
<el-input v-model="scope.row.storageOkQty" @change="(val)=>handleSub(val,scope)" v-bind:disabled="ctrView || ctrSave" /> <el-input v-model="scope.row.storageOkQty" @change="(val)=>handleSub(val,scope)" v-bind:disabled="ctrView || ctrSave" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="matSub" label="盈亏差异" min-width="120" align="center" /> <el-table-column prop="matSub" label="盈亏差异" min-width="120" align="center">
<template #default="scope">
<div v-if="scope.row.matSub<0" style="color:#EC808D;">
{{scope.row.matSub}}
</div>
<span v-else-if="scope.row.matSub>0" style="color:#63A103;">
+{{scope.row.matSub}}
</span>
<span v-else>
{{scope.row.matSub}}
</span>
</template>
</el-table-column>
<el-table-column prop="matUnit" label="库存单位" min-width="120" align="center" /> <el-table-column prop="matUnit" label="库存单位" min-width="120" align="center" />
<el-table-column label="操作" align="center" width="240"> <el-table-column label="操作" align="center" width="240">
<template #default="scope"> <template #default="scope">
<el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)" v-bind:disabled="ctrView || ctrDelete" <el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)" v-bind:disabled="ctrView || ctrDelete" v-if="scope.row.isCopy==1">
v-if="scope.row.isCopy==1">
删除 删除
</el-button> </el-button>
<el-button link type="primary" v-if="scope.row.isCopy==0" @click="handleCopy(scope.$index, scope.row)" v-bind:disabled="ctrView || ctrDelete"></el-button> <el-button link type="primary" v-if="scope.row.isCopy==0" @click="handleCopy(scope.$index, scope.row)" v-bind:disabled="ctrView || ctrDelete"></el-button>
@ -166,18 +170,16 @@
<el-col> <el-col>
<el-card class="hl-incard"> <el-card class="hl-incard">
<el-col> <el-col>
<el-upload ref="matUploadRef" :file-list="matUploadFiles" multiple :limit="10" :action="uploadUrl" <el-upload ref="matUploadRef" :file-list="matUploadFiles" multiple :limit="10" :action="uploadUrl" :headers="{
:headers="{
Authorization: 'Bearer ' + getAccessToken(), Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId() 'tenant-id': getTenantId()
}" name="files" :show-file-list="false" :auto-upload="false" :data="matUploadData" }" name="files" :show-file-list="false" :auto-upload="false" :data="matUploadData" :on-change="matUploadChange" class="upload-file-uploader">
:on-change="matUploadChange" class="upload-file-uploader">
<el-button type="primary" v-bind:disabled="ctrView || ctrSave"> <el-button type="primary" v-bind:disabled="ctrView || ctrSave">
<Icon icon="ep:upload-filled" />上传 <Icon icon="ep:upload-filled" />上传
</el-button> </el-button>
</el-upload> </el-upload>
</el-col> </el-col>
<el-table :data="formData.attachments" class="hl-table"> <el-table :data="formData.attachments" class="hl-table" style="margin-top: 10px">
<el-table-column prop="name" label="文件名称" align="center"> <el-table-column prop="name" label="文件名称" align="center">
<!-- <template #default="scope"> <!-- <template #default="scope">
<a :href="scope.row.url" target="_blank" style="color: #409eff">{{ scope.row.name }} </a> <a :href="scope.row.url" target="_blank" style="color: #409eff">{{ scope.row.name }} </a>
@ -188,12 +190,10 @@
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button link type="danger" size="small" <el-button link type="danger" size="small" @click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)" v-bind:disabled="ctrView || ctrDelete">
@click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)" v-bind:disabled="ctrView || ctrDelete">
删除 删除
</el-button> </el-button>
<el-button link type="primary" size="small" <el-button link type="primary" size="small" @click="downloadAttachment(scope.row.name, scope.row.url)" v-bind:disabled="ctrView || ctrDelete">
@click="downloadAttachment(scope.row.name, scope.row.url)" v-bind:disabled="ctrView || ctrDelete">
下载 下载
</el-button> </el-button>
</template> </template>
@ -350,8 +350,12 @@ const handleStatus = async (num) => {
// //
try { try {
var isRepeat = false var isRepeat = false
formData.value.matItemDOList.forEach(item=>{ formData.value.matItemDOList.forEach((item) => {
if(formData.value.matItemDOList.filter(mat =>mat.matId == item.matId && mat.pnId == item.pnId).length>1){ if (
formData.value.matItemDOList.filter(
(mat) => mat.matId == item.matId && mat.pnId == item.pnId
).length > 1
) {
isRepeat = true isRepeat = true
} }
}) })
@ -376,13 +380,20 @@ const handleStatus = async (num) => {
} }
const getList = async (arrMat) => { const getList = async (arrMat) => {
arrMat.forEach((row) => {
arrMat.forEach(row => {
row.cid = matCount row.cid = matCount
if(formData.value.matItemDOList.filter(item =>item.matId == row.id && item.whId==row.whId && item.rgId == row.rgId && item.pnId== row.pnId).length==0){ if (
formData.value.matItemDOList.filter(
(item) =>
item.matId == row.id &&
item.whId == row.whId &&
item.rgId == row.rgId &&
item.pnId == row.pnId
).length == 0
) {
row.matId = row.id row.matId = row.id
row.pnlist = ref([]) row.pnlist = ref([])
row.pnlist = pnList.value.filter(pn => pn.rg_id == row.rgId) row.pnlist = pnList.value.filter((pn) => pn.rg_id == row.rgId)
if (row.pnlist.length == 0) { if (row.pnlist.length == 0) {
row.rgId = '' row.rgId = ''
row.pnId = '' row.pnId = ''
@ -391,7 +402,7 @@ const getList = async (arrMat) => {
formData.value.matItemDOList.push(row) formData.value.matItemDOList.push(row)
matCount = matCount + 1 matCount = matCount + 1
} }
}); })
//formData.value.matItemDOList = arrMat //formData.value.matItemDOList = arrMat
} }
// //
@ -467,11 +478,9 @@ const downloadAttachment = async (name, url) => {
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const saveFormData = async () => { const saveFormData = async () => {
// //
formLoading.value = true formLoading.value = true
try { try {
const data = formData.value as unknown as CheckApi.StorageCheckVO const data = formData.value as unknown as CheckApi.StorageCheckVO
await CheckApi.updateStorageCheck(data) await CheckApi.updateStorageCheck(data)
// //
@ -506,8 +515,12 @@ const submitForm = async () => {
// //
try { try {
var isRepeat = false var isRepeat = false
formData.value.matItemDOList.forEach(item=>{ formData.value.matItemDOList.forEach((item) => {
if(formData.value.matItemDOList.filter(mat =>mat.matId == item.matId && mat.pnId == item.pnId).length>1){ if (
formData.value.matItemDOList.filter(
(mat) => mat.matId == item.matId && mat.pnId == item.pnId
).length > 1
) {
isRepeat = true isRepeat = true
} }
}) })
@ -534,7 +547,7 @@ var matCount = 1
const handleDelete2 = (index: number) => { const handleDelete2 = (index: number) => {
var itemDelteing = formData.value.matItemDOList[index] var itemDelteing = formData.value.matItemDOList[index]
if (itemDelteing.isCopy == 0) { if (itemDelteing.isCopy == 0) {
message.alertWarning("原始物料不能删除") message.alertWarning('原始物料不能删除')
} else { } else {
formData.value.matItemDOList.splice(index, 1) formData.value.matItemDOList.splice(index, 1)
} }
@ -550,12 +563,20 @@ var pnList = ref([])
const handleRg = async (rgid, scope) => { const handleRg = async (rgid, scope) => {
//------------------- //-------------------
scope.row.pnId = '' scope.row.pnId = ''
scope.row.pnlist = pnList.value.filter(pn => pn.rg_id === rgid) scope.row.pnlist = pnList.value.filter((pn) => pn.rg_id === rgid)
//------------------- //-------------------
} }
const handlePn = async (pnid, scope) => { const handlePn = async (pnid, scope) => {
//------------------- //-------------------
if(formData.value.matItemDOList.filter(item =>item.id == scope.row.id && item.whId==scope.row.whId && item.rgId == scope.row.rgId && item.pnId== pnid).length>1){ if (
formData.value.matItemDOList.filter(
(item) =>
item.id == scope.row.id &&
item.whId == scope.row.whId &&
item.rgId == scope.row.rgId &&
item.pnId == pnid
).length > 1
) {
scope.row.matRest = 0 scope.row.matRest = 0
message.alertWarning('物料编码' + scope.row.matCode + ',当前库位已存在,请修改,避免重复盘点') message.alertWarning('物料编码' + scope.row.matCode + ',当前库位已存在,请修改,避免重复盘点')
@ -563,29 +584,35 @@ const handlePn = async (pnid,scope) => {
} }
var currentMatRest = await CheckApi.getStorageNowMatRest(scope.row.id, scope.row.pnId) var currentMatRest = await CheckApi.getStorageNowMatRest(scope.row.id, scope.row.pnId)
scope.row.matRest = currentMatRest scope.row.matRest = currentMatRest
if(scope.row.storageOkQty == undefined || scope.row.storageOkQty == '') {scope.row.matSub =0}else{ scope.row.matSub = scope.row.storageOkQty-scope.row.matRest} if (scope.row.storageOkQty == undefined || scope.row.storageOkQty == '') {
scope.row.matSub = 0
} else {
scope.row.matSub = scope.row.storageOkQty - scope.row.matRest
}
//------------------- //-------------------
} }
const handleSub = async (pNum, scope) => { const handleSub = async (pNum, scope) => {
//------------------- //-------------------
scope.row.matSub = Number(pNum) - Number(scope.row.matRest) scope.row.matSub = Number(pNum) - Number(scope.row.matRest)
console.log(typeof scope.row.matSub)
//----------------- //-----------------
} }
// //
const init_page_wh = (async ()=>{ const init_page_wh = async () => {
whList.value = await WhApi.getSimpList() whList.value = await WhApi.getSimpList()
}) }
// //
const init_page_rg = (async ()=>{ const init_page_rg = async () => {
var rgData = await RgApi.getSimpList() var rgData = await RgApi.getSimpList()
rgList.value = rgData.filter(item =>item.wh_id== formData.value.whId) rgList.value = rgData.filter((item) => item.wh_id == formData.value.whId)
}) }
// //
const init_page_pn = (async ()=>{ const init_page_pn = async () => {
var pnData = await PnApi.getSimpList() var pnData = await PnApi.getSimpList()
pnList.value = pnData.filter(item =>item.wh_id== formData.value.whId) pnList.value = pnData.filter((item) => item.wh_id == formData.value.whId)
}) }
// //
const ctrView = ref(false) const ctrView = ref(false)
const ctrSave = ref(false) const ctrSave = ref(false)
@ -638,7 +665,7 @@ const initStatus = async (status) =>{
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
dialogTitle.value = query.type === 'update' ? '编辑页' : '详情页'
formData.value = await CheckApi.getStorageCheck(query.id) formData.value = await CheckApi.getStorageCheck(query.id)
@ -652,12 +679,14 @@ onMounted(async () => {
const dataCheckMats = await CheckMatApi.getStorageCheckListByCheckID(query.id) const dataCheckMats = await CheckMatApi.getStorageCheckListByCheckID(query.id)
formData.value.matItemDOList = dataCheckMats formData.value.matItemDOList = dataCheckMats
if(formData.value.matItemDOList==undefined){formData.value.matItemDOList=[]} if (formData.value.matItemDOList == undefined) {
formData.value.matItemDOList = []
}
const dataMatSimples = await MatApi.getSimpList() const dataMatSimples = await MatApi.getSimpList()
formData.value.matItemDOList.forEach(item =>{ formData.value.matItemDOList.forEach((item) => {
var matFind = dataMatSimples.find( simp=> simp.id == item.matId) var matFind = dataMatSimples.find((simp) => simp.id == item.matId)
item.cid = matCount item.cid = matCount
item.isCopy = 0 item.isCopy = 0
item.matName = matFind?.name item.matName = matFind?.name
@ -668,13 +697,11 @@ onMounted(async () => {
item.matBrand = matFind?.brand item.matBrand = matFind?.brand
item.shortName = matFind?.short_name item.shortName = matFind?.short_name
item.matSub = item.storageOkQty - item.matRest item.matSub = item.storageOkQty - item.matRest
item.pnlist = pnList.value.filter( pn=> pn.rg_id == item.rgId) item.pnlist = pnList.value.filter((pn) => pn.rg_id == item.rgId)
matCount = matCount + 1 matCount = matCount + 1
}) })
// //
let attParams = { let attParams = {
pageNo: 1, pageNo: 1,

Loading…
Cancel
Save