材料站领料记录添加备注

This commit is contained in:
hongchao 2025-09-18 10:50:25 +08:00
parent 782589e2c8
commit 7c06447efa
2 changed files with 112 additions and 9 deletions

View File

@ -639,6 +639,17 @@ export const getDetailsListApi = data => {
})
}
// 领料记录添加备注
export function addRemarkApi(data) {
return request({
url: '/material/material_lease_apply_info/addRemark',
method: 'post',
data
})
}
// 总站点退料-列表
export const getBackTotalListApi = data => {
return request({

View File

@ -117,6 +117,7 @@
:key="index"
:label="column.label"
:prop="column.prop"
:show-overflow-tooltip="column.showOverflowTooltip"
align="center"
:width="column.width"
></el-table-column>
@ -132,6 +133,15 @@
@click="handleLld(row)"
>
领料单
</el-button>
<el-button
v-if="!isLeaseTimeExpired(row.leaseTime)"
type="text"
size="mini"
icon="el-icon-circle-plus-outline"
@click="handleAddRemark(row)"
>
添加备注
</el-button>
<!-- <el-button type="text" size="mini" icon="el-icon-document" style="color: #67c23a" @click="handleCheck(row)">
出库检验单
@ -389,11 +399,31 @@
<el-button @click="showView = false"> </el-button>
</div>
</el-dialog>
<!-- 备注弹窗 -->
<el-dialog :title="'添加备注'" :visible.sync="remarkDialogVisible" width="40%" @close="closeDialog">
<el-form ref="remarkForm" :model="remarkForm" label-width="80px">
<el-form-item label="备注内容" prop="remark" :rules="[{ required: true, message: '请输入备注内容', trigger: 'blur' }]">
<el-input
v-model="remarkForm.remark"
type="textarea"
:rows="4"
placeholder="请输入备注内容"
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="submitRemark">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getTotalListApi, getDetailsListApi,getPickListApi } from '@/api/materialsStation'
import { getTotalListApi, getDetailsListApi,getPickListApi, addRemarkApi } from '@/api/materialsStation'
import { getClzApplyInfo, } from '@/api/lease/apply'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -422,19 +452,25 @@ export default {
total: 0, //
//
tableColumns: [
{ label: '分公司', prop: 'impUnitName' },
{ label: '领料单位', prop: 'leaseUnit' },
{ label: '领料工程', prop: 'leaseProject' },
{ label: '物资名称', prop: 'maTypeNames' },
{ label: '领料人', prop: 'leasePerson', width: '90' },
{ label: '领料时间', prop: 'leaseTime', width: '100' },
{ label: '领料单号', prop: 'code' }
{ label: '分公司', prop: 'impUnitName',showOverflowTooltip: false },
{ label: '领料单位', prop: 'leaseUnit' ,showOverflowTooltip: false},
{ label: '领料工程', prop: 'leaseProject' ,showOverflowTooltip: false},
{ label: '物资名称', prop: 'maTypeNames' ,showOverflowTooltip: false},
{ label: '领料人', prop: 'leasePerson', width: '90' ,showOverflowTooltip: false},
{ label: '领料时间', prop: 'leaseTime', width: '100',showOverflowTooltisp: false },
{ label: '领料单号', prop: 'code',showOverflowTooltip: false },
{ label: '备注', prop: 'remark',width: '80' ,showOverflowTooltip: true},
],
//
tableList: [],
dlgTotal: 0, //
dialogTitle: '查看',
dialogVisible: false,
remarkDialogVisible: false, //
remarkForm: { //
remark: ''
},
currentRemarkRow: null, //
dialogForm: {
pageNum: 1,
pageSize: 10,
@ -558,6 +594,62 @@ export default {
}, 100)
},
// 72
isLeaseTimeExpired(leaseTime) {
if (!leaseTime) return true; //
const now = new Date();
const leaseDate = new Date(leaseTime);
const hoursDiff = (now - leaseDate) / (1000 * 60 * 60);
return hoursDiff > 72;
},
//
handleAddRemark(row) {
console.log('添加备注', row)
this.currentRemarkRow = row
this.remarkForm = {
remark: row.remark || ''
}
this.remarkDialogVisible = true
},
//
closeDialog() {
this.remarkDialogVisible = false
this.remarkForm = {
remark: ''
}
this.$refs.remarkForm.resetFields()
},
//
async submitRemark() {
this.$refs.remarkForm.validate(async (valid) => {
if (valid) {
const loading = this.$loading({ text: '提交中...' })
try {
const params = {
id: this.currentRemarkRow.id,
remark: this.remarkForm.remark,
publishTask: this.currentRemarkRow.publishTask? this.currentRemarkRow.publishTask : null
}
const res = await addRemarkApi(params)
if (res.code === 200) {
this.$message.success('备注添加成功')
this.remarkDialogVisible = false
this.getList()
}
} catch (error) {
console.log('添加备注失败', error)
// this.$message.error('')
} finally {
loading.close()
}
}
})
},
//
async handleLld(row) {
this.title = '领料单'