This commit is contained in:
parent
d580421cc7
commit
61dbeb0315
|
|
@ -33,6 +33,7 @@
|
|||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
<el-button type="success" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
@ -152,18 +153,22 @@
|
|||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="领料单号" prop="code">
|
||||
<el-form-item label="领料单号" prop="codeList">
|
||||
<el-select
|
||||
v-model="form.code"
|
||||
v-model="form.codeList"
|
||||
placeholder="请选择领料单号"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
:filter-method="filterCodeList"
|
||||
>
|
||||
<el-option v-for="(item, index) in codeList" :key="index" :label="item.code" :value="item.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" maxlength="999" placeholder="请输入备注" style="width: 100%" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
|
|
@ -182,11 +187,26 @@ import {getExitPermitList, addExitPermit, getCodeListApi} from '@/api/materialsS
|
|||
import chapter from "@/utils/chapter";
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import printJS from 'print-js'
|
||||
import { formatTime } from '@/utils/bonus'
|
||||
|
||||
export default {
|
||||
components: { vueEasyPrint },
|
||||
name: 'IdCardUploadComponent',
|
||||
data() {
|
||||
const validateCodeList = (rule, value, callback) => {
|
||||
if ((!value || value.length === 0) && !this.form.remark) {
|
||||
callback(new Error('领料单号和备注至少填写一个'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const validateRemark = (rule, value, callback) => {
|
||||
if (!value && (!this.form.codeList || this.form.codeList.length === 0)) {
|
||||
callback(new Error('备注和领料单号至少填写一个'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
|
|
@ -226,8 +246,10 @@ export default {
|
|||
name: '',
|
||||
material: '',
|
||||
carCode: '',
|
||||
// 默认当前时间
|
||||
addDate: '',
|
||||
code: ''
|
||||
codeList: '',
|
||||
remark: '',
|
||||
},
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
|
|
@ -240,9 +262,8 @@ export default {
|
|||
addDate: [
|
||||
{ required: true, message: "日期不能为空", trigger: "change" }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: "领料单号不能为空", trigger: "change" }
|
||||
]
|
||||
codeList: [{ validator: validateCodeList, trigger: 'change' }],
|
||||
remark: [{ validator: validateRemark, trigger: 'blur' }]
|
||||
},
|
||||
codeList: [],
|
||||
fullCodeList: [],
|
||||
|
|
@ -273,6 +294,10 @@ export default {
|
|||
handleAdd() {
|
||||
this.resetForm();
|
||||
this.open = true;
|
||||
this.form.addDate = new Date().toLocaleDateString('zh-CN')
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.clearValidate()
|
||||
})
|
||||
this.getCodeList()
|
||||
},
|
||||
|
||||
|
|
@ -297,6 +322,7 @@ export default {
|
|||
|
||||
// 提交表单
|
||||
submitForm() {
|
||||
console.log('🚀 ~ this.form:', this.form)
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.isLoading = true;
|
||||
|
|
@ -433,7 +459,16 @@ export default {
|
|||
.slice(0, 200)
|
||||
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
const currentTime = formatTime(new Date())
|
||||
|
||||
this.download(
|
||||
'/material/back_apply_info/exportExitPermitList',
|
||||
{ ...this.queryParams },
|
||||
`出门证_${currentTime}.xlsx`
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -91,6 +91,11 @@
|
|||
<el-table-column label="状态" align="center" prop="taskStatusName" :show-overflow-tooltip="true" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" width="100" prop="remark" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="是否授权" align="center" width="100" prop="remark" :show-overflow-tooltip="true">
|
||||
<template slot-scope="{ row }">
|
||||
<span>{{ row.isAuth == '0' ? '已授权' : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="300" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" style="margin-bottom: 10px" type="normal"
|
||||
|
|
@ -104,9 +109,12 @@
|
|||
v-if="scope.row.taskStatusName == '未完成'"
|
||||
@click="handleStop(scope.row)"
|
||||
>终止</el-button>
|
||||
<el-button size="mini" type="warning"
|
||||
@click="handleLld(scope.row)"
|
||||
>业务联单</el-button>
|
||||
<el-button v-if="scope.row.isAuth != '0'" size="mini" type="warning" @click="handleLld(scope.row)">
|
||||
业务联单
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.isAuth == '0'" size="mini" type="warning" @click="handleAuthorization(scope.row)">
|
||||
项目部授权委托书
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -515,6 +523,10 @@ export default {
|
|||
loading.close()
|
||||
}
|
||||
},
|
||||
handleAuthorization (row) {
|
||||
// 打开新页面
|
||||
window.open(row.fileUrl, '_blank')
|
||||
},
|
||||
// 处理时间格式 2021-09-01 转换为 2021年09月01日
|
||||
handleTimeFormat(time) {
|
||||
if (time) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue