yemianqunaxiananniutinajia

This commit is contained in:
shijing 2022-03-02 13:37:44 +08:00
parent 8dcaec8003
commit 544478dc0b
7 changed files with 1614 additions and 1677 deletions

View File

@ -14,45 +14,37 @@
v-el-height-adaptive-table="{ bottomOffset: 41 }" v-el-height-adaptive-table="{ bottomOffset: 41 }"
> >
<el-table-column type="index" width="50" label="序号"/> <el-table-column type="index" width="50" label="序号"/>
<el-table-column align="center" label="工号"> <el-table-column align="center" prop="number" label="工号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="姓名"> <el-table-column align="center" prop="name" label="姓名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="到岗情况"> <el-table-column align="center" label="到岗情况">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="success" v-if="scope.row.is_atwork">在岗</el-tag> <el-tag type="success" v-if="scope.row.is_atwork">在岗</el-tag>
<el-tag type="danger" v-else>离岗</el-tag> <el-tag type="danger" v-else>离岗</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="离岗备注"> <el-table-column align="center" prop="not_work_remark" label="离岗备注">
<template slot-scope="scope">{{
scope.row.not_work_remark
}}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="打卡时间"> <el-table-column align="center" prop="last_check_time" label="打卡时间">
<template slot-scope="scope">{{ scope.row.last_check_time }}</template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="部门"> <el-table-column align="header-center" label="部门">
<template v-if="scope.row.dept_" slot-scope="scope">{{ <template v-if="scope.row.dept_" slot-scope="scope">
scope.row.dept_.name {{scope.row.dept_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" fixed="right"> <el-table-column align="center" label="操作" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['employee_notworkremark'])&&scope.row.is_atwork == false"
type="primary" type="primary"
v-if="scope.row.is_atwork == false"
@click="handlestopwork(scope)" @click="handlestopwork(scope)"
>离岗说明 >
离岗说明
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="userList.count > 0" v-show="userList.count > 0"
:total="userList.count" :total="userList.count"
@ -60,7 +52,6 @@
:limit.sync="listQuery.page_size" :limit.sync="listQuery.page_size"
@pagination="getList" @pagination="getList"
/> />
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
@ -74,17 +65,25 @@
> >
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
type="textarea"
v-model="stopwork.not_work_remark" v-model="stopwork.not_work_remark"
type="textarea"
placeholder="备注" placeholder="备注"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false" <el-button
>取消</el-button type="danger"
@click="dialogVisible = false"
> >
<el-button type="primary" @click="smtconfirm()">确认</el-button> 取消
</el-button>
<el-button
type="primary"
@click="smtconfirm()"
>
确认
</el-button>
</div> </div>
</el-dialog> </el-dialog>
</el-tab-pane> </el-tab-pane>
@ -99,7 +98,12 @@
placeholder="选择年月" placeholder="选择年月"
> >
</el-date-picker> </el-date-picker>
<el-button type="primary" @click="submit">查询</el-button> <el-button
type="primary"
@click="submit"
>
查询
</el-button>
</div> </div>
<el-table <el-table
:data="atworkList" :data="atworkList"
@ -113,25 +117,15 @@
v-el-height-adaptive-table="{ bottomOffset: 41 }" v-el-height-adaptive-table="{ bottomOffset: 41 }"
> >
<el-table-column type="index" width="50" label="序号"/> <el-table-column type="index" width="50" label="序号"/>
<el-table-column align="center" label="工号"> <el-table-column align="center" prop="number" label="工号">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="姓名"> <el-table-column align="center" prop="name" label="姓名">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" prop="dept_name" label="部门">
<el-table-column align="header-center" label="部门">
<template slot-scope="scope">{{
scope.row.dept_name
}}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="出勤天数"> <el-table-column align="center" prop="count" label="出勤天数">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="应到天数"> <el-table-column align="center" prop="count_workday" label="应到天数">
<template slot-scope="scope">{{
scope.row.count_workday
}}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-col> </el-col>
@ -159,9 +153,11 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.avatar-uploader .el-upload:hover { .avatar-uploader .el-upload:hover {
border-color: #409eff; border-color: #409eff;
} }
.avatar-uploader-icon { .avatar-uploader-icon {
font-size: 28px; font-size: 28px;
color: #8c939d; color: #8c939d;
@ -170,6 +166,7 @@
line-height: 100px; line-height: 100px;
text-align: center; text-align: center;
} }
.avatar { .avatar {
width: 100px; width: 100px;
height: 100px; height: 100px;

View File

@ -1,10 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-input <el-input
v-model="listQuery.name" v-model="listQuery.name"
placeholder="姓名" placeholder="姓名"
@ -16,18 +13,21 @@
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter"
size="small" size="small"
>搜索</el-button> @click="handleFilter"
>
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter"
size="small" size="small"
>重置</el-button> @click="resetFilter"
>
重置
</el-button>
</div> </div>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="userList.results" :data="userList.results"
@ -40,11 +40,9 @@
v-el-height-adaptive-table="{bottomOffset: 41}" v-el-height-adaptive-table="{bottomOffset: 41}"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column align="center" label="工号"> <el-table-column align="center" label="工号" prop="number">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="姓名"> <el-table-column align="center" label="姓名" prop="name">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column align="header-center" label="照片"> <el-table-column align="header-center" label="照片">
<template slot-scope="scope"><img :src="scope.row.photo" min-width="70" height="70"/></template> <template slot-scope="scope"><img :src="scope.row.photo" min-width="70" height="70"/></template>
@ -56,31 +54,33 @@
<template <template
v-if="scope.row.dept_" v-if="scope.row.dept_"
slot-scope="scope" slot-scope="scope"
>{{ scope.row.dept_.name }}</template> >
{{ scope.row.dept_.name }}
</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="!scope.row.is_superuser" v-if="!scope.row.is_superuser"
:disabled="!checkPermission(['user_update'])" :disabled="!checkPermission(['employee_update'])"
type="primary" type="primary"
size="small" size="small"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link> >
编辑
</el-link>
<el-link <el-link
v-if="!scope.row.is_superuser" v-if="!scope.row.is_superuser"
:disabled="!checkPermission(['user_delete'])" :disabled="!checkPermission(['user_delete'])"
type="danger" type="danger"
size="small" size="small"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="userList.count>0" v-show="userList.count>0"
:total="userList.count" :total="userList.count"
@ -89,8 +89,6 @@
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
</div> </div>
</template> </template>
<style> <style>
@ -101,9 +99,11 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.avatar-uploader .el-upload:hover { .avatar-uploader .el-upload:hover {
border-color: #409eff; border-color: #409eff;
} }
.avatar-uploader-icon { .avatar-uploader-icon {
font-size: 28px; font-size: 28px;
color: #8c939d; color: #8c939d;
@ -112,6 +112,7 @@
line-height: 100px; line-height: 100px;
text-align: center; text-align: center;
} }
.avatar { .avatar {
width: 100px; width: 100px;
height: 100px; height: 100px;
@ -119,17 +120,13 @@
} }
</style> </style>
<script> <script>
import { getUserList, createUser, deleteUser, updateUser } from "@/api/user"; import { deleteUser} from "@/api/user";
import {getEmployeeList,} from "@/api/employee"; import {getEmployeeList,} from "@/api/employee";
import { getOrgAll } from "@/api/org"
import { getRoleAll } from "@/api/role"
import { genTree } from "@/utils"
import checkPermission from "@/utils/permission" import checkPermission from "@/utils/permission"
import {upUrl, upHeaders} from "@/api/file" import {upUrl, upHeaders} from "@/api/file"
import Pagination from "@/components/Pagination" // secondary package based on el-pagination import Pagination from "@/components/Pagination" // secondary package based on el-pagination
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
const defaultUser = { const defaultUser = {
id: "", id: "",
name: "", name: "",
@ -138,7 +135,7 @@ const defaultUser = {
avatar: "/media/default/avatar.png" avatar: "/media/default/avatar.png"
}; };
export default { export default {
components: { Pagination, Treeselect }, components: {Pagination},
data() { data() {
return { return {
user: defaultUser, user: defaultUser,
@ -160,9 +157,6 @@ export default {
rule1: { rule1: {
name: [{required: true, message: "请输入姓名", trigger: "blur"}], name: [{required: true, message: "请输入姓名", trigger: "blur"}],
username: [{required: true, message: "请输入账号", trigger: "change"}] username: [{required: true, message: "请输入账号", trigger: "change"}]
// password: [
// { required: true, message: '请输入密码', trigger: 'change' }
// ],
}, },
filterOrgText: "", filterOrgText: "",
treeLoding: false, treeLoding: false,
@ -181,9 +175,10 @@ export default {
}, },
methods: { methods: {
checkPermission, checkPermission,
handleAvatarSuccess(res, file) { handleAvatarSuccess(res) {
this.user.avatar = res.data.path this.user.avatar = res.data.path
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 0.5; const isLt2M = file.size / 1024 / 1024 < 0.5;
if (!isLt2M) { if (!isLt2M) {
@ -191,15 +186,18 @@ export default {
} }
return isLt2M; return isLt2M;
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
handleOrgClick(obj, node, vue) {
handleOrgClick(obj) {
this.listQuery.page = 1; this.listQuery.page = 1;
this.listQuery.dept = obj.id; this.listQuery.dept = obj.id;
this.getList(); this.getList();
}, },
getList() { getList() {
this.listLoading = true; this.listLoading = true;
getEmployeeList(this.listQuery).then(response => { getEmployeeList(this.listQuery).then(response => {
@ -217,6 +215,7 @@ export default {
}; };
this.getList(); this.getList();
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
@ -225,6 +224,7 @@ export default {
handleEdit(scope) { handleEdit(scope) {
this.$router.push({name: "userupdate", params: {id: scope.row.id}}) this.$router.push({name: "userupdate", params: {id: scope.row.id}})
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -240,7 +240,7 @@ export default {
}); });
}) })
.catch(err => { .catch(err => {
console.error(err); this.$message.error(err);
}); });
}, },

View File

@ -1,16 +1,19 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card">
<el-tab-pane label="待军检" name="first"> <el-tab-pane label="待军检" name="first">
<el-button type="primary" icon="el-icon-plus" @click="handleorder" <el-button
>申请 v-if="checkPermission(['wp_need_to_order'])"
type="primary"
icon="el-icon-plus"
@click="handleorder"
>
申请
</el-button> </el-button>
<el-table <el-table
:data="iproductData.results"
ref="multipleTable" ref="multipleTable"
:data="iproductData.results"
border border
fit fit
stripe stripe
@ -21,24 +24,16 @@
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="成品编号"> <el-table-column label="成品编号" prop="number">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品批次" prop="batch">
<el-table-column label="成品批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品名称"> <el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template> <template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="所在仓库"> <el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template> <template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="iproductData.count > 0" v-show="iproductData.count > 0"
@ -50,7 +45,6 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="军检列表" name="second"> <el-tab-pane label="军检列表" name="second">
<el-table <el-table
:data="iproductData2.results" :data="iproductData2.results"
border border
fit fit
@ -61,31 +55,20 @@
v-el-height-adaptive-table="{bottomOffset: 42}" v-el-height-adaptive-table="{bottomOffset: 42}"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="成品编号"> <el-table-column label="成品编号" prop="number">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品批次" prop="batch">
<el-table-column label="成品批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品名称"> <el-table-column label="成品名称">
<template slot-scope="scope">{{ scope.row.material_.name }}</template> <template slot-scope="scope">{{ scope.row.material_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="所在仓库"> <el-table-column label="所在仓库">
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template> <template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="订单"> <el-table-column label="订单">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.to_order_">{{ <span v-if="scope.row.to_order_">{{scope.row.to_order_.number}}</span>
scope.row.to_order_.number <el-tag v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true">
}}</span>
<el-tag
v-else-if="
scope.row.to_order_ == null && scope.row.need_to_order == true
"
>
需要确定订单 需要确定订单
</el-tag> </el-tag>
<span v-else></span> <span v-else></span>
@ -93,40 +76,24 @@
</el-table-column> </el-table-column>
<el-table-column label="合同"> <el-table-column label="合同">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.to_order_">{{ <span v-if="scope.row.to_order_">{{scope.row.to_order_.contract_.name}}</span>
scope.row.to_order_.contract_.name <span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
}}</span>
<span
v-else-if="
scope.row.to_order_ == null && scope.row.need_to_order == true
"
>
</span>
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户"> <el-table-column label="客户">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.to_order_">{{ <span v-if="scope.row.to_order_">{{scope.row.to_order_.customer_.name}}</span>
scope.row.to_order_.customer_.name <span v-else-if="scope.row.to_order_ == null && scope.row.need_to_order == true"></span>
}}</span>
<span
v-else-if="
scope.row.to_order_ == null && scope.row.need_to_order == true
"
>
</span>
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="军检"> <el-table-column label="军检">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag> <el-tag v-if="scope.row.is_mtestok == false">不合格</el-tag>
<el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag> <el-tag v-else-if="scope.row.is_mtestok == true">合格</el-tag>
<span v-else></span></template> <span v-else></span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
@ -134,13 +101,12 @@
width="220px" width="220px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="scope.row.is_mtestok==null" v-if="checkPermission(['wp_mtest'])&&scope.row.is_mtestok==null"
@click="handleMtest(scope)" @click="handleMtest(scope)"
>军检</el-link
> >
军检
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -152,9 +118,7 @@
@pagination="getList2" @pagination="getList2"
/> />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
@ -165,10 +129,8 @@
:model="mtest" :model="mtest"
label-width="150px" label-width="150px"
label-position="right" label-position="right"
> >
<el-form-item label="军检是否合格"> <el-form-item label="军检是否合格">
<el-radio v-model="mtest.is_mtestok" label=True>合格</el-radio> <el-radio v-model="mtest.is_mtestok" label=True>合格</el-radio>
<el-radio v-model="mtest.is_mtestok" label=False>不合格</el-radio> <el-radio v-model="mtest.is_mtestok" label=False>不合格</el-radio>
@ -176,7 +138,6 @@
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="mtest.remark_mtest" placeholder="备注"/> <el-input v-model="mtest.remark_mtest" placeholder="备注"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -184,21 +145,19 @@
</div> </div>
</el-dialog> </el-dialog>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { getiproductList,saleMtest} from "@/api/inm"; import {getiproductList} from "@/api/inm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import {mtest, needtoorder,} from "@/api/wpm"; import {mtest, needtoorder,} from "@/api/wpm";
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
export default { export default {
components: {Pagination}, components: {Pagination},
data() { data() {
return { return {
iproductData: { iproductData: {
count: 0, count: 0,
}, },
@ -221,33 +180,29 @@ export default {
mutipID1: [], mutipID1: [],
}; };
}, },
computed: {},
watch: {},
created() { created() {
this.getList(); this.getList();
this.getList2(); this.getList2();
}, },
methods: { methods: {
checkPermission, checkPermission,
getList() { getList() {
this.listQuery.material__type = 1; this.listQuery.material__type = 1;
this.listQuery.need_to_order = false; this.listQuery.need_to_order = false;
getiproductList(this.listQuery).then((response) => { getiproductList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.iproductData = response.data; this.iproductData = response.data;
} }
}); });
}, },
getList2(){
getList2() {
this.listQuery2.material__type = 1; this.listQuery2.material__type = 1;
getiproductList(this.listQuery2).then((response) => { getiproductList(this.listQuery2).then((response) => {
if (response.data) { if (response.data) {
this.iproductData2 = response.data; this.iproductData2 = response.data;
} }
}); });
}, },
@ -255,25 +210,23 @@ export default {
this.saleproduct = scope.row.wproduct; this.saleproduct = scope.row.wproduct;
this.dialogVisible = true; this.dialogVisible = true;
}, },
smtconfirm() { smtconfirm() {
mtest(this.saleproduct, this.mtest).then((res) => { mtest(this.saleproduct, this.mtest).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
this.getList2(); this.getList2();
this.dialogVisible = false; this.dialogVisible = false;
this.$message.success("成功"); this.$message.success("成功");
} }
}); });
}, },
//批量申请 //批量申请
handleorder() { handleorder() {
let _this = this; let _this = this;
_this.mutipID1 = []; _this.mutipID1 = [];
this.$refs.multipleTable.selection.forEach((item) => { this.$refs.multipleTable.selection.forEach((item) => {
_this.mutipID1.push(item.wproduct); _this.mutipID1.push(item.wproduct);
}); });
needtoorder({ needtoorder({
wproducts: this.mutipID1, wproducts: this.mutipID1,

View File

@ -2,9 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增合同</el-button v-if="checkPermission(['contract_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增合同
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="客户名称" placeholder="客户名称"
@ -17,17 +22,18 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button
> >
重置
</el-button>
</div> </div>
</el-card> </el-card>
<el-card> <el-card>
<el-table <el-table
@ -41,31 +47,22 @@
v-el-height-adaptive-table="{bottomOffset: 42}" v-el-height-adaptive-table="{bottomOffset: 42}"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="合同名称" width="160" show-overflow-tooltip> <el-table-column label="合同名称" prop="name" width="160" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="合同编号" prop="number" width="160" show-overflow-tooltip>
<el-table-column label="合同编号" width="160" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="合同金额(元)" width="120"> <el-table-column label="合同金额(元)" prop="amount" width="120">
<template slot-scope="scope">{{ scope.row.amount }}</template>
</el-table-column> </el-table-column>
<el-table-column label="开票金额(元)" width="120" > <el-table-column label="开票金额(元)" prop="invoice" width="120">
<template slot-scope="scope">{{ scope.row.invoice }}</template>
</el-table-column> </el-table-column>
<el-table-column label="客户名称" width="130" show-overflow-tooltip> <el-table-column label="客户名称" width="130" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.customer_.name }}</template> <template slot-scope="scope">{{ scope.row.customer_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="签订日期" width="120" > <el-table-column label="签订日期" prop="sign_date" width="120">
<template slot-scope="scope">{{ scope.row.sign_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="描述" width="130" show-overflow-tooltip> <el-table-column label="描述" prop="description" width="130" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" width="160"> <el-table-column label="创建时间" prop="create_time" width="160">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
@ -74,27 +71,27 @@
fixed="right" fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['contract_update'])"
type="primary" type="primary"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link
> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['contract_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['contract_update'])"
type="primary" type="primary"
@click="handleDetail(scope)" @click="handleDetail(scope)"
>详情</el-link
> >
详情
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -152,7 +149,6 @@
<el-form-item label="描述" prop="description"> <el-form-item label="描述" prop="description">
<el-input v-model="contract.description" placeholder="描述"/> <el-input v-model="contract.description" placeholder="描述"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -168,8 +164,7 @@ 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 defaultecontract = { const defaultecontract = {};
};
export default { export default {
components: {Pagination}, components: {Pagination},
data() { data() {
@ -191,12 +186,12 @@ export default {
}, },
}; };
}, },
computed: {},
watch: {},
created() { created() {
this.getLists(); this.getLists();
this.getList(); this.getList();
}, },
methods: { methods: {
checkPermission, checkPermission,
@ -211,11 +206,8 @@ export default {
}, },
getLists() { getLists() {
getCustomerList({pageoff: true}).then((response) => { getCustomerList({pageoff: true}).then((response) => {
this.options = genTree(response.data); this.options = genTree(response.data);
}); });
}, },
@ -223,13 +215,15 @@ export default {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.contract = Object.assign({}, defaultecontract); this.contract = Object.assign({}, defaultecontract);
this.dialogType = "new"; this.dialogType = "new";
@ -247,6 +241,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -259,7 +254,7 @@ export default {
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
@ -289,6 +284,7 @@ export default {
} }
}); });
}, },
//合同详情 //合同详情
handleDetail(scope) { handleDetail(scope) {
this.$router.push({name: "contractdetail", params: {id: scope.row.id},}) this.$router.push({name: "contractdetail", params: {id: scope.row.id},})

View File

@ -2,9 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增客户</el-button v-if="checkPermission(['customer_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增客户
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="客户名称" placeholder="客户名称"
@ -17,17 +22,18 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button
> >
重置
</el-button>
</div> </div>
</el-card> </el-card>
<el-card> <el-card>
<el-table <el-table
@ -41,44 +47,37 @@
v-el-height-adaptive-table="{bottomOffset: 42}" v-el-height-adaptive-table="{bottomOffset: 42}"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="客户名称" width="200" show-overflow-tooltip> <el-table-column label="客户名称" prop="name" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="详细地址" prop="address" width="200" show-overflow-tooltip>
<el-table-column label="详细地址" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.address }}</template>
</el-table-column> </el-table-column>
<el-table-column label="联系人" width="130" show-overflow-tooltip> <el-table-column label="联系人" prop="contact" width="130" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.contact }}</template>
</el-table-column> </el-table-column>
<el-table-column label="联系电话" width="130" show-overflow-tooltip> <el-table-column label="联系电话" prop="contact_phone" width="130" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.contact_phone }}</template>
</el-table-column> </el-table-column>
<el-table-column label="描述" width="200" show-overflow-tooltip> <el-table-column label="描述" prop="description" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" width="160" > <el-table-column label="创建时间" prop="create_time" width="160">
<template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="操作" label="操作"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['customer_update'])"
@click="handleEdit(scope)"
type="primary" type="primary"
>编辑</el-link @click="handleEdit(scope)"
> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['customer_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -129,12 +128,10 @@
<script> <script>
import {getCustomerList, createCustomer, updateCustomer, deleteCustomer} from "@/api/sam"; import {getCustomerList, createCustomer, updateCustomer, deleteCustomer} 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 defaultecustomer = { const defaultecustomer = {};
};
export default { export default {
components: {Pagination}, components: {Pagination},
data() { data() {
@ -155,13 +152,14 @@ export default {
}, },
}; };
}, },
computed: {},
watch: {},
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
checkPermission, checkPermission,
//设备列表 //设备列表
getList() { getList() {
this.listLoading = true; this.listLoading = true;
@ -173,18 +171,19 @@ export default {
}); });
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.customer = Object.assign({}, defaultecustomer); this.customer = Object.assign({}, defaultecustomer);
this.dialogType = "new"; this.dialogType = "new";
@ -202,6 +201,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -214,7 +214,7 @@ export default {
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },

View File

@ -2,9 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增订单</el-button v-if="checkPermission(['order_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增订单
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="订单名称" placeholder="订单名称"
@ -17,17 +22,18 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button
> >
重置
</el-button>
</div> </div>
</el-card> </el-card>
<el-card> <el-card>
<el-table <el-table
@ -41,9 +47,7 @@
v-el-height-adaptive-table="{bottomOffset: 42}" v-el-height-adaptive-table="{bottomOffset: 42}"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="订单编号" prop="number" width="160" show-overflow-tooltip>
<el-table-column label="订单编号" width="160" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="客户" width="200" show-overflow-tooltip> <el-table-column label="客户" width="200" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.customer_.name }}</template> <template slot-scope="scope">{{ scope.row.customer_.name }}</template>
@ -57,19 +61,17 @@
<el-table-column label="产品型号" width="120" show-overflow-tooltip> <el-table-column label="产品型号" width="120" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.product_.specification }}</template> <template slot-scope="scope">{{ scope.row.product_.specification }}</template>
</el-table-column> </el-table-column>
<el-table-column label="产品数量" width="90" > <el-table-column label="产品数量" prop="count" width="90">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="交货日期" width="150" > <el-table-column label="交货日期" prop="delivery_date" width="150">
<template slot-scope="scope">{{ scope.row.delivery_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="已交货数量" width="150" > <el-table-column label="已交货数量" prop="delivered_count" width="150">
<template slot-scope="scope">{{ scope.row.delivered_count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否需要军检" width="150"> <el-table-column label="是否需要军检" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.need_mtest == false"></el-tag> <el-tag v-if="scope.row.need_mtest === false"></el-tag>
<el-tag v-else-if="scope.row.need_mtest == true"></el-tag></template> <el-tag v-else-if="scope.row.need_mtest === true"></el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" width="160"> <el-table-column label="创建时间" width="160">
<template slot-scope="scope">{{ scope.row.create_time }}</template> <template slot-scope="scope">{{ scope.row.create_time }}</template>
@ -81,25 +83,27 @@
width="130" width="130"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_update'])" v-if="checkPermission(['order_update'])"
@click="handleEdit(scope)" @click="handleEdit(scope)"
type="primary" type="primary"
>编辑</el-link
> >
编辑
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['order_delete'])"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['order_update'])"
type="primary" type="primary"
@click="handleDetail(scope)" @click="handleDetail(scope)"
>详情</el-link
> >
详情
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -123,7 +127,6 @@
label-position="right" label-position="right"
:rules="rule1" :rules="rule1"
> >
<el-form-item label="订单编号" prop="number"> <el-form-item label="订单编号" prop="number">
<el-input v-model="order.number" placeholder="订单编号自动生成" disabled="true"/> <el-input v-model="order.number" placeholder="订单编号自动生成" disabled="true"/>
</el-form-item> </el-form-item>
@ -137,7 +140,6 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所需数量" prop="count"> <el-form-item label="所需数量" prop="count">
<el-input-number type="number" v-model="order.count" :min="0"></el-input-number> <el-input-number type="number" v-model="order.count" :min="0"></el-input-number>
</el-form-item> </el-form-item>
@ -165,17 +167,16 @@
<el-select style="width: 100%" v-model="order.contract" @change="selectcontract" placeholder="请选择"> <el-select style="width: 100%" v-model="order.contract" @change="selectcontract" placeholder="请选择">
<el-option <el-option
v-for="item in contractoptions" v-for="item in contractoptions"
:key="item.id" :key="item.id"
:label="item.name+'____'+item.number" :label="item.name+'____'+item.number"
:value="item.id"> :value="item.id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否军检"> <el-form-item label="是否军检">
<el-switch v-model="order.need_mtest"></el-switch> <el-switch v-model="order.need_mtest"></el-switch>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button> <el-button type="danger" @click="dialogVisible = false">取消</el-button>
@ -185,7 +186,15 @@
</div> </div>
</template> </template>
<script> <script>
import { getOrderList, createOrder,updateOrder,deleteOrder,getContractList,getCustomerList,getContract } from "@/api/sam"; import {
getOrderList,
createOrder,
updateOrder,
deleteOrder,
getContractList,
getCustomerList,
getContract
} from "@/api/sam";
import {getMaterialList} from "@/api/mtm"; import {getMaterialList} from "@/api/mtm";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
@ -215,15 +224,12 @@ export default {
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
rule1: { rule1: {
product: [{required: true, message: "请输入", trigger: "blur"}], product: [{required: true, message: "请输入", trigger: "blur"}],
delivery_date: [{required: true, message: "请输入", trigger: "blur"}], delivery_date: [{required: true, message: "请输入", trigger: "blur"}],
}, },
}; };
}, },
computed: {},
watch: {},
created() { created() {
this.getListm(); this.getListm();
this.getListc(); this.getListc();
@ -244,50 +250,45 @@ export default {
}, },
getListm() { getListm() {
getMaterialList({pageoff: true, type: 1}).then((response) => { getMaterialList({pageoff: true, type: 1}).then((response) => {
this.productoptions = genTree(response.data); this.productoptions = genTree(response.data);
}); });
}, },
getListc() { getListc() {
getContractList({pageoff: true}).then((response) => { getContractList({pageoff: true}).then((response) => {
this.contractoptions = response.data; this.contractoptions = response.data;
}); });
}, },
getListcm() { getListcm() {
getCustomerList({pageoff: true}).then((response) => { getCustomerList({pageoff: true}).then((response) => {
this.customeroptions = genTree(response.data); this.customeroptions = genTree(response.data);
}); });
}, },
selectcontract(selval)
{ selectcontract(selval) {
getContract(selval).then((response) => { getContract(selval).then((response) => {
if (response.data) { if (response.data) {
console.log(response.data); // console.log(response.data);
this.order.customer = response.data.customer_.name; this.order.customer = response.data.customer_.name;
} }
}); });
}, },
handleFilter() { handleFilter() {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
page_size: 20, page_size: 20,
} };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.order = Object.assign({}, defaulteorder); this.order = Object.assign({}, defaulteorder);
this.dialogType = "new"; this.dialogType = "new";
@ -305,6 +306,7 @@ export default {
this.$refs["Form"].clearValidate(); this.$refs["Form"].clearValidate();
}); });
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -317,7 +319,7 @@ export default {
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
@ -347,6 +349,7 @@ export default {
} }
}); });
}, },
//订单详情 //订单详情
handleDetail(scope) { handleDetail(scope) {
this.$router.push({name: "orderdetail", params: {id: scope.row.id},}) this.$router.push({name: "orderdetail", params: {id: scope.row.id},})

View File

@ -2,9 +2,14 @@
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" <el-button
>新增销售发货</el-button v-if="checkPermission(['sale_create'])"
type="primary"
icon="el-icon-plus"
@click="handleCreate"
> >
新增销售发货
</el-button>
<el-input <el-input
v-model="listQuery.search" v-model="listQuery.search"
placeholder="客户名称" placeholder="客户名称"
@ -17,15 +22,17 @@
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleFilter" @click="handleFilter"
>搜索</el-button
> >
搜索
</el-button>
<el-button <el-button
class="filter-item" class="filter-item"
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="resetFilter" @click="resetFilter"
>重置</el-button
> >
重置
</el-button>
</div> </div>
</el-card> </el-card>
<el-card> <el-card>
@ -40,80 +47,71 @@
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="产品名称" show-overflow-tooltip> <el-table-column label="产品名称" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.product">{{ <template slot-scope="scope" v-if="scope.row.product">
scope.row.product_.name {{scope.row.product_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="产品型号" show-overflow-tooltip> <el-table-column label="产品型号" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.product">{{ <template slot-scope="scope" v-if="scope.row.product">
scope.row.product_.specification {{scope.row.product_.specification}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户名称" show-overflow-tooltip> <el-table-column label="客户名称" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.customer">{{ <template slot-scope="scope" v-if="scope.row.customer">
scope.row.customer_.name {{scope.row.customer_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单编号" show-overflow-tooltip> <el-table-column label="订单编号" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.order">{{ <template slot-scope="scope" v-if="scope.row.order">
scope.row.order_.number {{scope.row.order_.number }}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合同名称" show-overflow-tooltip> <el-table-column label="合同名称" show-overflow-tooltip>
<template slot-scope="scope" v-if="scope.row.order_">{{ <template slot-scope="scope" v-if="scope.row.order_">
scope.row.order_.contract_.name {{scope.row.order_.contract_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预计发货时间" prop="edelivery_date">
<el-table-column label="预计发货时间">
<template slot-scope="scope">{{ scope.row.edelivery_date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="预计发货数量"> <el-table-column label="预计发货数量" prop="count">
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column> </el-table-column>
<el-table-column label="实际发货数量"> <el-table-column label="实际发货数量" prop="count_real">
<template slot-scope="scope">{{ scope.row.count_real }}</template>
</el-table-column> </el-table-column>
<el-table-column label="是否审核"> <el-table-column label="是否审核">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.is_audited == false"></el-tag> <el-tag v-if="scope.row.is_audited == false"></el-tag>
<el-tag v-else></el-tag></template <el-tag v-else></el-tag>
> </template>
</el-table-column> </el-table-column>
<el-table-column label="收货人"> <el-table-column label="收货人" prop="receiver">
<template slot-scope="scope">{{ scope.row.receiver }}</template>
</el-table-column> </el-table-column>
<el-table-column label="收货人电话"> <el-table-column label="收货人电话" prop="receiver_phone">
<template slot-scope="scope">{{ scope.row.receiver_phone }}</template>
</el-table-column> </el-table-column>
<el-table-column label="收货人地址" show-overflow-tooltip> <el-table-column label="收货人地址" prop="receiver_address" show-overflow-tooltip>
<template slot-scope="scope">{{
scope.row.receiver_address
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
v-if="checkPermission(['warehouse_delete'])" v-if="checkPermission(['sale_create'])"
type="primary" type="primary"
@click="handleDetail(scope)" @click="handleDetail(scope)"
>详情</el-link
> >
详情
</el-link>
<el-link <el-link
v-if="scope.row.is_audited == false" v-if="checkPermission(['sale_hear'])&&scope.row.is_audited == false"
type="primary" type="primary"
@click="handleAudit(scope)" @click="handleAudit(scope)"
>审核</el-link
> >
审核
</el-link>
<el-link <el-link
v-if="scope.row.is_audited == false" v-if="checkPermission(['sale_delete'])&&scope.row.is_audited == false"
type="danger" type="danger"
@click="handleDelete(scope)" @click="handleDelete(scope)"
>删除</el-link
> >
删除
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -139,10 +137,10 @@
> >
<el-form-item label="关联订单" prop="name"> <el-form-item label="关联订单" prop="name">
<el-select <el-select
style="width: 100%"
v-model="sale.order" v-model="sale.order"
@change="selectorder" style="width: 100%"
placeholder="请选择" placeholder="请选择"
@change="selectorder"
> >
<el-option <el-option
v-for="item in orderoptions" v-for="item in orderoptions"
@ -155,12 +153,11 @@
</el-form-item> </el-form-item>
<el-form-item label="关联客户" prop="customer"> <el-form-item label="关联客户" prop="customer">
<el-select <el-select
style="width: 100%"
v-model="sale.customer" v-model="sale.customer"
@change="selectcustomer" style="width: 100%"
placeholder="请选择" placeholder="请选择"
:disabled="show" :disabled="show"
@change="selectcustomer"
> >
<el-option <el-option
v-for="item in customeroptions" v-for="item in customeroptions"
@ -174,15 +171,14 @@
<el-form-item label="关联合同" prop="contract"> <el-form-item label="关联合同" prop="contract">
<el-input v-model="sale.contract" placeholder="关联合同" :disabled="edit"/> <el-input v-model="sale.contract" placeholder="关联合同" :disabled="edit"/>
</el-form-item> </el-form-item>
<el-form-item label="所需产品" prop="product"> <el-form-item label="所需产品" prop="product">
<el-select <el-select
ref="btn"
v-model="sale.product"
:disabled="show" :disabled="show"
style="width: 100%" style="width: 100%"
v-model="sale.product"
@change="selectproduct"
placeholder="请选择" placeholder="请选择"
ref="btn" @change="selectproduct"
> >
<el-option <el-option
v-for="item in materialoptions" v-for="item in materialoptions"
@ -193,46 +189,41 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="选择产品" prop="iproducts"> <el-form-item label="选择产品" prop="iproducts">
<el-table <el-table
ref="multipleTable"
:data="iproductoptions" :data="iproductoptions"
border border
fit fit
stripe stripe
highlight-current-row highlight-current-row
ref="multipleTable"
height="200" height="200"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="成品编号"> <el-table-column label="成品编号" prop="number">
<template slot-scope="scope">{{ scope.row.number }}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品批次" prop="batch">
<el-table-column label="成品批次">
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column> </el-table-column>
<el-table-column label="成品名称"> <el-table-column label="成品名称">
<template slot-scope="scope">{{ <template slot-scope="scope">
scope.row.material_.name {{scope.row.material_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所在仓库"> <el-table-column label="所在仓库">
<template slot-scope="scope">{{ <template slot-scope="scope">
scope.row.warehouse_.name {{scope.row.warehouse_.name}}
}}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否已军检"> <el-table-column label="是否已军检">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.is_mtested == false">未军检</el-tag> <el-tag v-if="scope.row.is_mtested == false">未军检</el-tag>
<el-tag v-else>已军检</el-tag></template <el-tag v-else>已军检</el-tag>
> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
<el-form-item label="预计发货时间" prop="edelivery_date"> <el-form-item label="预计发货时间" prop="edelivery_date">
<el-date-picker <el-date-picker
v-model="sale.edelivery_date" v-model="sale.edelivery_date"
@ -295,12 +286,13 @@ import {
deleteSale, deleteSale,
getSale, getSale,
saleAudit, saleAudit,
getCustomer getCustomer,
updateContract
} from "@/api/sam"; } from "@/api/sam";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import {getMaterialList} from "@/api/mtm"; import {getMaterialList} from "@/api/mtm";
import {getiproductList} from "@/api/inm"; import {getiproductList} from "@/api/inm";
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 defaulteSale = { const defaulteSale = {
order: null, order: null,
@ -386,13 +378,11 @@ export default {
if (response.data) { if (response.data) {
this.show = true; this.show = true;
this.sale.customer = response.data.customer; this.sale.customer = response.data.customer;
this.sale.product = response.data.product; this.sale.product = response.data.product;
this.sale.contract = response.data.contract_.name; this.sale.contract = response.data.contract_.name;
this.sale.receiver = response.data.customer_.contact; this.sale.receiver = response.data.customer_.contact;
this.sale.receiver_phone = response.data.customer_.contact_phone; this.sale.receiver_phone = response.data.customer_.contact_phone;
this.sale.receiver_address = response.data.customer_.address; this.sale.receiver_address = response.data.customer_.address;
getiproductList({ getiproductList({
page: 0, page: 0,
to_order: response.data.id, to_order: response.data.id,
@ -405,18 +395,17 @@ export default {
} }
}); });
}, },
selectcustomer(selval)
{ selectcustomer(selval) {
getCustomer(selval).then((response) => { getCustomer(selval).then((response) => {
if (response.data) { if (response.data) {
this.sale.receiver = response.data.contact; this.sale.receiver = response.data.contact;
this.sale.receiver_phone = response.data.contact_phone; this.sale.receiver_phone = response.data.contact_phone;
this.sale.receiver_address = response.data.address; this.sale.receiver_address = response.data.address;
} }
}); });
}, },
getList() { getList() {
getSaleList(this.listQuery).then((response) => { getSaleList(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
@ -424,13 +413,14 @@ export default {
} }
}); });
}, },
//关联客户 //关联客户
getCustomerLists() { getCustomerLists() {
getCustomerList({page: 0}).then((response) => { getCustomerList({page: 0}).then((response) => {
this.customeroptions = response.data; this.customeroptions = response.data;
}); });
}, },
//选择产品 //选择产品
getMaterialList() { getMaterialList() {
getMaterialList({type: 1, page: 0}).then((response) => { getMaterialList({type: 1, page: 0}).then((response) => {
@ -467,6 +457,7 @@ export default {
this.listQuery.page = 1; this.listQuery.page = 1;
this.getList(); this.getList();
}, },
resetFilter() { resetFilter() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
@ -474,6 +465,7 @@ export default {
}; };
this.getList(); this.getList();
}, },
handleCreate() { handleCreate() {
this.sale = Object.assign({}, defaulteSale); this.sale = Object.assign({}, defaulteSale);
this.dialogType = "new"; this.dialogType = "new";
@ -487,13 +479,14 @@ export default {
handleEdit(scope) { handleEdit(scope) {
this.sale = Object.assign({}, scope.row); // copy obj this.sale = Object.assign({}, scope.row); // copy obj
console.log(this.sale); // console.log(this.sale);
this.dialogType = "edit"; this.dialogType = "edit";
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["Form"].resetFields(); this.$refs["Form"].resetFields();
}); });
}, },
handleDelete(scope) { handleDelete(scope) {
this.$confirm("确认删除?", "警告", { this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认", confirmButtonText: "确认",
@ -506,7 +499,7 @@ export default {
this.$message.success("成功"); this.$message.success("成功");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
@ -526,7 +519,6 @@ export default {
this.$refs.multipleTable.selection.forEach((item) => { this.$refs.multipleTable.selection.forEach((item) => {
this.iproducts.push(item.id); this.iproducts.push(item.id);
}); });
this.sale.iproducts = this.iproducts; this.sale.iproducts = this.iproducts;
createSale(this.sale).then((res) => { createSale(this.sale).then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
@ -549,7 +541,6 @@ export default {
//审核 //审核
handleAudit(scope) { handleAudit(scope) {
this.$confirm("确认审核?", "提示", { this.$confirm("确认审核?", "提示", {
confirmButtonText: "确认", confirmButtonText: "确认",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -561,13 +552,9 @@ export default {
this.$message.success("审核成功!"); this.$message.success("审核成功!");
}) })
.catch((err) => { .catch((err) => {
console.error(err); this.$message.error(err);
}); });
}, },
}, },
}; };
</script> </script>
@ -575,6 +562,7 @@ export default {
.trdiv >>> .el-transfer-panel { .trdiv >>> .el-transfer-panel {
width: 350px; width: 350px;
} }
.trdiv >>> .el-transfer__buttons { .trdiv >>> .el-transfer__buttons {
width: 110px; width: 110px;
} }