设备入库相关修改

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) {
return axios(
{

@ -371,10 +371,21 @@
margin-top: -10px
}
.el-form-item {
margin-right: 10px;
margin-bottom: 1px;
margin-top: 1px;
//.el-form-item {
// margin-right: 10px;
// margin-bottom: 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 = {
DRAFT: {key: "DRAFT", tagType: "warning", desc: "草稿"},
WAIT_CONFIRM: {key: "WAIT_CONFIRM", tagType: "warning", desc: "待目标部门确认"},
REJECT_CONFIRM: {key: "REJECT_CONFIRM", tagType: "danger", 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-row :gutter="20">
<el-col :span="6">
<el-form-item label="变更单号">
<el-form-item label="单号">
<el-input v-model="query.changeOrderId" clearable/>
</el-form-item>
</el-col>
@ -46,18 +46,17 @@
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<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="150" prop="orderId"/>
<el-table-column label="类型" width="90" prop="typeName">
<template scope="scope" >
<el-tag :type="`${deviceChangeType[scope.row.type].tagType}`">{{scope.row.typeName}}</el-tag>
<template scope="scope">
<el-tag :type="`${deviceChangeType[scope.row.type].tagType}`">{{ scope.row.typeName }}</el-tag>
</template>
</el-table-column>
<el-table-column label="状态" width="120" prop="statusName">
<template scope="scope" >
<el-tag :type="`${deviceChangeStatus[scope.row.status].tagType}`">{{scope.row.statusName}}</el-tag>
<template scope="scope">
<el-tag :type="`${deviceChangeStatus[scope.row.status].tagType}`">{{ scope.row.statusName }}</el-tag>
</template>
</el-table-column>
<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="120" fixed="right">
<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"
v-if="scope.row.status==deviceChangeStatus.WAIT_CONFIRM.key
&&scope.row.toDeptCode==locDeptCode"
@ -92,18 +101,18 @@
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="getList"
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="getList"
/>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<div class="fl">
{{ `变更详情 ${clickRow ? '——' + clickRow.name + '(' + clickRow.orderId + ')' : ''}` }}
{{ `变更详情 ${clickRow ? '——' + clickRow.name + '(' + clickRow.orderId + ')' : ''}` }}
</div>
<div v-if="clickRow" class="fr">
<el-button @click="getDetailList"></el-button>
@ -150,31 +159,33 @@
</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">
<el-card class="dialogCard" style="margin-top: -30px;">
<div slot="header" class="clearfix">
<div class="fl">
<span>
类型<el-tag :type="this.type.tagType" >{{this.type.desc}}</el-tag>
</span>
<span class="ml10">当前部门{{locDeptName}}</span>
<!-- <span>-->
<!-- 类型<el-tag :type="this.type.tagType">{{ this.type.desc }}</el-tag>-->
<!-- </span>-->
<span class="ml10">当前部门{{ locDeptName }}</span>
</div>
<div class="fr">
<el-button @click="showCreateDialog = false">关闭</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-if="createActive==1&&itemList.length>0" type="primary" @click="saveForm"></el-button>
<el-button v-if="createActive==1&&itemList.length>0" type="primary" @click="saveCache"></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-else @click="changeActive(false)" type="primary">上一步</el-button>-->
<el-button-group>
<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>
<el-steps align-center :active="createActive" finish-status="success" process-status="finish">
<el-step title="基础信息"/>
<el-step title="选择设备"/>
</el-steps>
</div>
<!-- <div>-->
<!-- <el-steps align-center :active="createActive" finish-status="success" process-status="finish">-->
<!-- <el-step title="基础信息"/>-->
<!-- <el-step title="选择设备"/>-->
<!-- </el-steps>-->
<!-- </div>-->
<el-form :disabled="createActive==1" :model="createData" :rules="createRule" ref="createForm"
label-width="auto">
<el-row>
@ -183,14 +194,14 @@
<deptSelect class="width-full" :notCode="locDeptCode" :value.sync="createData.toDeptCode"></deptSelect>
</el-form-item>
</el-col>
<!-- <el-col>-->
<!-- <el-form-item label="描述/名称" prop="name">-->
<!-- <el-input clearable show-word-limit maxlength="200" v-model="createData.name"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col>-->
<!-- <el-form-item label="描述/名称" prop="name">-->
<!-- <el-input clearable show-word-limit maxlength="200" v-model="createData.name"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col>
<el-form-item label="备注">
<el-input type="textarea" resize="none" :autosize="{ minRows: 4, maxRows: 4 }" clearable show-word-limit
<el-form-item :label="createTitle+'说明:'">
<el-input type="textarea" resize="none" :autosize="{ minRows: 2, maxRows: 4 }" clearable show-word-limit
maxlength="300"
v-model="createData.remark"/>
</el-form-item>
@ -198,11 +209,11 @@
</el-row>
</el-form>
</el-card>
<el-card class="dialogCard" :class="{'fullScreen':fullScreenFlag}" v-if="createActive==1"
<el-card class="dialogCard" :class="{'fullScreen':fullScreenFlag}"
style="margin-top: 10px;">
<div slot="header" class="clearfix">
<div class="fr">
<el-button type="primary" @click="openChoose"></el-button>
<el-button type="primary" @click="openChoose"></el-button>
<el-switch
class="ml10"
v-model="fullScreenFlag"
@ -211,72 +222,88 @@
</div>
</div>
<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>
<el-table :data="itemList" width="100%" :height="fullScreenFlag?'93vh':'40vh'">
<el-table-column label="序号" type="index" width="50"/>
<el-table-column v-if="createData.type==deviceChangeType.ADD.key" label="设备号" prop="deviceCode"
width="200">
<template scope="scope">
<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="4"><el-button class="ml5" type="text" @click="genCode(scope.row)"></el-button></el-col>
</el-row>
<span v-else>{{scope.row.deviceCode}}</span>
</template>
</el-table-column>
<el-table-column v-else label="设备号" prop="deviceCode" width="140"/>
<!-- <el-table-column v-if="createData.type==deviceChangeType.ADD.key" label="设备号" prop="deviceCode"-->
<!-- width="200">-->
<!-- <template scope="scope">-->
<!-- <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="4">-->
<!-- <el-button class="ml5" type="text" @click="genCode(scope.row)"></el-button>-->
<!-- </el-col>-->
<!-- </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="160" prop="productName"/>
<el-table-column label="规格型号" width="160" prop="ggxh"/>
<el-table-column label="计量单位" width="100" prop="measname"/>
<el-table-column label="生产企业" width="180" prop="manufactory"/>
<el-table-column label="批次号" v-if="createData.type==deviceChangeType.ADD.key" width="160" prop="batchNo">
<template scope="scope">
<el-input v-if="scope.row.editFlag" v-model="scope.row.batchNo"/>
<span v-else>{{scope.row.batchNo}}</span>
</template>
</el-table-column>
<el-table-column v-else label="批次号" prop="batchNo" width="160"/>
<el-table-column label="序列号" v-if="createData.type==deviceChangeType.ADD.key" width="160" prop="serialNo">
<template scope="scope">
<el-input v-if="scope.row.editFlag" v-model="scope.row.serialNo"/>
<span v-else>{{scope.row.serialNo}}</span>
</template>
</el-table-column>
<el-table-column v-else label="序列号" prop="serialNo" width="160"/>
<el-table-column label="生产日期" v-if="createData.type==deviceChangeType.ADD.key"width="160"
prop="productionDate">
<template scope="scope">
<el-date-picker v-if="scope.row.editFlag" type="date" v-model="scope.row.productionDate" placeholder="格式yyyy-MM-dd" />
<span v-else>{{scope.row.productionDate}}</span>
</template>
</el-table-column>
<el-table-column v-else label="生产日期" prop="productionDate" width="160"/>
<el-table-column label="过期时间" v-if="createData.type==deviceChangeType.ADD.key" width="160"
prop="expireDate">
<template scope="scope">
<el-date-picker v-if="scope.row.editFlag" type="date" v-model="scope.row.expireDate" placeholder="格式yyyy-MM-dd" />
<span v-else>{{scope.row.expireDate}}</span>
</template>
</el-table-column>
<el-table-column v-else label="过期时间" prop="expireDate" width="160"/>
<el-table-column label="udi码" v-if="createData.type==deviceChangeType.ADD.key" min-width="180" prop="udi">
<template scope="scope">
<el-input v-if="scope.row.editFlag" v-model="scope.row.udi"/>
<span v-else>{{scope.row.udi}}</span>
</template>
</el-table-column>
<el-table-column v-else label="udi码" prop="udi" min-width="180"/>
<!-- <el-table-column label="批次号" v-if="createData.type==deviceChangeType.ADD.key" width="160" prop="batchNo">-->
<!-- <template scope="scope">-->
<!-- <el-input v-if="scope.row.editFlag" v-model="scope.row.batchNo"/>-->
<!-- <span v-else>{{ scope.row.batchNo }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="批次号" prop="batchNo" width="160"/>
<!-- <el-table-column label="序列号" v-if="createData.type==deviceChangeType.ADD.key" width="160" prop="serialNo">-->
<!-- <template scope="scope">-->
<!-- <el-input v-if="scope.row.editFlag" v-model="scope.row.serialNo"/>-->
<!-- <span v-else>{{ scope.row.serialNo }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="序列号" prop="serialNo" width="160"/>
<!-- <el-table-column label="生产日期" v-if="createData.type==deviceChangeType.ADD.key" width="160"-->
<!-- prop="productionDate">-->
<!-- <template scope="scope">-->
<!-- <el-date-picker v-if="scope.row.editFlag" type="date" v-model="scope.row.productionDate"-->
<!-- placeholder="格式yyyy-MM-dd"/>-->
<!-- <span v-else>{{ scope.row.productionDate }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="生产日期" prop="productionDate" width="160"/>
<!-- <el-table-column label="过期时间" v-if="createData.type==deviceChangeType.ADD.key" width="160"-->
<!-- prop="expireDate">-->
<!-- <template scope="scope">-->
<!-- <el-date-picker v-if="scope.row.editFlag" type="date" v-model="scope.row.expireDate"-->
<!-- placeholder="格式yyyy-MM-dd"/>-->
<!-- <span v-else>{{ scope.row.expireDate }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="失效日期" prop="expireDate" width="160"/>
<!-- <el-table-column label="udi码" v-if="createData.type==deviceChangeType.ADD.key" min-width="180" prop="udi">-->
<!-- <template scope="scope">-->
<!-- <el-input v-if="scope.row.editFlag" v-model="scope.row.udi"/>-->
<!-- <span v-else>{{ scope.row.udi }}</span>-->
<!-- </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="180" prop="zczbhhzbapzbh"/>
<el-table-column label="操作" fixed="right" :width="createData.type==deviceChangeType.ADD.key?170:50">
<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" @click="scope.row.editFlag=true" v-if="createData.type==deviceChangeType.ADD.key&&scope.row.editFlag==false" >编辑</el-button>
<el-button type="text"
@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" 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>
</el-table-column>
</el-table>
@ -289,7 +316,7 @@
v-if="chooseDeviceFlag"
@close="chooseDeviceFlag = false"
>
<deviceInfo :is-choose="true" :chooseFunc="chooseDevice" />
<deviceInfo :is-choose="true" :chooseFunc="chooseDevice"/>
</el-dialog>
@ -298,8 +325,25 @@
v-if="chooseProductFlag"
@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>
</div>
</template>

@ -2,15 +2,16 @@ import {
cancelChangeOrder,
changeOrderDetailByUser,
changeOrderPage,
confirmChangeOrder, rejectChangeOrder, saveChangeOrder
confirmChangeOrder, delDraftOrder, rejectChangeOrder, saveChangeOrder, saveDraftOrder
} from "@/api/dev/deviceChangeOrderApi";
import {deviceChangeStatus, deviceChangeType} from "@/utils/enum";
import "@/store/getters";
import {genDeviceCode} from "@/api/dev/deviceInfoApi";
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 deviceModifyDialog from "@/views/dev/devInfoEdit.vue";
import fa from "element-ui/src/locale/lang/fa";
let query = {
page: 1,
@ -59,7 +60,7 @@ export default {
required: true,
}
},
components: {deviceInfo, product},
components: {deviceInfo, product, deviceModifyDialog},
computed: {
deviceChangeStatus() {
return deviceChangeStatus
@ -106,14 +107,28 @@ export default {
},
chooseDeviceFlag: false,
chooseProductFlag: false,
deviceInfoFlag: false,
createTitle: "设备入库",
curDevRow: null,
//==================================================
}
},
created() {
let adminId = this.$store.getters.adminId
this.cacheKey = "deviceChangeOrder" + this.type.key + adminId
this.locDeptCode = this.$store.getters.locDeptCode
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()
},
watch: {
@ -138,30 +153,53 @@ export default {
},
methods: {
saveCache() {
let data = window.localStorage.getItem(this.cacheKey)
if (data == null) {
data = {
createActive: this.createActive,
createData: this.createData,
itemList: this.itemList
// let data = window.localStorage.getItem(this.cacheKey)
// if (data == null) {
// data = {
// createActive: this.createActive,
// createData: this.createData,
// 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
} 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.query = {...query}
this.getList()
}).catch(() => {
loading.close()
})
},
saveForm() {
if (this.itemList.length == 0) {
@ -211,9 +249,23 @@ export default {
loading.close()
})
},
//移除设备
delDeviceRow(index) {
this.itemList.splice(index, 1)
},
//编辑设备
editDeviceRow(row) {
this.curDevRow = row;
this.deviceInfoFlag = true;
},
//设备编辑保存
editSaveDev() {
// this.curDevRow = row;
this.deviceInfoFlag = false;
},
copyRow(index) {
let data = {
...this.itemList[index],
@ -302,6 +354,7 @@ export default {
})
},
openChoose(index) {
if (this.createData.type == deviceChangeType.ADD.key) {
this.chooseProductFlag = true
} else {
@ -330,20 +383,23 @@ export default {
}
return true
},
chooseProduct(row) {
chooseProduct(lists) {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let data = copyProperties(row, item)
data.editFlag = true
this.genCode(data)
data.productName = row.cpmctymc
data.productId = row.id
this.itemList.push(data)
loading.close()
for (let row of lists) {
let data = copyProperties(row, item)
data.editFlag = true
this.genCode(data)
data.productName = row.cpmctymc
data.productId = row.id
this.itemList.push(data)
loading.close()
}
this.chooseProductFlag = false
},
parseItemMap() {
@ -407,6 +463,9 @@ export default {
window.localStorage.removeItem(this.cacheKey)
}
},
/**
* 创建单据
*/
openCreate() {
this.fullScreenFlag = false
this.createData = {...createData, type: this.type.key}
@ -415,6 +474,46 @@ export default {
this.itemList = []
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) {
this.$prompt('请输入备注信息', '提示', {
confirmButtonText: '确定',
@ -499,6 +598,7 @@ export default {
}
this.detailList = res.data.list || []
this.detailTotal = res.data.total || 0
this.itemList = this.detailList
}).catch(e => {
this.detailLoading = false
})

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

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

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

Loading…
Cancel
Save