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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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