tijiso
This commit is contained in:
parent
5db16f4fc2
commit
05095bd774
|
@ -2,8 +2,8 @@
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
|
#VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
|
||||||
#VUE_APP_BASE_API = 'http://47.95.0.242:2222/api'
|
VUE_APP_BASE_API = 'http://47.95.0.242:2222/api'
|
||||||
|
|
||||||
|
|
||||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||||
|
|
|
@ -124,22 +124,22 @@ export const asyncRoutes = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/equipment',
|
path: '/em',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/equipment/index',
|
redirect: '/em/equipment',
|
||||||
name: 'equipment',
|
name: 'em',
|
||||||
meta: { title: '设备管理', icon: 'example', perms: ['equipment_set'] },
|
meta: { title: '设备管理', icon: 'example', perms: ['equipment_set'] },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'index',
|
path: 'equipment',
|
||||||
name: 'index',
|
name: 'equipment',
|
||||||
component: () => import('@/views/equipment/index'),
|
component: () => import('@/views/em/equipment'),
|
||||||
meta: { title: '生产设备', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '生产设备', icon: 'example', perms: ['index_manage'] }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'index',
|
path: 'detection ',
|
||||||
name: 'index',
|
name: 'detection ',
|
||||||
component: () => import('@/views/equipment/index'),
|
component: () => import('@/views/em/detection'),
|
||||||
meta: { title: '监视和测量设备', icon: 'example', perms: ['index_manage'] }
|
meta: { title: '监视和测量设备', icon: 'example', perms: ['index_manage'] }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -147,7 +147,7 @@ export const asyncRoutes = [
|
||||||
{
|
{
|
||||||
path: '/sam',
|
path: '/sam',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/sam/index',
|
redirect: '/sam/customer',
|
||||||
name: 'sam',
|
name: 'sam',
|
||||||
meta: { title: '合同管理', icon: 'example', perms: ['equipment_set'] },
|
meta: { title: '合同管理', icon: 'example', perms: ['equipment_set'] },
|
||||||
children: [
|
children: [
|
||||||
|
@ -191,7 +191,7 @@ export const asyncRoutes = [
|
||||||
{
|
{
|
||||||
path: '/procurement',
|
path: '/procurement',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/procurement/index',
|
redirect: '/procurement/vendor',
|
||||||
name: 'procurement',
|
name: 'procurement',
|
||||||
meta: { title: '采购管理', icon: 'example', perms: ['procurement_set'] },
|
meta: { title: '采购管理', icon: 'example', perms: ['procurement_set'] },
|
||||||
children: [
|
children: [
|
||||||
|
|
|
@ -0,0 +1,370 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.search"
|
||||||
|
placeholder="设备名称/设备型号"
|
||||||
|
style="width: 300px"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="handleFilter"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleFilter"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh-left"
|
||||||
|
@click="resetFilter"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 10px">
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||||
|
>新增设备</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top: 10px">
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="equipmentList.results"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
stripe
|
||||||
|
highlight-current-row
|
||||||
|
max-height="600"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="设备名称">
|
||||||
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="设备编号">
|
||||||
|
<template slot-scope="scope">{{ scope.row.number }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="型号规格">
|
||||||
|
<template slot-scope="scope">{{ scope.row.model }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="类型">
|
||||||
|
<template slot-scope="scope">{{ type_[scope.row.type] }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="购置日期">
|
||||||
|
<template slot-scope="scope">{{ scope.row.buy_date }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所属部门">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.belong_dept_">{{ scope.row.belong_dept_.name }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="保管人">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.keeper_">{{ scope.row.keeper_.username }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="存放位置">
|
||||||
|
<template slot-scope="scope">{{ scope.row.place }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="任务备注">
|
||||||
|
<template slot-scope="scope">{{ scope.row.description }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间">
|
||||||
|
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="220px"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['equipment_update'])"
|
||||||
|
@click="handleEdit(scope)"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="checkPermission(['equipment_delete'])"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="equipmentList.count > 0"
|
||||||
|
:total="equipmentList.count"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.page_size"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="dialogType === 'edit' ? '编辑设备' : '新增设备'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="Form"
|
||||||
|
:model="equipment"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="right"
|
||||||
|
:rules="rule1"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备名称" prop="name">
|
||||||
|
<el-input v-model="equipment.name" placeholder="设备名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备编号" prop="number">
|
||||||
|
<el-input v-model="equipment.number" placeholder="设备编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="型号规格" prop="model">
|
||||||
|
<el-input v-model="equipment.model" placeholder="规格型号规格" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生产厂家" prop="factory">
|
||||||
|
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="状态" prop="state">
|
||||||
|
|
||||||
|
<el-select style="width: 100%" v-model="equipment.state" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="存放位置" prop="place">
|
||||||
|
<el-input v-model="equipment.place" placeholder="存放位置" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="责任人" prop="keeper">
|
||||||
|
|
||||||
|
<el-select
|
||||||
|
v-model="equipment.keeper"
|
||||||
|
filterable
|
||||||
|
style="width: 100%"
|
||||||
|
allow-create
|
||||||
|
default-first-option
|
||||||
|
placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in keeperOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="备注" prop="description">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:rows="4"
|
||||||
|
v-model="equipment.description"
|
||||||
|
placeholder="备注"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getpEquipmentList, createEquipment,updateEquipment,deleteEquipment } from "@/api/equipment";
|
||||||
|
import { getUserList } from "@/api/user";
|
||||||
|
import { getOrgList } from "@/api/org";
|
||||||
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
||||||
|
|
||||||
|
import { genTree } from "@/utils";
|
||||||
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
|
const defaultequipment = {
|
||||||
|
name: "",
|
||||||
|
number: "",
|
||||||
|
};
|
||||||
|
export default {
|
||||||
|
components: { Pagination },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
equipment: defaultequipment,
|
||||||
|
equipmentList: {
|
||||||
|
count: 0,
|
||||||
|
},
|
||||||
|
type_: {
|
||||||
|
'1':'生产设备',
|
||||||
|
'2':'检验工具',
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
options: [{
|
||||||
|
value: 0,
|
||||||
|
label: '运转正常'
|
||||||
|
}, {
|
||||||
|
value: 1,
|
||||||
|
label: '停用'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
label: '报废'
|
||||||
|
}],
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
},
|
||||||
|
keeperOptions:[],
|
||||||
|
depOptions:[],
|
||||||
|
listLoading: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogType: "new",
|
||||||
|
rule1: {
|
||||||
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
type: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
model: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
|
state: [{ required: true, message: "请选择", trigger: "blur" }],
|
||||||
|
belong_dept:[{ required: true, message: "请选择", trigger: "blur" }]
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getUserList();
|
||||||
|
this.getOrgList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkPermission,
|
||||||
|
//设备列表
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true;
|
||||||
|
getpEquipmentList(this.listQuery).then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
this.equipmentList = response.data;
|
||||||
|
}
|
||||||
|
this.listLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//组员列表
|
||||||
|
getUserList() {
|
||||||
|
getUserList({pageoff:true}).then((res) => {
|
||||||
|
this.keeperOptions = genTree(res.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//部门列表
|
||||||
|
getOrgList() {
|
||||||
|
getOrgList({pageoff:true}).then((res) => {
|
||||||
|
this.depOptions = genTree(res.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
resetFilter() {
|
||||||
|
this.listQuery = {
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handleCreate() {
|
||||||
|
this.equipment = Object.assign({}, defaultequipment);
|
||||||
|
this.dialogType = "new";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEdit(scope) {
|
||||||
|
this.equipment = Object.assign({}, scope.row); // copy obj
|
||||||
|
this.dialogType = "edit";
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["Form"].clearValidate();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(scope) {
|
||||||
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await deleteEquipment(scope.row.id);
|
||||||
|
this.getList();
|
||||||
|
this.$message.success("成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async confirm(form) {
|
||||||
|
this.$refs[form].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.dialogType === "edit";
|
||||||
|
if (isEdit) {
|
||||||
|
updateEquipment(this.equipment.id, this.equipment).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.equipment.type=1;
|
||||||
|
createEquipment(this.equipment).then((res) => {
|
||||||
|
if (res.code >= 200) {
|
||||||
|
this.getList();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -114,24 +114,24 @@
|
||||||
:rules="rule1"
|
:rules="rule1"
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="11">
|
<el-col :span="12">
|
||||||
<el-form-item label="设备名称" prop="name">
|
<el-form-item label="设备名称" prop="name">
|
||||||
<el-input v-model="equipment.name" placeholder="设备名称" />
|
<el-input v-model="equipment.name" placeholder="设备名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="11">
|
<el-col :span="12">
|
||||||
<el-form-item label="设备编号" prop="number">
|
<el-form-item label="设备编号" prop="number">
|
||||||
<el-input v-model="equipment.number" placeholder="设备编号" />
|
<el-input v-model="equipment.number" placeholder="设备编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="11">
|
<el-col :span="12">
|
||||||
<el-form-item label="型号规格" prop="model">
|
<el-form-item label="型号规格" prop="model">
|
||||||
<el-input v-model="equipment.model" placeholder="规格型号规格" />
|
<el-input v-model="equipment.model" placeholder="规格型号规格" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="11">
|
<el-col :span="12">
|
||||||
<el-form-item label="数量" prop="count">
|
<el-form-item label="数量" prop="count">
|
||||||
<el-input v-model="equipment.count" placeholder="数量" />
|
<el-input v-model="equipment.count" placeholder="数量" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -141,7 +141,7 @@
|
||||||
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" />
|
<el-input v-model="equipment.factory" placeholder="生产厂商及国别" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="11">
|
<el-col :span="12">
|
||||||
<el-form-item label="生产日期" prop="production_date">
|
<el-form-item label="生产日期" prop="production_date">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="equipment.production_date"
|
v-model="equipment.production_date"
|
||||||
|
@ -153,7 +153,7 @@
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="11">
|
<el-col :span="12">
|
||||||
<el-form-item label="购置日期" prop="buy_date">
|
<el-form-item label="购置日期" prop="buy_date">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="equipment.buy_date"
|
v-model="equipment.buy_date"
|
||||||
|
@ -185,13 +185,13 @@
|
||||||
<el-input v-model="equipment.place" placeholder="存放位置" />
|
<el-input v-model="equipment.place" placeholder="存放位置" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="11">
|
<el-col :span="12">
|
||||||
<el-form-item label="所属部门" prop="belong_dept">
|
<el-form-item label="所属部门" prop="belong_dept">
|
||||||
<el-cascader :options="depOptions" :props="{ checkStrictly: true,emitPath:false }" ref="demoCascader" style="width:100%" v-model="equipment.belong_dept"></el-cascader>
|
<el-cascader :options="depOptions" :props="{ checkStrictly: true,emitPath:false }" ref="demoCascader" style="width:100%" v-model="equipment.belong_dept"></el-cascader>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="11">
|
<el-col :span="12">
|
||||||
<el-form-item label="保管人" prop="keeper">
|
<el-form-item label="保管人" prop="keeper">
|
||||||
|
|
||||||
<el-select
|
<el-select
|
|
@ -186,6 +186,8 @@ export default {
|
||||||
"2":'半成品',
|
"2":'半成品',
|
||||||
"3":'主要原料',
|
"3":'主要原料',
|
||||||
"4":'辅助原料',
|
"4":'辅助原料',
|
||||||
|
"5":'加工工具',
|
||||||
|
"6":'辅助工具',
|
||||||
|
|
||||||
},
|
},
|
||||||
options: [{
|
options: [{
|
||||||
|
@ -200,6 +202,12 @@ export default {
|
||||||
}, {
|
}, {
|
||||||
value: 4,
|
value: 4,
|
||||||
label: '辅助原料'
|
label: '辅助原料'
|
||||||
|
}, {
|
||||||
|
value: 5,
|
||||||
|
label: '加工工具'
|
||||||
|
}, {
|
||||||
|
value: 6,
|
||||||
|
label: '辅助工具'
|
||||||
}],
|
}],
|
||||||
unitoptions:[
|
unitoptions:[
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div>
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="listQuery.search"
|
v-model="listQuery.search"
|
||||||
placeholder="仓库名称/仓库编号"
|
placeholder="客户名称"
|
||||||
style="width: 300px"
|
style="width: 300px"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="handleFilter"
|
@keyup.enter.native="handleFilter"
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||||
>新增仓库</el-button
|
>新增客户</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -91,29 +91,30 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
:title="dialogType === 'edit' ? '编辑仓库' : '新增仓库'"
|
:title="dialogType === 'edit' ? '编辑合同' : '新增合同'"
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
ref="Form"
|
ref="Form"
|
||||||
:model="warehouse"
|
:model="contract"
|
||||||
label-width="80px"
|
label-width="80px"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
:rules="rule1"
|
:rules="rule1"
|
||||||
>
|
>
|
||||||
<el-form-item label="客户名称" prop="name">
|
<el-form-item label="合同名称" prop="name">
|
||||||
<el-input v-model="warehouse.name" placeholder="仓库名称" />
|
<el-input v-model="contract.name" placeholder="合同名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="客户地址" prop="address">
|
<el-form-item label="合同编号" prop="number">
|
||||||
<el-input v-model="warehouse.address" placeholder="仓库编号" />
|
<el-input v-model="contract.number" placeholder="合同编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系人" prop="contact">
|
<el-form-item label="合同金额" prop="amount">
|
||||||
<el-input v-model="warehouse.contact" placeholder="具体地点" />
|
<el-input v-model="contract.amount" placeholder="合同金额" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系电话" prop="contact_phone">
|
|
||||||
<el-input v-model="warehouse.contact_phone" placeholder="仓库编号" />
|
<el-form-item label="签订日期" prop="sign_date">
|
||||||
|
<el-input v-model="contract.sign_date" placeholder="签订日期" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="描述" prop="description">
|
<el-form-item label="描述" prop="description">
|
||||||
<el-input v-model="warehouse.description" placeholder="具体地点" />
|
<el-input v-model="contract.description" placeholder="描述" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -125,45 +126,32 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getWarehouseList, createWarehouse,updateWarehouse,deleteWarehouse } from "@/api/inm";
|
import { getContractList, createContract,updateContract,deleteContract } from "@/api/sam";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
||||||
|
|
||||||
import { genTree } from "@/utils";
|
import { genTree } from "@/utils";
|
||||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
const defaultewarehouse = {
|
const defaultecontract = {
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
components: { Pagination },
|
components: { Pagination },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
warehouse: defaultewarehouse,
|
contract: defaultecontract,
|
||||||
warehouseList: {
|
customerList: {
|
||||||
count: 0,
|
count: 0,
|
||||||
},
|
},
|
||||||
options: [{
|
|
||||||
value: 0,
|
|
||||||
label: '运转正常'
|
|
||||||
}, {
|
|
||||||
value: 1,
|
|
||||||
label: '停用'
|
|
||||||
}, {
|
|
||||||
value: 2,
|
|
||||||
label: '报废'
|
|
||||||
}],
|
|
||||||
listQuery: {
|
listQuery: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
},
|
},
|
||||||
keeperOptions:[],
|
|
||||||
depOptions:[],
|
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogType: "new",
|
dialogType: "new",
|
||||||
rule1: {
|
rule1: {
|
||||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||||
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
||||||
place: [{ required: true, message: "请输入", trigger: "blur" }],
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -177,7 +165,7 @@ export default {
|
||||||
//设备列表
|
//设备列表
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
getWarehouseList(this.listQuery).then((response) => {
|
getContractList(this.listQuery).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.warehouseList = response.data;
|
this.warehouseList = response.data;
|
||||||
}
|
}
|
||||||
|
@ -198,7 +186,7 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
handleCreate() {
|
handleCreate() {
|
||||||
this.warehouse = Object.assign({}, defaultewarehouse);
|
this.contract = Object.assign({}, defaultecontract);
|
||||||
this.dialogType = "new";
|
this.dialogType = "new";
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -207,7 +195,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleEdit(scope) {
|
handleEdit(scope) {
|
||||||
this.warehouse = Object.assign({}, scope.row); // copy obj
|
this.contract = Object.assign({}, scope.row); // copy obj
|
||||||
this.dialogType = "edit";
|
this.dialogType = "edit";
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -221,7 +209,7 @@ export default {
|
||||||
type: "error",
|
type: "error",
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await deleteWarehouse(scope.row.id);
|
await deleteContract(scope.row.id);
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
})
|
})
|
||||||
|
@ -235,7 +223,7 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const isEdit = this.dialogType === "edit";
|
const isEdit = this.dialogType === "edit";
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
updateWarehouse(this.warehouse.id, this.warehouse).then((res) => {
|
updateContract(this.contract.id, this.contract).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
|
@ -243,7 +231,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createWarehouse(this.warehouse).then((res) => {
|
createContract(this.contract).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
# Generated by Django 3.2.6 on 2021-09-14 02:49
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('em', '0004_equipment_count'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='equipment',
|
||||||
|
name='cycle',
|
||||||
|
field=models.IntegerField(default=0, verbose_name='校准或检定周期'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='equipment',
|
||||||
|
name='mgmtype',
|
||||||
|
field=models.IntegerField(choices=[(1, 'A'), (2, 'B'), (3, 'C')], default=1, verbose_name='管理类别'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='equipment',
|
||||||
|
name='standard',
|
||||||
|
field=models.CharField(blank=True, max_length=200, null=True, verbose_name='溯源标准或依据'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='equipment',
|
||||||
|
name='usetype',
|
||||||
|
field=models.IntegerField(choices=[(1, '专用'), (2, '公用')], default=1, verbose_name='使用类别'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='equipment',
|
||||||
|
name='way',
|
||||||
|
field=models.IntegerField(choices=[(1, '外检'), (2, '自检')], default=1, verbose_name='校准或检定方式'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -23,6 +23,20 @@ class Equipment(CommonBModel):
|
||||||
(1, '生产设备'),
|
(1, '生产设备'),
|
||||||
(2, '检验工具')
|
(2, '检验工具')
|
||||||
)
|
)
|
||||||
|
mgmtype_choices = (
|
||||||
|
(1, 'A'),
|
||||||
|
(2, 'B'),
|
||||||
|
(3, 'C')
|
||||||
|
)
|
||||||
|
way_choices = (
|
||||||
|
(1, '外检'),
|
||||||
|
(2, '自检'),
|
||||||
|
|
||||||
|
)
|
||||||
|
usetype_choices = (
|
||||||
|
(1, '专用'),
|
||||||
|
(2, '公用'),
|
||||||
|
)
|
||||||
type = models.IntegerField('类型', choices=type_choices, default=1)
|
type = models.IntegerField('类型', choices=type_choices, default=1)
|
||||||
name = models.CharField('设备名称', max_length=50)
|
name = models.CharField('设备名称', max_length=50)
|
||||||
number = models.CharField('设备编号', max_length=50, unique=True)
|
number = models.CharField('设备编号', max_length=50, unique=True)
|
||||||
|
@ -37,6 +51,11 @@ class Equipment(CommonBModel):
|
||||||
keeper = models.ForeignKey(User, verbose_name='保管人', on_delete=models.CASCADE, null=True, blank=True)
|
keeper = models.ForeignKey(User, verbose_name='保管人', on_delete=models.CASCADE, null=True, blank=True)
|
||||||
description = models.CharField('描述', max_length=200, blank=True, null=True)
|
description = models.CharField('描述', max_length=200, blank=True, null=True)
|
||||||
#process = models.ForeignKey(Process, verbose_name='工序', on_delete=models.CASCADE, null=True, blank=True)
|
#process = models.ForeignKey(Process, verbose_name='工序', on_delete=models.CASCADE, null=True, blank=True)
|
||||||
|
mgmtype = models.IntegerField('管理类别', choices=mgmtype_choices, default=1)#监视,测量设备
|
||||||
|
way = models.IntegerField('校准或检定方式', choices=way_choices, default=1)#监视,测量设备
|
||||||
|
standard = models.CharField('溯源标准或依据', max_length=200, blank=True, null=True)#监视,测量设备
|
||||||
|
cycle = models.IntegerField('校准或检定周期', default=0)#监视,测量设备
|
||||||
|
usetype = models.IntegerField('使用类别', choices=usetype_choices, default=1)#监视,测量设备
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = '设备信息'
|
verbose_name = '设备信息'
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.2.6 on 2021-09-14 02:49
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mtm', '0012_auto_20210913_1412'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='material',
|
||||||
|
name='specification',
|
||||||
|
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='型号'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='material',
|
||||||
|
name='type',
|
||||||
|
field=models.CharField(choices=[(1, '成品'), (2, '半成品'), (3, '主要原料'), (4, '辅助原料'), (5, '加工工具'), (6, '辅助工具')], default=1, max_length=20, verbose_name='物料类型'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -16,7 +16,9 @@ class Material(CommonAModel):
|
||||||
(1, '成品'),
|
(1, '成品'),
|
||||||
(2, '半成品'),
|
(2, '半成品'),
|
||||||
(3, '主要原料'),
|
(3, '主要原料'),
|
||||||
(4,'辅助原料')
|
(4,'辅助原料') ,
|
||||||
|
(5, '加工工具'),
|
||||||
|
(6,'辅助工具')
|
||||||
)
|
)
|
||||||
unit_choices =(
|
unit_choices =(
|
||||||
('块', '块'),
|
('块', '块'),
|
||||||
|
|
Loading…
Reference in New Issue