设备入库相关修改

zyy_db
anthonywj 1 year ago
parent defd93e0ac
commit dca51b45d9

@ -10,6 +10,26 @@ export function changeOrderPage(query) {
) )
} }
export function saveDraftOrder(query) {
return axios(
{
url: "/udi/device/changeOrder/draft/save",
method: "POST",
data: query
}
)
}
export function delDraftOrder(query) {
return axios(
{
url: "/udi/device/changeOrder/del",
method: "POST",
data: query
}
)
}
export function saveChangeOrder(query) { export function saveChangeOrder(query) {
return axios( return axios(
{ {

@ -371,10 +371,21 @@
margin-top: -10px margin-top: -10px
} }
.el-form-item { //.el-form-item {
margin-right: 10px; // margin-right: 10px;
margin-bottom: 1px; // margin-bottom: 1px;
margin-top: 1px; // margin-top: 1px;
//}
//.el-form {
// margin-top: -10px;
//}
.query-form-item {
margin-right: 5px;
margin-bottom: 51px;
} }

@ -5,6 +5,7 @@ export const deviceChangeType = {
} }
export const deviceChangeStatus = { export const deviceChangeStatus = {
DRAFT: {key: "DRAFT", tagType: "warning", desc: "草稿"},
WAIT_CONFIRM: {key: "WAIT_CONFIRM", tagType: "warning", desc: "待目标部门确认"}, WAIT_CONFIRM: {key: "WAIT_CONFIRM", tagType: "warning", desc: "待目标部门确认"},
REJECT_CONFIRM: {key: "REJECT_CONFIRM", tagType: "danger", desc: "目标部门拒绝"}, REJECT_CONFIRM: {key: "REJECT_CONFIRM", tagType: "danger", desc: "目标部门拒绝"},
FINISH: {key: "FINISH", tagType: "success", desc: "已完成"}, FINISH: {key: "FINISH", tagType: "success", desc: "已完成"},

@ -0,0 +1,299 @@
<template>
<el-card style="margin: 5px;margin-top: -20px">
<el-form :model="formData" ref="dataForm" :rules="rules" label-width="100px" style="margin-bottom: -15px">
<el-button-group style="display: flex;margin: 0px 0 10px 85%; height: 35px">
<el-button
type="primary"
@click.native="submit()"
>保存
</el-button>
</el-button-group>
<!-- <el-row>-->
<!-- <el-col :span="10">-->
<!-- <el-form-item class="query-form-item" prop="deptCode" label="部门:">-->
<!-- <el-select v-model="formData.deptCode"-->
<!-- placeholder="请选择部门"-->
<!-- clearable="true"-->
<!-- @change="deptChange"-->
<!-- style="width: 90%"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in deptList"-->
<!-- :key="item.name"-->
<!-- :label="item.name"-->
<!-- :value="item.code">-->
<!-- <span style="float: left">{{ item.name }}</span>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="10">-->
<!-- <el-form-item class="query-form-item" prop="invCode" label="仓库:">-->
<!-- <el-select v-model="formData.invCode"-->
<!-- placeholder="请选择仓库"-->
<!-- clearable="true"-->
<!-- style="width: 90%"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in invList"-->
<!-- :key="item.name"-->
<!-- :label="item.name"-->
<!-- :value="item.code">-->
<!-- <span style="float: left">{{ item.name }}</span>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" prop="originCode" label="设备编码:">
<el-input v-model="formData.deviceCode" placeholder="请输入编码" show-word-limit maxlength="11"
style="width: 90%" clearable></el-input>
<el-button class="ml5" type="text" @click="genCode()">
</el-button>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" prop="code" label="物资编码:">
<el-input v-model="formData.productId" placeholder="请输入编码" style="width: 90%" clearable disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" prop="deviceName" label="设备名称:">
<el-input v-model="formData.productName" placeholder="请输入设备名称" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" prop="ggxh" label="规格型号:">
<el-input v-model="formData.ggxh" placeholder="请输入规格型号" style="width: 90%" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="批次号:">
<el-input v-model="formData.batchNo" placeholder="请输入批次号" style="width: 90%" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="序列号:">
<el-input v-model="formData.serialNo" placeholder="请输入序列号" style="width: 90%" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="生产日期:">
<el-input v-model="formData.productionDate" placeholder="请输入生产日期" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="失效日期:">
<el-input v-model="formData.expireDate" placeholder="请输入失效日期" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="生产厂家:">
<el-input v-model="formData.manufactory" placeholder="请输入生产厂家" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="计量单位:">
<el-input v-model="formData.measname" placeholder="请输入计量单位" style="width: 90%" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="注册证号:">
<el-input v-model="formData.zczbhhzbapzbh" placeholder="请输入注册备案凭证号" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="供应商:">
<el-input v-model="formData.supName" placeholder="请输入供应商" style="width: 90%" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="10">-->
<!-- <el-form-item label="负责人:">-->
<!-- <el-select v-model="formData.manager"-->
<!-- placeholder="请选择负责人"-->
<!-- clearable="true"-->
<!-- style="width: 90%"-->
<!-- >-->
<!-- <el-option v-for="item in userList"-->
<!-- :key="item.employeeName"-->
<!-- :label="item.employeeName"-->
<!-- :value="item.userId">-->
<!-- <span>{{ item.employeeName }}</span>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="19">
<el-form-item label="备注:">
<el-input v-model="formData.remark" type="textarea" style="width: 100%" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</template>
<script>
import {addDeptDevice, saveDeptDevice, updateDeptDevice} from "@/api/dev/deptDevice";
import {isBlank} from "@/utils/strUtil";
import {getDeptListByUser} from "@/api/auth/authDept";
import {getInvListByUser} from "@/api/system/invWarehouse";
import {listDeptUser} from "@/api/system/deptUser";
import {genDeviceCode} from "@/api/dev/deviceInfoApi";
export default {
props: {
rowData: {
type: Object,
required: true
},
editSaveDev: {
type: Function,
required: true
}
},
name: "deptDeviceModifyDialog",
data() {
return {
deptList: [],
invList: [],
userList: [],
formData: {},
rules: {
// deptCode: [
// {required: true, message: '', trigger: 'change'}
// ],
// invCode: [
// {required: true, message: '', trigger: 'change'}
// ],
// deviceName: [
// {required: true, message: '', trigger: 'blur'}
// ],
// originCode: [
// {required: true, message: '', trigger: 'blur'}
// ]
}
};
},
methods: {
deptChange() {
this.formData.invCode = null;
this.formData.manager = null;
this.invList = [];
this.getInvList();
this.getDeptUserList();
},
getDeptList() {
getDeptListByUser().then((res) => {
this.deptList = res.data || [];
this.getInvList();
this.getDeptUserList();
});
},
getInvList() {
let params = {deptCode: this.formData.deptCode};
getInvListByUser(params)
.then((response) => {
this.invList = response.data || [];
this.getList();
})
.catch(() => {
});
},
getDeptUserList() {
this.userList = [];
let params = {deptId: null};
this.deptList.forEach((item) => {
if (item.code === this.formData.deptCode) {
params.deptId = item.id;
}
});
listDeptUser(params).then((res) => {
this.userList = res.data.list || [];
})
},
submit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
this.$message.error("请完善必填信息");
} else {
// this.rowData = this.formData;
this.rowData.batchNo = this.formData.batchNo;
this.rowData.deviceCode = this.formData.deviceCode;
this.rowData.productId = this.formData.productId;
this.rowData.productName = this.formData.productName;
this.rowData.ggxh = this.formData.ggxh;
this.rowData.serialNo = this.formData.serialNo;
this.rowData.productionDate = this.formData.productionDate;
this.rowData.expireDate = this.formData.expireDate;
this.rowData.manufactory = this.formData.manufactory;
this.rowData.measname = this.formData.measname;
this.rowData.zczbhhzbapzbh = this.formData.zczbhhzbapzbh;
this.rowData.supName = this.formData.supName;
this.rowData.remark = this.formData.remark;
this.editSaveDev();
}
})
},
genCode(row) {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
genDeviceCode().then(res => {
loading.close()
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.formData.deviceCode = res.data
}).catch(e => {
loading.close()
})
},
},
created() {
this.formData = JSON.parse(JSON.stringify(this.rowData));
console.log(this.formData);
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "devSelectProduct"
}
</script>
<style scoped>
</style>

@ -4,7 +4,7 @@
<el-form :model="query" v-if="showSearch" label-width="auto"> <el-form :model="query" v-if="showSearch" label-width="auto">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="变更单号"> <el-form-item label="单号">
<el-input v-model="query.changeOrderId" clearable/> <el-input v-model="query.changeOrderId" clearable/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -46,18 +46,17 @@
</el-button-group> </el-button-group>
</div> </div>
<el-divider style="margin: 15px"></el-divider> <el-divider style="margin: 15px"></el-divider>
<el-table :data="list" @row-click="rowClick" v-loading="loading" click-row-light> <el-table :data="list" @row-click="rowClick" v-loading="loading" click-row-light>
<el-table-column label="序号" width="50" type="index"/> <el-table-column label="序号" width="50" type="index"/>
<el-table-column label="单号" width="150" prop="orderId"/> <el-table-column label="单号" width="150" prop="orderId"/>
<el-table-column label="类型" width="90" prop="typeName"> <el-table-column label="类型" width="90" prop="typeName">
<template scope="scope" > <template scope="scope">
<el-tag :type="`${deviceChangeType[scope.row.type].tagType}`">{{scope.row.typeName}}</el-tag> <el-tag :type="`${deviceChangeType[scope.row.type].tagType}`">{{ scope.row.typeName }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" width="120" prop="statusName"> <el-table-column label="状态" width="120" prop="statusName">
<template scope="scope" > <template scope="scope">
<el-tag :type="`${deviceChangeStatus[scope.row.status].tagType}`">{{scope.row.statusName}}</el-tag> <el-tag :type="`${deviceChangeStatus[scope.row.status].tagType}`">{{ scope.row.statusName }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作部门" width="100" prop="deptName"/> <el-table-column label="操作部门" width="100" prop="deptName"/>
@ -70,6 +69,16 @@
<el-table-column label="备注" width="180" prop="remark"/> <el-table-column label="备注" width="180" prop="remark"/>
<el-table-column label="操作" width="120" fixed="right"> <el-table-column label="操作" width="120" fixed="right">
<template scope="scope"> <template scope="scope">
<el-button type="text"
v-if="scope.row.status==deviceChangeStatus.DRAFT.key"
@click="openEdit(scope.row)">
编辑
</el-button>
<el-button type="text"
v-if="scope.row.status==deviceChangeStatus.DRAFT.key"
@click="delOrder(scope.row)">
删除
</el-button>
<el-button type="text" <el-button type="text"
v-if="scope.row.status==deviceChangeStatus.WAIT_CONFIRM.key v-if="scope.row.status==deviceChangeStatus.WAIT_CONFIRM.key
&&scope.row.toDeptCode==locDeptCode" &&scope.row.toDeptCode==locDeptCode"
@ -92,18 +101,18 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="query.page" :page.sync="query.page"
:limit.sync="query.limit" :limit.sync="query.limit"
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
<el-card> <el-card>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<div class="fl"> <div class="fl">
{{ `变更详情 ${clickRow ? '——' + clickRow.name + '(' + clickRow.orderId + ')' : ''}` }} {{ `变更详情 ${clickRow ? '——' + clickRow.name + '(' + clickRow.orderId + ')' : ''}` }}
</div> </div>
<div v-if="clickRow" class="fr"> <div v-if="clickRow" class="fr">
<el-button @click="getDetailList"></el-button> <el-button @click="getDetailList"></el-button>
@ -150,31 +159,33 @@
</el-card> </el-card>
<el-dialog width="80%" title="创建变更单" custom-class="" :visible="true" v-if="showCreateDialog" <el-dialog width="80%" :title="createTitle" custom-class="" :visible="true" v-if="showCreateDialog"
@close="showCreateDialog = false"> @close="showCreateDialog = false">
<el-card class="dialogCard" style="margin-top: -30px;"> <el-card class="dialogCard" style="margin-top: -30px;">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<div class="fl"> <div class="fl">
<span> <!-- <span>-->
类型<el-tag :type="this.type.tagType" >{{this.type.desc}}</el-tag> <!-- 类型<el-tag :type="this.type.tagType">{{ this.type.desc }}</el-tag>-->
</span> <!-- </span>-->
<span class="ml10">当前部门{{locDeptName}}</span> <span class="ml10">当前部门{{ locDeptName }}</span>
</div> </div>
<div class="fr"> <div class="fr">
<el-button @click="showCreateDialog = false">关闭</el-button> <!-- <el-button @click="showCreateDialog = false">关闭</el-button>-->
<el-button v-if="createActive==0" @click="changeActive(true)" type="primary"></el-button> <!-- <el-button v-if="createActive==0" @click="changeActive(true)" type="primary"></el-button>-->
<el-button v-else @click="changeActive(false)" type="primary">上一步</el-button> <!-- <el-button v-else @click="changeActive(false)" type="primary">上一步</el-button>-->
<el-button v-if="createActive==1&&itemList.length>0" type="primary" @click="saveForm"></el-button> <el-button-group>
<el-button v-if="createActive==1&&itemList.length>0" type="primary" @click="saveCache"></el-button> <el-button :disabled="itemList.length===0" type="primary" @click="saveCache">稿</el-button>
<el-button :disabled="itemList.length===0" type="primary" @click="saveForm"></el-button>
</el-button-group>
</div> </div>
</div> </div>
<div> <!-- <div>-->
<el-steps align-center :active="createActive" finish-status="success" process-status="finish"> <!-- <el-steps align-center :active="createActive" finish-status="success" process-status="finish">-->
<el-step title="基础信息"/> <!-- <el-step title="基础信息"/>-->
<el-step title="选择设备"/> <!-- <el-step title="选择设备"/>-->
</el-steps> <!-- </el-steps>-->
</div> <!-- </div>-->
<el-form :disabled="createActive==1" :model="createData" :rules="createRule" ref="createForm" <el-form :disabled="createActive==1" :model="createData" :rules="createRule" ref="createForm"
label-width="auto"> label-width="auto">
<el-row> <el-row>
@ -183,14 +194,14 @@
<deptSelect class="width-full" :notCode="locDeptCode" :value.sync="createData.toDeptCode"></deptSelect> <deptSelect class="width-full" :notCode="locDeptCode" :value.sync="createData.toDeptCode"></deptSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col>--> <!-- <el-col>-->
<!-- <el-form-item label="描述/名称" prop="name">--> <!-- <el-form-item label="描述/名称" prop="name">-->
<!-- <el-input clearable show-word-limit maxlength="200" v-model="createData.name"/>--> <!-- <el-input clearable show-word-limit maxlength="200" v-model="createData.name"/>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<el-col> <el-col>
<el-form-item label="备注"> <el-form-item :label="createTitle+'说明:'">
<el-input type="textarea" resize="none" :autosize="{ minRows: 4, maxRows: 4 }" clearable show-word-limit <el-input type="textarea" resize="none" :autosize="{ minRows: 2, maxRows: 4 }" clearable show-word-limit
maxlength="300" maxlength="300"
v-model="createData.remark"/> v-model="createData.remark"/>
</el-form-item> </el-form-item>
@ -198,11 +209,11 @@
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
<el-card class="dialogCard" :class="{'fullScreen':fullScreenFlag}" v-if="createActive==1" <el-card class="dialogCard" :class="{'fullScreen':fullScreenFlag}"
style="margin-top: 10px;"> style="margin-top: 10px;">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<div class="fr"> <div class="fr">
<el-button type="primary" @click="openChoose"></el-button> <el-button type="primary" @click="openChoose"></el-button>
<el-switch <el-switch
class="ml10" class="ml10"
v-model="fullScreenFlag" v-model="fullScreenFlag"
@ -211,72 +222,88 @@
</div> </div>
</div> </div>
<div class="mb10"> <div class="mb10">
<el-tag class="ml5 mb5" type="info" color="#00a1ff" v-for="(v,i) in itemMap">{{v[0]}} * {{v[1]}}</el-tag> <el-tag class="ml5 mb5" type="info" color="#00a1ff" v-for="(v,i) in itemMap">{{ v[0] }} * {{ v[1] }}</el-tag>
</div> </div>
<el-table :data="itemList" width="100%" :height="fullScreenFlag?'93vh':'40vh'"> <el-table :data="itemList" width="100%" :height="fullScreenFlag?'93vh':'40vh'">
<el-table-column label="序号" type="index" width="50"/> <el-table-column label="序号" type="index" width="50"/>
<el-table-column v-if="createData.type==deviceChangeType.ADD.key" label="设备号" prop="deviceCode" <!-- <el-table-column v-if="createData.type==deviceChangeType.ADD.key" label="设备号" prop="deviceCode"-->
width="200"> <!-- width="200">-->
<template scope="scope"> <!-- <template scope="scope">-->
<el-row v-if="scope.row.editFlag"> <!-- <el-row v-if="scope.row.editFlag">-->
<el-col :span="20"><el-input v-model="scope.row.deviceCode" show-word-limit maxlength="11"/></el-col> <!-- <el-col :span="20">-->
<el-col :span="4"><el-button class="ml5" type="text" @click="genCode(scope.row)"></el-button></el-col> <!-- <el-input v-model="scope.row.deviceCode" show-word-limit maxlength="11"/>-->
</el-row> <!-- </el-col>-->
<span v-else>{{scope.row.deviceCode}}</span> <!-- <el-col :span="4">-->
</template> <!-- <el-button class="ml5" type="text" @click="genCode(scope.row)"></el-button>-->
</el-table-column> <!-- </el-col>-->
<el-table-column v-else label="设备号" prop="deviceCode" width="140"/> <!-- </el-row>-->
<!-- <span v-else>{{ scope.row.deviceCode }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="设备号" prop="deviceCode" width="140"/>
<el-table-column label="最小销售标识" width="150" prop="nameCode"/> <el-table-column label="最小销售标识" width="150" prop="nameCode"/>
<el-table-column label="名称" width="160" prop="productName"/> <el-table-column label="名称" width="160" prop="productName"/>
<el-table-column label="规格型号" width="160" prop="ggxh"/> <el-table-column label="规格型号" width="160" prop="ggxh"/>
<el-table-column label="计量单位" width="100" prop="measname"/> <el-table-column label="计量单位" width="100" prop="measname"/>
<el-table-column label="生产企业" width="180" prop="manufactory"/> <el-table-column label="生产企业" width="180" prop="manufactory"/>
<el-table-column label="批次号" v-if="createData.type==deviceChangeType.ADD.key" width="160" prop="batchNo"> <!-- <el-table-column label="批次号" v-if="createData.type==deviceChangeType.ADD.key" width="160" prop="batchNo">-->
<template scope="scope"> <!-- <template scope="scope">-->
<el-input v-if="scope.row.editFlag" v-model="scope.row.batchNo"/> <!-- <el-input v-if="scope.row.editFlag" v-model="scope.row.batchNo"/>-->
<span v-else>{{scope.row.batchNo}}</span> <!-- <span v-else>{{ scope.row.batchNo }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column v-else label="批次号" prop="batchNo" width="160"/> <el-table-column label="批次号" prop="batchNo" width="160"/>
<el-table-column label="序列号" v-if="createData.type==deviceChangeType.ADD.key" width="160" prop="serialNo"> <!-- <el-table-column label="序列号" v-if="createData.type==deviceChangeType.ADD.key" width="160" prop="serialNo">-->
<template scope="scope"> <!-- <template scope="scope">-->
<el-input v-if="scope.row.editFlag" v-model="scope.row.serialNo"/> <!-- <el-input v-if="scope.row.editFlag" v-model="scope.row.serialNo"/>-->
<span v-else>{{scope.row.serialNo}}</span> <!-- <span v-else>{{ scope.row.serialNo }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column v-else label="序列号" prop="serialNo" width="160"/> <el-table-column label="序列号" prop="serialNo" width="160"/>
<el-table-column label="生产日期" v-if="createData.type==deviceChangeType.ADD.key"width="160" <!-- <el-table-column label="生产日期" v-if="createData.type==deviceChangeType.ADD.key" width="160"-->
prop="productionDate"> <!-- prop="productionDate">-->
<template scope="scope"> <!-- <template scope="scope">-->
<el-date-picker v-if="scope.row.editFlag" type="date" v-model="scope.row.productionDate" placeholder="格式yyyy-MM-dd" /> <!-- <el-date-picker v-if="scope.row.editFlag" type="date" v-model="scope.row.productionDate"-->
<span v-else>{{scope.row.productionDate}}</span> <!-- placeholder="格式yyyy-MM-dd"/>-->
</template> <!-- <span v-else>{{ scope.row.productionDate }}</span>-->
</el-table-column> <!-- </template>-->
<el-table-column v-else label="生产日期" prop="productionDate" width="160"/> <!-- </el-table-column>-->
<el-table-column label="过期时间" v-if="createData.type==deviceChangeType.ADD.key" width="160" <el-table-column label="生产日期" prop="productionDate" width="160"/>
prop="expireDate"> <!-- <el-table-column label="过期时间" v-if="createData.type==deviceChangeType.ADD.key" width="160"-->
<template scope="scope"> <!-- prop="expireDate">-->
<el-date-picker v-if="scope.row.editFlag" type="date" v-model="scope.row.expireDate" placeholder="格式yyyy-MM-dd" /> <!-- <template scope="scope">-->
<span v-else>{{scope.row.expireDate}}</span> <!-- <el-date-picker v-if="scope.row.editFlag" type="date" v-model="scope.row.expireDate"-->
</template> <!-- placeholder="格式yyyy-MM-dd"/>-->
</el-table-column> <!-- <span v-else>{{ scope.row.expireDate }}</span>-->
<el-table-column v-else label="过期时间" prop="expireDate" width="160"/> <!-- </template>-->
<el-table-column label="udi码" v-if="createData.type==deviceChangeType.ADD.key" min-width="180" prop="udi"> <!-- </el-table-column>-->
<template scope="scope"> <el-table-column label="失效日期" prop="expireDate" width="160"/>
<el-input v-if="scope.row.editFlag" v-model="scope.row.udi"/> <!-- <el-table-column label="udi码" v-if="createData.type==deviceChangeType.ADD.key" min-width="180" prop="udi">-->
<span v-else>{{scope.row.udi}}</span> <!-- <template scope="scope">-->
</template> <!-- <el-input v-if="scope.row.editFlag" v-model="scope.row.udi"/>-->
</el-table-column> <!-- <span v-else>{{ scope.row.udi }}</span>-->
<el-table-column v-else label="udi码" prop="udi" min-width="180"/> <!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="udi码" prop="udi" min-width="180"/>
<el-table-column label="供应商" width="160" prop="supName"/> <el-table-column label="供应商" width="160" prop="supName"/>
<el-table-column label="注册/备案号" width="180" prop="zczbhhzbapzbh"/> <el-table-column label="注册/备案号" width="180" prop="zczbhhzbapzbh"/>
<el-table-column label="操作" fixed="right" :width="createData.type==deviceChangeType.ADD.key?170:50"> <el-table-column label="操作" fixed="right" :width="createData.type==deviceChangeType.ADD.key?170:50">
<template scope="scope"> <template scope="scope">
<el-button type="text" @click="scope.row.editFlag=false" v-if="createData.type==deviceChangeType.ADD.key&&scope.row.editFlag==true" >保存</el-button> <el-button type="text"
<el-button type="text" @click="scope.row.editFlag=true" v-if="createData.type==deviceChangeType.ADD.key&&scope.row.editFlag==false" >编辑</el-button> @click="editDeviceRow(scope.row)"
v-if="createData.type==deviceChangeType.ADD.key">编辑
</el-button>
<!-- <el-button type="text" @click="scope.row.editFlag=true"-->
<!-- v-if="createData.type==deviceChangeType.ADD.key&&scope.row.editFlag==false">编辑-->
<!-- </el-button>-->
<el-button type="text" v-if="createData.type==deviceChangeType.ADD.key" @click="copyRow(scope.$index)">
复制
</el-button>
<el-button type="text" @click="delDeviceRow(scope.$index)"></el-button> <el-button type="text" @click="delDeviceRow(scope.$index)"></el-button>
<el-button type="text" v-if="createData.type==deviceChangeType.ADD.key" @click="copyRow(scope.$index)"></el-button>
<el-button type="text" v-if="createData.type==deviceChangeType.ADD.key" @click="batchCopyRow(scope.$index)"></el-button> <!-- <el-button type="text" v-if="createData.type==deviceChangeType.ADD.key"-->
<!-- @click="batchCopyRow(scope.$index)">批量-->
<!-- </el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -289,7 +316,7 @@
v-if="chooseDeviceFlag" v-if="chooseDeviceFlag"
@close="chooseDeviceFlag = false" @close="chooseDeviceFlag = false"
> >
<deviceInfo :is-choose="true" :chooseFunc="chooseDevice" /> <deviceInfo :is-choose="true" :chooseFunc="chooseDevice"/>
</el-dialog> </el-dialog>
@ -298,8 +325,25 @@
v-if="chooseProductFlag" v-if="chooseProductFlag"
@close="chooseProductFlag = false" @close="chooseProductFlag = false"
> >
<product style="margin: -30px -10px -10px -10px" :is-choose="true" :chooseFunc="chooseProduct" /> <product style="margin: -30px -10px -10px -10px"
:is-choose="true"
:listType="2"
:chooseFunc="chooseProduct"/>
</el-dialog>
<el-dialog
width="65%"
title="设备信息-编辑"
:visible="true"
v-if="deviceInfoFlag"
@close="deviceInfoFlag = false"
>
<deviceModifyDialog
:rowData="curDevRow"
:editSaveDev="editSaveDev"
>
</deviceModifyDialog>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>

@ -2,15 +2,16 @@ import {
cancelChangeOrder, cancelChangeOrder,
changeOrderDetailByUser, changeOrderDetailByUser,
changeOrderPage, changeOrderPage,
confirmChangeOrder, rejectChangeOrder, saveChangeOrder confirmChangeOrder, delDraftOrder, rejectChangeOrder, saveChangeOrder, saveDraftOrder
} from "@/api/dev/deviceChangeOrderApi"; } from "@/api/dev/deviceChangeOrderApi";
import {deviceChangeStatus, deviceChangeType} from "@/utils/enum"; import {deviceChangeStatus, deviceChangeType} from "@/utils/enum";
import "@/store/getters"; import "@/store/getters";
import {genDeviceCode} from "@/api/dev/deviceInfoApi"; import {genDeviceCode} from "@/api/dev/deviceInfoApi";
import deviceInfo from "@/views/dev/deviceInfo.vue"; import deviceInfo from "@/views/dev/deviceInfo.vue";
import product from "@/views/basic/product/product.vue"; import product from "@/views/purchase/purApply/purOrderSelectProduct";
import {copyProperties} from "@/utils"; import {copyProperties} from "@/utils";
import deviceModifyDialog from "@/views/dev/devInfoEdit.vue";
import fa from "element-ui/src/locale/lang/fa";
let query = { let query = {
page: 1, page: 1,
@ -59,7 +60,7 @@ export default {
required: true, required: true,
} }
}, },
components: {deviceInfo, product}, components: {deviceInfo, product, deviceModifyDialog},
computed: { computed: {
deviceChangeStatus() { deviceChangeStatus() {
return deviceChangeStatus return deviceChangeStatus
@ -106,14 +107,28 @@ export default {
}, },
chooseDeviceFlag: false, chooseDeviceFlag: false,
chooseProductFlag: false, chooseProductFlag: false,
deviceInfoFlag: false,
createTitle: "设备入库",
curDevRow: null,
//================================================== //==================================================
} }
}, },
created() { created() {
let adminId = this.$store.getters.adminId let adminId = this.$store.getters.adminId
this.cacheKey = "deviceChangeOrder" + this.type.key + adminId this.cacheKey = "deviceChangeOrder" + this.type.key + adminId
this.locDeptCode = this.$store.getters.locDeptCode this.locDeptCode = this.$store.getters.locDeptCode
this.locDeptName = this.$store.getters.locDeptName this.locDeptName = this.$store.getters.locDeptName
if (this.type == deviceChangeType.ADD) {
this.createTitle = "设备入库";
} else if (this.type == deviceChangeType.CHANGE) {
this.createTitle = "设备变更";
} else if (this.type == deviceChangeType.DESTROY) {
this.createTitle = "设备报废";
}
this.getList() this.getList()
}, },
watch: { watch: {
@ -138,30 +153,53 @@ export default {
}, },
methods: { methods: {
saveCache() { saveCache() {
let data = window.localStorage.getItem(this.cacheKey) // let data = window.localStorage.getItem(this.cacheKey)
if (data == null) { // if (data == null) {
data = { // data = {
createActive: this.createActive, // createActive: this.createActive,
createData: this.createData, // createData: this.createData,
itemList: this.itemList // itemList: this.itemList
// }
// window.localStorage.setItem(this.cacheKey, JSON.stringify(data))
// this.showCreateDialog = false
// } else {
// this.$confirm("检测到已经挂起了一单,如继续挂起将会覆盖之前的单,是否继续", "提示", {
// confirmButtonText: "继续",
// cancelButtonText: "取消",
// type: "warning",
// }).then(() => {
// data = {
// createActive: this.createActive,
// createData: this.createData,
// itemList: this.itemList
// }
// window.localStorage.setItem(this.cacheKey, JSON.stringify(data))
// this.showCreateDialog = false
// })
// }
this.createData.items = this.itemList
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
saveDraftOrder(this.createData).then(res => {
loading.close()
if (res.code != 20000) {
this.$message.error(res.message)
return
} }
window.localStorage.setItem(this.cacheKey, JSON.stringify(data)) this.$message.success(res.message)
this.showCreateDialog = false this.showCreateDialog = false
} else { this.query = {...query}
this.$confirm("检测到已经挂起了一单,如继续挂起将会覆盖之前的单,是否继续", "提示", { this.getList()
confirmButtonText: "继续", }).catch(() => {
cancelButtonText: "取消", loading.close()
type: "warning", })
}).then(() => {
data = {
createActive: this.createActive,
createData: this.createData,
itemList: this.itemList
}
window.localStorage.setItem(this.cacheKey, JSON.stringify(data))
this.showCreateDialog = false
})
}
}, },
saveForm() { saveForm() {
if (this.itemList.length == 0) { if (this.itemList.length == 0) {
@ -211,9 +249,23 @@ export default {
loading.close() loading.close()
}) })
}, },
//移除设备
delDeviceRow(index) { delDeviceRow(index) {
this.itemList.splice(index, 1) this.itemList.splice(index, 1)
}, },
//编辑设备
editDeviceRow(row) {
this.curDevRow = row;
this.deviceInfoFlag = true;
},
//设备编辑保存
editSaveDev() {
// this.curDevRow = row;
this.deviceInfoFlag = false;
},
copyRow(index) { copyRow(index) {
let data = { let data = {
...this.itemList[index], ...this.itemList[index],
@ -302,6 +354,7 @@ export default {
}) })
}, },
openChoose(index) { openChoose(index) {
if (this.createData.type == deviceChangeType.ADD.key) { if (this.createData.type == deviceChangeType.ADD.key) {
this.chooseProductFlag = true this.chooseProductFlag = true
} else { } else {
@ -330,20 +383,23 @@ export default {
} }
return true return true
}, },
chooseProduct(row) { chooseProduct(lists) {
let loading = this.$loading({ let loading = this.$loading({
lock: true, lock: true,
text: 'Loading', text: 'Loading',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
let data = copyProperties(row, item) for (let row of lists) {
data.editFlag = true let data = copyProperties(row, item)
this.genCode(data) data.editFlag = true
data.productName = row.cpmctymc this.genCode(data)
data.productId = row.id data.productName = row.cpmctymc
this.itemList.push(data) data.productId = row.id
loading.close() this.itemList.push(data)
loading.close()
}
this.chooseProductFlag = false this.chooseProductFlag = false
}, },
parseItemMap() { parseItemMap() {
@ -407,6 +463,9 @@ export default {
window.localStorage.removeItem(this.cacheKey) window.localStorage.removeItem(this.cacheKey)
} }
}, },
/**
* 创建单据
*/
openCreate() { openCreate() {
this.fullScreenFlag = false this.fullScreenFlag = false
this.createData = {...createData, type: this.type.key} this.createData = {...createData, type: this.type.key}
@ -415,6 +474,46 @@ export default {
this.itemList = [] this.itemList = []
this.showCreateDialog = true this.showCreateDialog = true
}, },
/**
* 编辑单据
*/
openEdit(row) {
this.fullScreenFlag = false
// this.createData = {...createData, type: this.type.key}
this.createData = row
this.createActive = 0
this.oldType = null
this.itemList = []
this.showCreateDialog = true
this.getDetailList()
},
/**
* 删除单据
* @param row
*/
delOrder(row) {
this.$confirm("确定删除该单据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
delDraftOrder({"orderId": row.orderId}).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.$message.success(res.message)
this.query.page = 1
this.getList()
this.clickRow = null
})
})
},
confirm(row) { confirm(row) {
this.$prompt('请输入备注信息', '提示', { this.$prompt('请输入备注信息', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -499,6 +598,7 @@ export default {
} }
this.detailList = res.data.list || [] this.detailList = res.data.list || []
this.detailTotal = res.data.total || 0 this.detailTotal = res.data.total || 0
this.itemList = this.detailList
}).catch(e => { }).catch(e => {
this.detailLoading = false this.detailLoading = false
}) })

@ -98,7 +98,6 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
debugger
this.loading = true; this.loading = true;
this.filterQuery.adNum = this.sickerAdNum; this.filterQuery.adNum = this.sickerAdNum;
this.filterQuery.billNo = this.perscribeData.billNo; this.filterQuery.billNo = this.perscribeData.billNo;

@ -170,7 +170,6 @@ export default {
return true; return true;
}, },
formSubmit() { formSubmit() {
debugger
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (valid) { if (valid) {
this.formLoading = true; this.formLoading = true;

@ -4,7 +4,7 @@
<el-form :model="listQuery" label-width="120px" v-if="showSearch"> <el-form :model="listQuery" label-width="120px" v-if="showSearch">
<el-row> <el-row>
<el-col :span="18"> <el-col :span="18">
<el-form-item label="UDI码:"> <el-form-item label="UDI码:" class="query-form-item">
<el-input v-model="listQuery.udiCode" style="width: 96%" placeholder="请扫描或输入UDI码" clearable="true" <el-input v-model="listQuery.udiCode" style="width: 96%" placeholder="请扫描或输入UDI码" clearable="true"
@keyup.enter.native="keyup_submit($event)"></el-input> @keyup.enter.native="keyup_submit($event)"></el-input>
</el-form-item> </el-form-item>
@ -12,25 +12,25 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="拼音简写:"> <el-form-item label="拼音简写:" class="query-form-item">
<el-input v-model="listQuery.pinyinInitial" @input="search" style="width: 100%" placeholder="请输入物资拼音简写" <el-input v-model="listQuery.pinyinInitial" @input="search" style="width: 100%" placeholder="请输入物资拼音简写"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="第三方物资编码:"> <el-form-item label="第三方物资编码:" class="query-form-item">
<el-input v-model="listQuery.thrPiId" style="width: 100%" placeholder="第三方物资编码" <el-input v-model="listQuery.thrPiId" style="width: 100%" placeholder="第三方物资编码"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="分类编码:"> <el-form-item label="分类编码:" class="query-form-item">
<el-input v-model="listQuery.flbm" style="width: 100%" placeholder="请输入分类编码" <el-input v-model="listQuery.flbm" style="width: 100%" placeholder="请输入分类编码"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="供应商:"> <el-form-item label="供应商:" class="query-form-item">
<el-input v-model="listQuery.companyName" style="width: 100%" placeholder="请输入供应商" <el-input v-model="listQuery.companyName" style="width: 100%" placeholder="请输入供应商"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
@ -38,24 +38,24 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="DI/物资编码:"> <el-form-item label="DI/物资编码:" class="query-form-item">
<el-input v-model="listQuery.unionCode" style="width: 100%" placeholder="请输入DI/医保编码/商品条码" <el-input v-model="listQuery.unionCode" style="width: 100%" placeholder="请输入DI/医保编码/商品条码"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="物资名称:"> <el-form-item label="物资名称:" class="query-form-item">
<el-input v-model="listQuery.cpmctymc" style="width: 100%" placeholder="请输入物资名称" <el-input v-model="listQuery.cpmctymc" style="width: 100%" placeholder="请输入物资名称"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="规格型号:"> <el-form-item label="规格型号:" class="query-form-item">
<el-input v-model="listQuery.ggxh" style="width: 100%" placeholder="请输入规格型号" clearable="true"></el-input> <el-input v-model="listQuery.ggxh" style="width: 100%" placeholder="请输入规格型号" clearable="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="生产企业:"> <el-form-item label="生产企业:" class="query-form-item">
<el-input v-model="listQuery.manufactory" style="width: 100%" placeholder="请输入生产企业/注册备案人" <el-input v-model="listQuery.manufactory" style="width: 100%" placeholder="请输入生产企业/注册备案人"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
@ -64,20 +64,20 @@
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="物资分类:"> <el-form-item label="物资分类:" class="query-form-item">
<el-input v-model="listQuery.category" style="width: 100%" placeholder="请输入物资分类名称" <el-input v-model="listQuery.category" style="width: 100%" placeholder="请输入物资分类名称"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" v-if="productRemarkSet.remarkEnable1"> <el-col :span="6" v-if="productRemarkSet.remarkEnable1">
<el-form-item :label="productRemarkSet.remarkTitle1+':'"> <el-form-item :label="productRemarkSet.remarkTitle1+':'" class="query-form-item">
<el-input v-model="listQuery.basicPrductRemak1" style="width: 100%" <el-input v-model="listQuery.basicPrductRemak1" style="width: 100%"
:placeholder="productRemarkSet.remarkTitle1" :placeholder="productRemarkSet.remarkTitle1"
clearable="true"></el-input> clearable="true"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" v-if="productRemarkSet.remarkEnable2"> <el-col :span="6" v-if="productRemarkSet.remarkEnable2">
<el-form-item :label="productRemarkSet.remarkTitle2 +':'"> <el-form-item :label="productRemarkSet.remarkTitle2 +':'" class="query-form-item">
<el-input v-model="listQuery.basicPrductRemak2" style="width: 100%" <el-input v-model="listQuery.basicPrductRemak2" style="width: 100%"
:placeholder="productRemarkSet.remarkTitle2" :placeholder="productRemarkSet.remarkTitle2"
clearable="true"></el-input> clearable="true"></el-input>
@ -209,7 +209,7 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
listType: { listType: { //null:12
type: Object, type: Object,
required: true, required: true,
}, },
@ -217,6 +217,9 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
chooseFunc: {
required: false, type: Function
}
}, },
data() { data() {
@ -414,17 +417,23 @@ export default {
this.closeDialog(); this.closeDialog();
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.lists = [];
for (var i = 0; i < val.length; i++) { if (this.listType != 2) {
this.tQuery = {} this.lists = [];
this.tQuery.productId = val[i].id; for (var i = 0; i < val.length; i++) {
this.tQuery.supId = val[i].customerId; this.tQuery = {}
this.tQuery.productName = val[i].cpmctymc; this.tQuery.productId = val[i].id;
this.tQuery.count = 1; this.tQuery.supId = val[i].customerId;
this.tQuery.orderIdFk = this.pId; this.tQuery.productName = val[i].cpmctymc;
this.tQuery.zczbhhzbapzbh = val[i].zczbhhzbapzbh; this.tQuery.count = 1;
this.lists.push(this.tQuery) this.tQuery.orderIdFk = this.pId;
this.tQuery.zczbhhzbapzbh = val[i].zczbhhzbapzbh;
this.lists.push(this.tQuery)
}
} else {
this.lists = val;
} }
console.log(this.lists) console.log(this.lists)
}, },
@ -435,8 +444,10 @@ export default {
} }
if (this.listType == null) { if (this.listType == null) {
this.puApplayAdd(); this.puApplayAdd();
} else { } else if (this.listType == 1) {
this.invRationAdd(); this.invRationAdd();
} else if (this.listType == 2) {
this.deviceAdd();
} }
}, },
@ -493,6 +504,11 @@ export default {
}, },
deviceAdd() {
this.chooseFunc(this.lists)
},
selectCert() { selectCert() {
if (this.currentCert == null) { if (this.currentCert == null) {
this.$message.error("请先选择对应的注册证!"); this.$message.error("请先选择对应的注册证!");
@ -529,6 +545,10 @@ export default {
<style scoped> <style scoped>
.query-form-item {
margin-right: 5px;
margin-bottom: 5px;
}
div /deep/ .el-table .warning-row { div /deep/ .el-table .warning-row {
background: #bebebe; background: #bebebe;

Loading…
Cancel
Save