材料站领料记录添加备注
This commit is contained in:
parent
782589e2c8
commit
7c06447efa
|
|
@ -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 => {
|
export const getBackTotalListApi = data => {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="column.label"
|
:label="column.label"
|
||||||
:prop="column.prop"
|
:prop="column.prop"
|
||||||
|
:show-overflow-tooltip="column.showOverflowTooltip"
|
||||||
align="center"
|
align="center"
|
||||||
:width="column.width"
|
:width="column.width"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
|
|
@ -132,6 +133,15 @@
|
||||||
@click="handleLld(row)"
|
@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>
|
||||||
<!-- <el-button type="text" size="mini" icon="el-icon-document" style="color: #67c23a" @click="handleCheck(row)">
|
<!-- <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>
|
<el-button @click="showView = false">关 闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getTotalListApi, getDetailsListApi,getPickListApi } from '@/api/materialsStation'
|
import { getTotalListApi, getDetailsListApi,getPickListApi, addRemarkApi } from '@/api/materialsStation'
|
||||||
import { getClzApplyInfo, } from '@/api/lease/apply'
|
import { getClzApplyInfo, } from '@/api/lease/apply'
|
||||||
import Treeselect from '@riophae/vue-treeselect'
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
|
@ -422,19 +452,25 @@ export default {
|
||||||
total: 0, // 总条数
|
total: 0, // 总条数
|
||||||
// 表头
|
// 表头
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ label: '分公司', prop: 'impUnitName' },
|
{ label: '分公司', prop: 'impUnitName',showOverflowTooltip: false },
|
||||||
{ label: '领料单位', prop: 'leaseUnit' },
|
{ label: '领料单位', prop: 'leaseUnit' ,showOverflowTooltip: false},
|
||||||
{ label: '领料工程', prop: 'leaseProject' },
|
{ label: '领料工程', prop: 'leaseProject' ,showOverflowTooltip: false},
|
||||||
{ label: '物资名称', prop: 'maTypeNames' },
|
{ label: '物资名称', prop: 'maTypeNames' ,showOverflowTooltip: false},
|
||||||
{ label: '领料人', prop: 'leasePerson', width: '90' },
|
{ label: '领料人', prop: 'leasePerson', width: '90' ,showOverflowTooltip: false},
|
||||||
{ label: '领料时间', prop: 'leaseTime', width: '100' },
|
{ label: '领料时间', prop: 'leaseTime', width: '100',showOverflowTooltisp: false },
|
||||||
{ label: '领料单号', prop: 'code' }
|
{ label: '领料单号', prop: 'code',showOverflowTooltip: false },
|
||||||
|
{ label: '备注', prop: 'remark',width: '80' ,showOverflowTooltip: true},
|
||||||
],
|
],
|
||||||
// 表格数据
|
// 表格数据
|
||||||
tableList: [],
|
tableList: [],
|
||||||
dlgTotal: 0, // 弹框总条数
|
dlgTotal: 0, // 弹框总条数
|
||||||
dialogTitle: '查看',
|
dialogTitle: '查看',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
remarkDialogVisible: false, // 备注弹窗显示状态
|
||||||
|
remarkForm: { // 备注表单
|
||||||
|
remark: ''
|
||||||
|
},
|
||||||
|
currentRemarkRow: null, // 当前操作的行数据
|
||||||
dialogForm: {
|
dialogForm: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
@ -558,6 +594,62 @@ export default {
|
||||||
}, 100)
|
}, 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) {
|
async handleLld(row) {
|
||||||
this.title = '领料单'
|
this.title = '领料单'
|
||||||
|
|
@ -639,4 +731,4 @@ export default {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue