fix:退料申请bug修改
This commit is contained in:
parent
0d457afa9d
commit
0da44483df
|
|
@ -12,35 +12,25 @@
|
|||
<el-form-item label="退料单位" prop="unitId">
|
||||
<el-select
|
||||
v-model="queryParams.unitId"
|
||||
clearable filterable
|
||||
clearable
|
||||
filterable
|
||||
@change="GetProData"
|
||||
style="width: 240px"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in unitList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="退料工程" prop="proId">
|
||||
<el-select
|
||||
v-model="queryParams.proId"
|
||||
clearable filterable
|
||||
clearable
|
||||
filterable
|
||||
@change="GetUnitData"
|
||||
style="width: 240px"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in proList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
<el-option v-for="item in proList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="协议号" prop="agreementCode">
|
||||
|
|
@ -71,14 +61,14 @@
|
|||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="退料人电话" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入退料人电话"
|
||||
clearable maxlength="11"
|
||||
clearable
|
||||
maxlength="11"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -94,29 +84,15 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row> </el-row>
|
||||
<el-row></el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-back"
|
||||
size="mini"
|
||||
@click="handleBack"
|
||||
>退料管理</el-button
|
||||
>
|
||||
<el-button type="success" plain icon="el-icon-back" size="mini" @click="handleBack">退料管理</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">保存</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
|
|
@ -127,12 +103,9 @@
|
|||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:role:export']"
|
||||
>导出</el-button> -->
|
||||
>导出</el-button>-->
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
|
|
@ -140,52 +113,27 @@
|
|||
:data="leaseApplyDetails"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" :selectable="selectable"/>
|
||||
<el-table-column type="selection" min-width="55" align="center" :selectable="selectable" />
|
||||
<el-table-column label="序号" type="index" min-width="120" />
|
||||
<el-table-column
|
||||
label="类型名称"
|
||||
prop="typeName"
|
||||
min-width="200"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
prop="typeCode"
|
||||
min-width="200"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="类型名称" prop="typeName" min-width="200" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="规格型号" prop="typeCode" min-width="200" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="计量单位" prop="unitNames" min-width="100" />
|
||||
|
||||
<el-table-column
|
||||
label="当前在用量"
|
||||
align="center"
|
||||
prop="useNum"
|
||||
min-width="180"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="退料数量"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
min-width="180"
|
||||
>
|
||||
<el-table-column label="当前在用量" align="center" prop="num" min-width="180"></el-table-column>
|
||||
<el-table-column label="退料数量" align="center" prop="createTime" min-width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model.number="scope.row.num"
|
||||
placeholder="请输入退料数量"
|
||||
type="number"
|
||||
min="1"
|
||||
clearable @input="checkNum(scope.row)"
|
||||
clearable
|
||||
@input="checkNum(scope.row)"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
min-width="180"
|
||||
>
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.remark"
|
||||
|
|
@ -216,8 +164,7 @@
|
|||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete({ ...scope.row, index: scope.$index })"
|
||||
>删除</el-button
|
||||
>
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -225,8 +172,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
|
||||
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
|
||||
import { getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from '@/api/system/role'
|
||||
import { treeselect as menuTreeselect, roleMenuTreeselect } from '@/api/system/menu'
|
||||
import {
|
||||
getProData,
|
||||
getUnitData,
|
||||
|
|
@ -234,28 +181,26 @@ import {
|
|||
getAgreementInfoById,
|
||||
submitLeaseApply,
|
||||
getUseTypeTreee,
|
||||
getUseNumByTypeId
|
||||
getUseNumByTypeId,
|
||||
} from '@/api/claimAndRefund/receive'
|
||||
import { ApiSubmitBackApply } from "@/api/claimAndRefund/return"
|
||||
import { submitBackApplyApi,materialReturnNoteByApply,submitRefuseBackApply } from "@/api/claimAndRefund/return.js"
|
||||
import { ApiSubmitBackApply } from '@/api/claimAndRefund/return'
|
||||
import { submitBackApplyApi, materialReturnNoteByApply, submitRefuseBackApply } from '@/api/claimAndRefund/return.js'
|
||||
import { mapState } from 'vuex'
|
||||
import {
|
||||
getInfo, h
|
||||
} from "@/api/login";
|
||||
import { getInfo, h } from '@/api/login'
|
||||
export default {
|
||||
name: "ReturnApplyAdd",
|
||||
name: 'ReturnApplyAdd',
|
||||
data() {
|
||||
const validatePhone = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error("退料人电话不能为空"));
|
||||
// this.$message.error("手机号不为空");
|
||||
callback(new Error('退料人电话不能为空'))
|
||||
// this.$message.error("手机号不为空");
|
||||
} else if (value.length < 11) {
|
||||
callback(new Error("电话号码格式不正确"));
|
||||
// this.$message.error("手机号格式不正确");
|
||||
callback(new Error('电话号码格式不正确'))
|
||||
// this.$message.error("手机号格式不正确");
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
};
|
||||
}
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
|
|
@ -272,7 +217,7 @@ export default {
|
|||
// 角色表格数据
|
||||
roleList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示弹出层(数据权限)
|
||||
|
|
@ -286,25 +231,25 @@ export default {
|
|||
// 数据范围选项
|
||||
dataScopeOptions: [
|
||||
{
|
||||
value: "1",
|
||||
label: "全部数据权限"
|
||||
value: '1',
|
||||
label: '全部数据权限',
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "自定数据权限"
|
||||
value: '2',
|
||||
label: '自定数据权限',
|
||||
},
|
||||
{
|
||||
value: "3",
|
||||
label: "本部门数据权限"
|
||||
value: '3',
|
||||
label: '本部门数据权限',
|
||||
},
|
||||
{
|
||||
value: "4",
|
||||
label: "本部门及以下数据权限"
|
||||
value: '4',
|
||||
label: '本部门及以下数据权限',
|
||||
},
|
||||
{
|
||||
value: "5",
|
||||
label: "仅本人数据权限"
|
||||
}
|
||||
value: '5',
|
||||
label: '仅本人数据权限',
|
||||
},
|
||||
],
|
||||
// 菜单列表
|
||||
menuOptions: [],
|
||||
|
|
@ -312,7 +257,6 @@ export default {
|
|||
deptOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
|
||||
types: 2,
|
||||
|
||||
unitId: null,
|
||||
|
|
@ -323,15 +267,15 @@ export default {
|
|||
createBy: '', //用户名
|
||||
taskType: 29,
|
||||
taskStatus: 30,
|
||||
backTime: '',//申请时间
|
||||
backTime: '', //申请时间
|
||||
//退料人信息
|
||||
leaseApplyInfo: {
|
||||
backPerson: '',
|
||||
phone: '',
|
||||
remark: ''
|
||||
remark: '',
|
||||
},
|
||||
//退料详情集合
|
||||
leaseApplyDetails: []
|
||||
leaseApplyDetails: [],
|
||||
},
|
||||
leaseApplyDetails: [],
|
||||
//退料详情单条模板
|
||||
|
|
@ -343,7 +287,7 @@ export default {
|
|||
typeName: '', //显示的设备类型
|
||||
typeCode: '', //显示的设备规格
|
||||
unitNames: '', //显示的设备 单位
|
||||
useNum: '', //当前在用量
|
||||
num: '', //当前在用量
|
||||
remark: '', //单条备注
|
||||
preNum: 1, //预领数量
|
||||
},
|
||||
|
|
@ -351,28 +295,38 @@ export default {
|
|||
queryRules: {
|
||||
unitId: [
|
||||
{
|
||||
required: true, message: '请选择退料单位', trigger: 'change', type: 'number'
|
||||
}
|
||||
required: true,
|
||||
message: '请选择退料单位',
|
||||
trigger: 'change',
|
||||
type: 'number',
|
||||
},
|
||||
],
|
||||
proId: [
|
||||
{
|
||||
required: true, message: '请选择退料工程', trigger: 'change', type: 'number'
|
||||
}
|
||||
required: true,
|
||||
message: '请选择退料工程',
|
||||
trigger: 'change',
|
||||
type: 'number',
|
||||
},
|
||||
],
|
||||
backPerson: [
|
||||
{
|
||||
required: true, message: '请输入退料人', trigger: 'blur',
|
||||
}
|
||||
required: true,
|
||||
message: '请输入退料人',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
backTime: [
|
||||
{
|
||||
required: true, message: '请选择退料时间', trigger: 'change',
|
||||
}
|
||||
required: true,
|
||||
message: '请选择退料时间',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
phone: [
|
||||
{required: true, message: '请输入退料人手机号', trigger: 'change'},
|
||||
{ validator: validatePhone, trigger: "blur" },
|
||||
{ min: 11, message: "手机号不足11位", trigger: "blur" },
|
||||
{ required: true, message: '请输入退料人手机号', trigger: 'change' },
|
||||
{ validator: validatePhone, trigger: 'blur' },
|
||||
{ min: 11, message: '手机号不足11位', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
unitList: [], //单位 集合
|
||||
|
|
@ -383,7 +337,7 @@ export default {
|
|||
children: 'children',
|
||||
label: 'typeName',
|
||||
// multiple: false,
|
||||
value: 'typeId'
|
||||
value: 'typeId',
|
||||
},
|
||||
// 选中的设备类型
|
||||
deviceType: null,
|
||||
|
|
@ -396,29 +350,23 @@ export default {
|
|||
// },
|
||||
// 表单校验
|
||||
rules: {
|
||||
roleName: [
|
||||
{ required: true, message: "角色名称不能为空", trigger: "blur" }
|
||||
],
|
||||
roleKey: [
|
||||
{ required: true, message: "权限字符不能为空", trigger: "blur" }
|
||||
],
|
||||
roleSort: [
|
||||
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
|
||||
]
|
||||
roleName: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }],
|
||||
roleKey: [{ required: true, message: '权限字符不能为空', trigger: 'blur' }],
|
||||
roleSort: [{ required: true, message: '角色顺序不能为空', trigger: 'blur' }],
|
||||
},
|
||||
companyId: '',
|
||||
createBy: '',
|
||||
isEdit:'true',
|
||||
rowId:''
|
||||
};
|
||||
isEdit: 'true',
|
||||
rowId: '',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.GetUnitData()
|
||||
this.GetProData()
|
||||
this.GetDeviceTypeTreeFn()
|
||||
// this.GetDeviceTypeTreeFn()
|
||||
// this.getList();
|
||||
// console.log('this.$route.query.isEdit', this.$route.query.isEdit)
|
||||
this.isEdit = this.$route.query.isEdit;
|
||||
this.isEdit = this.$route.query.isEdit
|
||||
if (this.$route.query.Id) {
|
||||
this.rowId = this.$route.query.Id
|
||||
this.returnNoteByApply(this.$route.query.Id)
|
||||
|
|
@ -429,13 +377,14 @@ export default {
|
|||
})
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
...mapState(['user']),
|
||||
},
|
||||
methods: {
|
||||
// 获取 来往单位 列表数据
|
||||
async GetUnitData() {
|
||||
this.leaseApplyDetails.splice(0, this.leaseApplyDetails.length)
|
||||
const params = {
|
||||
id: this.queryParams.proId/* */
|
||||
id: this.queryParams.proId /* */,
|
||||
}
|
||||
const res = await getUnitData(params)
|
||||
this.unitList = res.data
|
||||
|
|
@ -444,8 +393,9 @@ export default {
|
|||
},
|
||||
// 获取 工程名称 列表数据
|
||||
async GetProData() {
|
||||
this.leaseApplyDetails.splice(0, this.leaseApplyDetails.length)
|
||||
const params = {
|
||||
id: this.queryParams.unitId
|
||||
id: this.queryParams.unitId,
|
||||
}
|
||||
const res = await getProData(params)
|
||||
this.proList = res.data
|
||||
|
|
@ -455,12 +405,12 @@ export default {
|
|||
// 获取 设备树结构数据
|
||||
async GetDeviceTypeTreeFn(agreementId) {
|
||||
const params = {
|
||||
agreementId: agreementId
|
||||
agreementId: agreementId,
|
||||
// this.agreementId
|
||||
}
|
||||
|
||||
const res = await getUseTypeTreee(params)
|
||||
console.log("resgetUseTypeTreee==========", res)
|
||||
console.log('resgetUseTypeTreee==========', res)
|
||||
this.deviceTypeTree = res.data
|
||||
},
|
||||
// 获取 协议id
|
||||
|
|
@ -468,11 +418,11 @@ export default {
|
|||
if (this.queryParams.unitId && this.queryParams.proId) {
|
||||
const params = {
|
||||
unitId: this.queryParams.unitId,
|
||||
projectId: this.queryParams.proId
|
||||
projectId: this.queryParams.proId,
|
||||
}
|
||||
const res = await getAgreementInfoById(params)
|
||||
if (!(res.data && res.data.agreementId)) {
|
||||
this.$message.error('当前单位和工程未上传');
|
||||
this.$message.error('当前单位和工程未上传')
|
||||
this.queryParams.unitId = null
|
||||
this.queryParams.proId = null
|
||||
this.GetUnitData()
|
||||
|
|
@ -481,20 +431,19 @@ export default {
|
|||
this.queryParams.agreementId = res.data.agreementId
|
||||
this.queryParams.agreementCode = res.data.agreementCode
|
||||
this.GetDeviceTypeTreeFn(res.data.agreementId)
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 获取 任务详情数据
|
||||
async returnNoteByApply(Id) {
|
||||
const res = await materialReturnNoteByApply({ id:Id })
|
||||
const res = await materialReturnNoteByApply({ id: Id })
|
||||
const data = res.data[0]
|
||||
// console.log(data)
|
||||
// this.queryParams.taskId = data.taskId
|
||||
this.queryParams.unitId = data.unitId
|
||||
this.queryParams.proId = Number(data.proId)
|
||||
this.$set(this.queryParams,'phone',data.phone)
|
||||
this.$set(this.queryParams, 'phone', data.phone)
|
||||
this.queryParams.backPerson = data.backPerson
|
||||
this.queryParams.backTime = data.backTime
|
||||
this.queryParams.agreementCode = data.agreementCode
|
||||
|
|
@ -502,11 +451,10 @@ export default {
|
|||
this.queryParams.remark = data.remark
|
||||
this.leaseApplyDetails = res.data
|
||||
this.GetDeviceTypeTreeFn(data.agreementId)
|
||||
|
||||
},
|
||||
//生成回显数据
|
||||
handelEchoData(item) {
|
||||
console.log('item======', item);
|
||||
console.log('item======', item)
|
||||
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))
|
||||
template.createBy = item.createBy
|
||||
template.parentId = item.data.parentId
|
||||
|
|
@ -522,106 +470,100 @@ export default {
|
|||
return template
|
||||
},
|
||||
|
||||
|
||||
/** 查询角色列表 */
|
||||
async getList() {
|
||||
|
||||
|
||||
},
|
||||
async getList() {},
|
||||
/** 查询菜单树结构 */
|
||||
getMenuTreeselect() {
|
||||
menuTreeselect().then(response => {
|
||||
this.menuOptions = response.data;
|
||||
});
|
||||
this.menuOptions = response.data
|
||||
})
|
||||
},
|
||||
// 所有菜单节点数据
|
||||
getMenuAllCheckedKeys() {
|
||||
// 目前被选中的菜单节点
|
||||
let checkedKeys = this.$refs.menu.getCheckedKeys();
|
||||
let checkedKeys = this.$refs.menu.getCheckedKeys()
|
||||
// 半选中的菜单节点
|
||||
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
|
||||
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
||||
return checkedKeys;
|
||||
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys()
|
||||
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
|
||||
return checkedKeys
|
||||
},
|
||||
// 所有部门节点数据
|
||||
getDeptAllCheckedKeys() {
|
||||
// 目前被选中的部门节点
|
||||
let checkedKeys = this.$refs.dept.getCheckedKeys();
|
||||
let checkedKeys = this.$refs.dept.getCheckedKeys()
|
||||
// 半选中的部门节点
|
||||
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
|
||||
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
||||
return checkedKeys;
|
||||
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys()
|
||||
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
|
||||
return checkedKeys
|
||||
},
|
||||
/** 根据角色ID查询菜单树结构 */
|
||||
getRoleMenuTreeselect(roleId) {
|
||||
return roleMenuTreeselect(roleId).then(response => {
|
||||
this.menuOptions = response.menus;
|
||||
return response;
|
||||
});
|
||||
this.menuOptions = response.menus
|
||||
return response
|
||||
})
|
||||
},
|
||||
/** 根据角色ID查询部门树结构 */
|
||||
getDeptTree(roleId) {
|
||||
return deptTreeSelect(roleId).then(response => {
|
||||
this.deptOptions = response.depts;
|
||||
return response;
|
||||
});
|
||||
this.deptOptions = response.depts
|
||||
return response
|
||||
})
|
||||
},
|
||||
// 角色状态修改
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 取消按钮(数据权限)
|
||||
cancelDataScope() {
|
||||
this.openDataScope = false;
|
||||
this.reset();
|
||||
this.openDataScope = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
if (this.$refs.menu != undefined) {
|
||||
this.$refs.menu.setCheckedKeys([]);
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
}
|
||||
this.menuExpand = false,
|
||||
this.menuNodeAll = false,
|
||||
this.deptExpand = true,
|
||||
this.deptNodeAll = false,
|
||||
this.form = {
|
||||
;(this.menuExpand = false),
|
||||
(this.menuNodeAll = false),
|
||||
(this.deptExpand = true),
|
||||
(this.deptNodeAll = false),
|
||||
(this.form = {
|
||||
roleId: undefined,
|
||||
roleName: undefined,
|
||||
roleKey: undefined,
|
||||
roleSort: 0,
|
||||
status: "0",
|
||||
status: '0',
|
||||
menuIds: [],
|
||||
deptIds: [],
|
||||
menuCheckStrictly: true,
|
||||
deptCheckStrictly: true,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
remark: undefined,
|
||||
})
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.dateRange = []
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
//是否可用勾选框
|
||||
selectable(row) {
|
||||
console.log(row)
|
||||
if (row.useNum != 0) {
|
||||
|
||||
return true
|
||||
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
console.log(row)
|
||||
if (row.num != 0) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
|
|
@ -630,37 +572,35 @@ export default {
|
|||
// 更多操作触发
|
||||
handleCommand(command, row) {
|
||||
switch (command) {
|
||||
case "handleDataScope":
|
||||
this.handleDataScope(row);
|
||||
break;
|
||||
case "handleAuthUser":
|
||||
this.handleAuthUser(row);
|
||||
break;
|
||||
case 'handleDataScope':
|
||||
this.handleDataScope(row)
|
||||
break
|
||||
case 'handleAuthUser':
|
||||
this.handleAuthUser(row)
|
||||
break
|
||||
default:
|
||||
break;
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
/** 保存按钮操作 */
|
||||
handleAdd() {
|
||||
this.$refs.queryForm.validate(async (valid) => {
|
||||
this.$refs.queryForm.validate(async valid => {
|
||||
if (!valid) {
|
||||
return false
|
||||
} else {
|
||||
let backApplyInfo = []
|
||||
if (this.queryParams.leaseApplyDetails.length == 0) {
|
||||
this.$message.error('请添加数据');
|
||||
this.$message.error('请添加数据')
|
||||
return
|
||||
}
|
||||
// const isRemark = this.queryParams.leaseApplyDetails.some(
|
||||
// (item) => item.remark == '' || item.remark == undefined
|
||||
// );
|
||||
const isNum = this.queryParams.leaseApplyDetails.some(
|
||||
(item) => item.num == '' || item.num == undefined
|
||||
);
|
||||
const isNum = this.queryParams.leaseApplyDetails.some(item => item.num == '' || item.num == undefined)
|
||||
if (isNum) {
|
||||
this.$message.error('退料数量不能为空!');
|
||||
return;
|
||||
this.$message.error('退料数量不能为空!')
|
||||
return
|
||||
}
|
||||
this.queryParams.createBy = this.user.name
|
||||
this.queryParams.companyId = this.companyId
|
||||
|
|
@ -671,23 +611,23 @@ export default {
|
|||
backTime: this.queryParams.backTime,
|
||||
companyId: this.companyId,
|
||||
}
|
||||
if(this.rowId!=''){
|
||||
if (this.rowId != '') {
|
||||
let params = {
|
||||
companyId: this.companyId,
|
||||
createBy: this.createBy,
|
||||
id:this.rowId,
|
||||
id: this.rowId,
|
||||
agreementId: this.queryParams.agreementId,
|
||||
backApplyInfo: this.queryParams.backApplyInfo,
|
||||
backApplyDetails: this.queryParams.leaseApplyDetails,
|
||||
}
|
||||
const res = await submitRefuseBackApply(params)
|
||||
if (res.code == 200) {
|
||||
this.$message({ type: 'success', message: res.msg})
|
||||
this.$message({ type: 'success', message: res.msg })
|
||||
setTimeout(() => {
|
||||
this.$tab.closeOpenPage({ path: "/claimAndRefund/return/returnApply"});
|
||||
this.$tab.closeOpenPage({ path: '/claimAndRefund/return/returnApply' })
|
||||
}, 1000)
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
let params = {
|
||||
companyId: this.companyId,
|
||||
createBy: this.createBy,
|
||||
|
|
@ -697,64 +637,61 @@ export default {
|
|||
}
|
||||
const res = await submitBackApplyApi(params)
|
||||
if (res.code == 200) {
|
||||
this.$message({ type: 'success', message: res.msg})
|
||||
this.$message({ type: 'success', message: res.msg })
|
||||
setTimeout(() => {
|
||||
this.$tab.closeOpenPage({ path: "/claimAndRefund/return/returnApply"});
|
||||
this.$tab.closeOpenPage({ path: '/claimAndRefund/return/returnApply' })
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleBack(row) {
|
||||
this.$tab.closeOpenPage({ path: "/claimAndRefund/return/returnApply"});
|
||||
this.$tab.closeOpenPage({ path: '/claimAndRefund/return/returnApply' })
|
||||
},
|
||||
|
||||
/** 分配数据权限操作 */
|
||||
handleDataScope(row) {
|
||||
this.reset();
|
||||
const deptTreeSelect = this.getDeptTree(row.roleId);
|
||||
this.reset()
|
||||
const deptTreeSelect = this.getDeptTree(row.roleId)
|
||||
getRole(row.roleId).then(response => {
|
||||
this.form = response.data;
|
||||
this.openDataScope = true;
|
||||
this.form = response.data
|
||||
this.openDataScope = true
|
||||
this.$nextTick(() => {
|
||||
deptTreeSelect.then(res => {
|
||||
this.$refs.dept.setCheckedKeys(res.checkedKeys);
|
||||
});
|
||||
});
|
||||
this.title = "分配数据权限";
|
||||
});
|
||||
this.$refs.dept.setCheckedKeys(res.checkedKeys)
|
||||
})
|
||||
})
|
||||
this.title = '分配数据权限'
|
||||
})
|
||||
},
|
||||
/** 分配用户操作 */
|
||||
handleAuthUser: function (row) {
|
||||
const roleId = row.roleId;
|
||||
this.$router.push("/system/role-auth/user/" + roleId);
|
||||
handleAuthUser: function(row) {
|
||||
const roleId = row.roleId
|
||||
this.$router.push('/system/role-auth/user/' + roleId)
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate(valid => {
|
||||
submitForm: function() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.roleId != undefined) {
|
||||
this.form.menuIds = this.getMenuAllCheckedKeys();
|
||||
this.form.menuIds = this.getMenuAllCheckedKeys()
|
||||
updateRole(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
this.form.menuIds = this.getMenuAllCheckedKeys();
|
||||
this.form.menuIds = this.getMenuAllCheckedKeys()
|
||||
addRole(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
|
|
@ -763,34 +700,44 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/role/export', {
|
||||
...this.queryParams
|
||||
}, `role_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
'system/role/export',
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`role_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
},
|
||||
|
||||
checkNum(row){
|
||||
let maxNum = row.useNum
|
||||
if(row.num<=1){
|
||||
checkNum(row) {
|
||||
let maxNum = row.num
|
||||
if (row.num <= 1) {
|
||||
row.num = 1
|
||||
}else if(row.num>=maxNum){
|
||||
} else if (row.num >= maxNum) {
|
||||
row.num = maxNum
|
||||
}
|
||||
},
|
||||
|
||||
/////// 设备类型树 切换
|
||||
async deviceTypeChange(val) {
|
||||
let nodes = null;
|
||||
console.log("vall1211221122", this.$refs.deviceTypeCascader.getCheckedNodes().length, this.$refs.deviceTypeCascader.getCheckedNodes(), [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)])
|
||||
nodes = this.$refs.deviceTypeCascader.getCheckedNodes().length > 0 ? this.$refs.deviceTypeCascader.getCheckedNodes() : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
console.log("nodes", nodes)
|
||||
const res = await getUseNumByTypeId({ typeId: nodes[0].data.typeId })
|
||||
nodes[0].data.useNum = res.data
|
||||
let nodes = null
|
||||
// console.log(
|
||||
// 'vall1211221122',
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes().length,
|
||||
// this.$refs.deviceTypeCascader.getCheckedNodes(),
|
||||
// [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
// )
|
||||
nodes =
|
||||
this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
|
||||
? this.$refs.deviceTypeCascader.getCheckedNodes()
|
||||
: [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
|
||||
console.log('nodes', nodes)
|
||||
// const res = await getUseNumByTypeId({ typeId: nodes[0].data.typeId })
|
||||
// nodes[0].data.num = res.data
|
||||
if (nodes[0].level != 4) {
|
||||
return
|
||||
}
|
||||
this.leaseApplyDetails.push(
|
||||
this.handelTableItemData(nodes[0])
|
||||
)
|
||||
this.leaseApplyDetails.push(this.handelTableItemData(nodes[0]))
|
||||
// this.$refs.cascader.$refs.panel.clearCheckedNodes()
|
||||
// // 设置为空可以让节点不高亮显示
|
||||
// this.$refs.cascader.$refs.panel.activePath = []
|
||||
|
|
@ -807,9 +754,9 @@ export default {
|
|||
template.preNum = node.data.num
|
||||
template.typeName = node.pathLabels[2]
|
||||
template.typeCode = node.pathLabels[3]
|
||||
template.useNum = node.data.useNum
|
||||
template.num = node.data.num
|
||||
return template
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue