|
@@ -1,128 +1,174 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <Toptitle title='派工详情'>
|
|
|
- <Button @click="goBack"
|
|
|
- type='primary'
|
|
|
- ghost
|
|
|
- style="margin-right:10px;">返回</Button>
|
|
|
- <Button @click="handleDispatchConfirm"
|
|
|
- type='primary'
|
|
|
- style="margin-right:10px;">派工</Button>
|
|
|
+ <Toptitle title="派工详情">
|
|
|
+ <Button @click="goBack" type="primary" ghost style="margin-right:10px;"
|
|
|
+ >返回</Button
|
|
|
+ >
|
|
|
+ <Button
|
|
|
+ @click="handleDispatchConfirm"
|
|
|
+ type="primary"
|
|
|
+ style="margin-right:10px;"
|
|
|
+ >派工</Button
|
|
|
+ >
|
|
|
</Toptitle>
|
|
|
<div class="body">
|
|
|
<div class="header">
|
|
|
- <Form :label-width="85"
|
|
|
- :model="searchData">
|
|
|
+ <Form :label-width="85" :model="searchData">
|
|
|
<FormItem label="项目名称:">
|
|
|
- <Input type="text"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- v-model="searchData.client_name"
|
|
|
- placeholder="请输入项目名称"></Input>
|
|
|
+ <Input
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ v-model="searchData.client_name"
|
|
|
+ placeholder="请输入项目名称"
|
|
|
+ ></Input>
|
|
|
</FormItem>
|
|
|
<FormItem label="产品:">
|
|
|
- <Input type="text"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- v-model="searchData.product_title"
|
|
|
- placeholder="请输入产品"></Input>
|
|
|
+ <Select
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择产品"
|
|
|
+ v-model="searchData.product_title"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="(_product, _index) in productList"
|
|
|
+ :key="_index"
|
|
|
+ :value="_product"
|
|
|
+ :label="_product"
|
|
|
+ ></Option>
|
|
|
+ </Select>
|
|
|
</FormItem>
|
|
|
<FormItem label="部件:">
|
|
|
- <Input type="text"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- v-model="searchData.part_title"
|
|
|
- placeholder="请输入部件"></Input>
|
|
|
+ <Select
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ filter-by-label
|
|
|
+ placeholder="请选择部件"
|
|
|
+ v-model="searchData.part_title"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="(_part, _index) in partList"
|
|
|
+ :key="_index"
|
|
|
+ :value="_part"
|
|
|
+ :label="_part"
|
|
|
+ ></Option>
|
|
|
+ </Select>
|
|
|
</FormItem>
|
|
|
- <FormItem v-for="(item,index) in headerList"
|
|
|
- :key="item.title+index"
|
|
|
- :label="item.title">
|
|
|
- <Input type="text"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- v-model="item.value"
|
|
|
- :placeholder="'请输入'+item.title"></Input>
|
|
|
+ <FormItem
|
|
|
+ v-for="(item, index) in headerList"
|
|
|
+ :key="item.title + index"
|
|
|
+ :label="item.title"
|
|
|
+ >
|
|
|
+ <Input
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ v-model="item.value"
|
|
|
+ :placeholder="'请输入' + item.title"
|
|
|
+ ></Input>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
- <Button @click="initData"
|
|
|
- size="small"
|
|
|
- type='primary'
|
|
|
- style="margin-right:10px;">搜索</Button>
|
|
|
+ <Button
|
|
|
+ @click="handleSearch"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ style="margin-right:10px;"
|
|
|
+ >搜索</Button
|
|
|
+ >
|
|
|
</FormItem>
|
|
|
</Form>
|
|
|
</div>
|
|
|
<div class="info">
|
|
|
- <div><span>工序分类:</span><span>{{infoData.produce_type_title}}</span></div>
|
|
|
- <div><span>工序:</span><span>{{infoData.produce_title}}</span></div>
|
|
|
- <div><span>部件总数:</span><span>{{infoData.num||0}}</span></div>
|
|
|
- <div><span>批量设置班组:</span><span>
|
|
|
- <Select v-model="group_set_user_id"
|
|
|
- size="small"
|
|
|
- @on-change="handleSelectedGroupSelect"
|
|
|
- clearable
|
|
|
- style="width: 150px">
|
|
|
- <Option v-for="(sitem) in groupList"
|
|
|
- :key="sitem.id"
|
|
|
- :label="sitem.nickname"
|
|
|
- :value="sitem.id">
|
|
|
+ <div>
|
|
|
+ <span>工序分类:</span><span>{{ infoData.produce_type_title }}</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span>工序:</span><span>{{ infoData.produce_title }}</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span>部件总数:</span><span>{{ infoData.part_num || 0 }}</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span>批量设置班组:</span
|
|
|
+ ><span>
|
|
|
+ <Select
|
|
|
+ v-model="group_set_user_id"
|
|
|
+ size="small"
|
|
|
+ @on-change="handleSelectedGroupSelect"
|
|
|
+ clearable
|
|
|
+ style="width: 150px"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="sitem in groupList"
|
|
|
+ :key="sitem.id"
|
|
|
+ :label="sitem.nickname"
|
|
|
+ :value="sitem.id"
|
|
|
+ >
|
|
|
</Option>
|
|
|
</Select>
|
|
|
- </span></div>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
<div class="content_table">
|
|
|
- <Table :columns="set_tableColumns"
|
|
|
- border
|
|
|
- max-height="500"
|
|
|
- @on-selection-change="handleSelectionChange"
|
|
|
- :data="tableData">
|
|
|
- <template slot="slotGroup"
|
|
|
- slot-scope="{row,index}">
|
|
|
- <Select v-model="row.employee_id"
|
|
|
- size="small"
|
|
|
- @on-change="(e)=>handleGroupSelect(e,row,index)"
|
|
|
- clearable
|
|
|
- style="width: 150px">
|
|
|
- <Option v-for="(sitem) in groupList"
|
|
|
- :key="sitem.id"
|
|
|
- :label="sitem.nickname"
|
|
|
- :value="sitem.id">
|
|
|
+ <Table
|
|
|
+ :columns="set_tableColumns"
|
|
|
+ border
|
|
|
+ max-height="500"
|
|
|
+ @on-selection-change="handleSelectionChange"
|
|
|
+ :data="tableData"
|
|
|
+ >
|
|
|
+ <template slot="slotGroup" slot-scope="{ row, index }">
|
|
|
+ <Select
|
|
|
+ v-model="row.employee_id"
|
|
|
+ size="small"
|
|
|
+ @on-change="(e) => handleGroupSelect(e, row, index)"
|
|
|
+ clearable
|
|
|
+ style="width: 150px"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="sitem in groupList"
|
|
|
+ :key="sitem.id"
|
|
|
+ :label="sitem.nickname"
|
|
|
+ :value="sitem.id"
|
|
|
+ >
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</template>
|
|
|
- <template slot="slotSet"
|
|
|
- slot-scope="{row,index}">
|
|
|
- <a style="margin:0 5px"
|
|
|
- @click="handleSet(row,index)">详情</a>
|
|
|
+ <template slot="slotSet" slot-scope="{ row, index }">
|
|
|
+ <a style="margin:0 5px" @click="handleSet(row, index)">详情</a>
|
|
|
</template>
|
|
|
</Table>
|
|
|
</div>
|
|
|
<div class="pageSlotStyle">
|
|
|
- <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
|
|
|
- @on-page-size-change='changeSize'
|
|
|
- @on-change='changePage'
|
|
|
- :current='page_index'
|
|
|
- show-total
|
|
|
- :total="total"
|
|
|
- show-sizer
|
|
|
- :page-size='page_size' />
|
|
|
+ <Page
|
|
|
+ :page-size-opts="[10, 20, 30, 40, 100, 1000]"
|
|
|
+ @on-page-size-change="changeSize"
|
|
|
+ @on-change="changePage"
|
|
|
+ :current="page_index"
|
|
|
+ show-total
|
|
|
+ :total="total"
|
|
|
+ show-sizer
|
|
|
+ :page-size="page_size"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="footer"></div>
|
|
|
</div>
|
|
|
- <Modal v-model="showModal"
|
|
|
- title="确认派工">
|
|
|
- <Form :label-width="85"
|
|
|
- ref='forms'
|
|
|
- :model="dispatchInfo">
|
|
|
+ <Modal v-model="showModal" title="确认派工">
|
|
|
+ <Form :label-width="85" ref="forms" :model="dispatchInfo">
|
|
|
<FormItem label="选择时间">
|
|
|
- <DatePicker :options="options"
|
|
|
- style="width:100%;"
|
|
|
- v-model="dispatchTime"
|
|
|
- clearable
|
|
|
- type="daterange"
|
|
|
- split-panels
|
|
|
- placeholder="请选择日期"></DatePicker>
|
|
|
+ <DatePicker
|
|
|
+ :options="options"
|
|
|
+ style="width:100%;"
|
|
|
+ v-model="dispatchTime"
|
|
|
+ clearable
|
|
|
+ type="daterange"
|
|
|
+ split-panels
|
|
|
+ placeholder="请选择日期"
|
|
|
+ ></DatePicker>
|
|
|
</FormItem>
|
|
|
<FormItem label="点工单形式">
|
|
|
<RadioGroup v-model="dispatchInfo.work_type">
|
|
@@ -130,18 +176,15 @@
|
|
|
<Radio :label="0">否</Radio>
|
|
|
</RadioGroup>
|
|
|
</FormItem>
|
|
|
- <FormItem label="日薪"
|
|
|
- v-if="dispatchInfo.work_type == 1">
|
|
|
+ <FormItem label="日薪" v-if="dispatchInfo.work_type == 1">
|
|
|
<Input v-model="dispatchInfo.user_salary">
|
|
|
- <span slot="append">元</span>
|
|
|
+ <span slot="append">元</span>
|
|
|
</Input>
|
|
|
</FormItem>
|
|
|
-
|
|
|
</Form>
|
|
|
<div slot="footer">
|
|
|
<Button @click="showModal = false">取消</Button>
|
|
|
- <Button type="primary"
|
|
|
- @click="handleDispatch">确认</Button>
|
|
|
+ <Button type="primary" @click="handleDispatch">确认</Button>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
</div>
|
|
@@ -152,23 +195,26 @@
|
|
|
// 例如:import 《组件名称》 from '《组件路径》';
|
|
|
|
|
|
export default {
|
|
|
- name: '',
|
|
|
- components: {
|
|
|
-
|
|
|
- },
|
|
|
+ name: "",
|
|
|
+ components: {},
|
|
|
props: {},
|
|
|
// import引入的组件需要注入到对象中才能使用
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
// 这里存放数据
|
|
|
return {
|
|
|
- produce_id: this.$route.query.produce_id || '',
|
|
|
+ produce_id: this.$route.query.produce_id || "",
|
|
|
tableData: [],
|
|
|
tableColumns: [
|
|
|
- { type: 'selection', align: 'center', minWidth: 100, fixed: 'left' },
|
|
|
- { title: '订单号', align: 'center', key: 'order_no', minWidth: 150 },
|
|
|
- { title: '项目名称', align: 'center', key: 'client_name', minWidth: 150 },
|
|
|
- { title: '产品', align: 'center', key: 'product_title', minWidth: 150 },
|
|
|
- { title: '部件', align: 'center', key: 'part_title', minWidth: 150 },
|
|
|
+ { type: "selection", align: "center", minWidth: 100, fixed: "left" },
|
|
|
+ { title: "订单号", align: "center", key: "order_no", minWidth: 150 },
|
|
|
+ {
|
|
|
+ title: "项目名称",
|
|
|
+ align: "center",
|
|
|
+ key: "client_name",
|
|
|
+ minWidth: 150,
|
|
|
+ },
|
|
|
+ { title: "产品", align: "center", key: "product_title", minWidth: 150 },
|
|
|
+ { title: "部件", align: "center", key: "part_title", minWidth: 150 },
|
|
|
],
|
|
|
tableColumnsAdd: [],
|
|
|
page_index: 1,
|
|
@@ -176,195 +222,254 @@ export default {
|
|
|
total: 0,
|
|
|
groupList: [],
|
|
|
searchData: {
|
|
|
- client_name: '',
|
|
|
- product_title: '',
|
|
|
- part_title: '',
|
|
|
+ client_name: "",
|
|
|
+ product_title: "",
|
|
|
+ part_title: "",
|
|
|
},
|
|
|
infoData: {},
|
|
|
selected: [],
|
|
|
showModal: false,
|
|
|
dispatchTime: [],
|
|
|
dispatchInfo: {},
|
|
|
- group_set_user_id: '',
|
|
|
+ group_set_user_id: "",
|
|
|
options: {
|
|
|
- disabledDate (date) {
|
|
|
+ disabledDate(date) {
|
|
|
return date && date.valueOf() < Date.now() - 86400000;
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
- headerList: []
|
|
|
- }
|
|
|
+ headerList: [],
|
|
|
+ productList: [],
|
|
|
+ partList: [],
|
|
|
+ };
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
//获取班组列表
|
|
|
- this.axios('/api/employee_list', { params: { type: 3 } }).then(res => this.groupList = res.data)
|
|
|
+ this.axios("/api/employee_list", { params: { type: 3 } }).then(
|
|
|
+ (res) => (this.groupList = res.data)
|
|
|
+ );
|
|
|
},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted () {
|
|
|
- this.initData()
|
|
|
+ mounted() {
|
|
|
+ this.initData();
|
|
|
},
|
|
|
methods: {
|
|
|
- initData () {
|
|
|
+ initData() {
|
|
|
this.axios({
|
|
|
- method: 'get',
|
|
|
- url: '/api/order_produce_detail',
|
|
|
+ method: "get",
|
|
|
+ url: "/api/order_produce_detail",
|
|
|
params: {
|
|
|
produce_id: this.produce_id,
|
|
|
page_index: this.page_index,
|
|
|
page_size: this.page_size,
|
|
|
...this.searchData,
|
|
|
- process: this.headerList | []
|
|
|
+ process: this.headerList | [],
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.tableColumnsAdd = [];
|
|
|
+ this.headerList = [];
|
|
|
+ for (const key in res.data.header.process) {
|
|
|
+ const element = res.data.header.process[key];
|
|
|
+ this.tableColumnsAdd.push({
|
|
|
+ title: element,
|
|
|
+ align: "center",
|
|
|
+ key: key,
|
|
|
+ minWidth: 150,
|
|
|
+ });
|
|
|
+ this.headerList.push({ title: element, key: key, value: "" });
|
|
|
+ }
|
|
|
+ this.productList = res.data.header.product_list;
|
|
|
+ this.partList = res.data.header.part_list;
|
|
|
+ this.infoData = res.data.detail;
|
|
|
+ this.tableData = res.data.data;
|
|
|
+ this.tableData.forEach((element) => {
|
|
|
+ Object.assign(element, element.process);
|
|
|
+ element.order_produce_id = element.id;
|
|
|
+ element.employee_id = element.employee_id || 0;
|
|
|
+ });
|
|
|
+ this.total = res.data.total;
|
|
|
}
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSearch() {
|
|
|
+ this.axios({
|
|
|
+ method: "get",
|
|
|
+ url: "/api/order_produce_detail",
|
|
|
+ params: {
|
|
|
+ produce_id: this.produce_id,
|
|
|
+ page_index: this.page_index,
|
|
|
+ page_size: this.page_size,
|
|
|
+ ...this.searchData,
|
|
|
+ // process: JSON.stringify(this.headerList),
|
|
|
+ process: JSON.stringify(this.headerList),
|
|
|
+ },
|
|
|
}).then((res) => {
|
|
|
- this.tableColumnsAdd = []
|
|
|
- this.headerList = []
|
|
|
- for (const key in res.data.header.process) {
|
|
|
- const element = res.data.header.process[key];
|
|
|
- this.tableColumnsAdd.push(
|
|
|
- { title: element, align: 'center', key: key, minWidth: 150 }
|
|
|
- )
|
|
|
- this.headerList.push({ title: element, key: key, value: '' })
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.tableData = res.data.data;
|
|
|
+ this.tableData.forEach((element) => {
|
|
|
+ Object.assign(element, element.process);
|
|
|
+ element.order_produce_id = element.id;
|
|
|
+ element.employee_id = element.employee_id || 0;
|
|
|
+ });
|
|
|
+ this.total = res.data.total;
|
|
|
}
|
|
|
- this.infoData = res.data.detail
|
|
|
- this.tableData = res.data.data
|
|
|
- this.tableData.forEach(element => {
|
|
|
- Object.assign(element, element.process)
|
|
|
- element.order_produce_id = element.id
|
|
|
- element.employee_id = element.employee_id || 0
|
|
|
- });
|
|
|
- this.total = res.data.total
|
|
|
- }).catch((err) => { });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goBack() {
|
|
|
+ this.$router.go(-1);
|
|
|
},
|
|
|
- goBack () { this.$router.go(-1) },
|
|
|
- handleSelectionChange (selection) {
|
|
|
- this.selected = selection
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.selected = selection;
|
|
|
},
|
|
|
- handleGroupSelect (e, row, index) {
|
|
|
+ handleGroupSelect(e, row, index) {
|
|
|
if (this.selected.length > 0) {
|
|
|
- this.selected.forEach(element => {
|
|
|
+ this.selected.forEach((element) => {
|
|
|
if (element.id == row.id) {
|
|
|
- element.employee_id = row.employee_id
|
|
|
+ element.employee_id = row.employee_id;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- this.tableData[index].employee_id = e
|
|
|
+ this.tableData[index].employee_id = e;
|
|
|
},
|
|
|
- handleSelectedGroupSelect (e) {
|
|
|
+ handleSelectedGroupSelect(e) {
|
|
|
if (this.selected.length > 0) {
|
|
|
this.selected.forEach((item) => {
|
|
|
- item.employee_id = JSON.parse(JSON.stringify(e))
|
|
|
+ item.employee_id = JSON.parse(JSON.stringify(e));
|
|
|
this.tableData.forEach((element, index) => {
|
|
|
if (element.id == item.id) {
|
|
|
- element.employee_id = item.employee_id
|
|
|
- this.tableData.splice(index, 1, item)
|
|
|
+ element.employee_id = item.employee_id;
|
|
|
+ this.tableData.splice(index, 1, item);
|
|
|
}
|
|
|
});
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
- this.selected = []
|
|
|
+ this.selected = [];
|
|
|
},
|
|
|
- handleDispatchConfirm () {
|
|
|
+ handleDispatchConfirm() {
|
|
|
if (this.selected.length == 0) {
|
|
|
- this.$Message.warning('请选择数据')
|
|
|
+ this.$Message.warning("请选择数据");
|
|
|
} else {
|
|
|
- let flag = true
|
|
|
- console.log(' this.selected :>> ', this.selected);
|
|
|
- this.selected.forEach(element => {
|
|
|
+ let flag = true;
|
|
|
+ console.log(" this.selected :>> ", this.selected);
|
|
|
+ this.selected.forEach((element) => {
|
|
|
if (!element.employee_id) {
|
|
|
- flag = false
|
|
|
+ flag = false;
|
|
|
}
|
|
|
});
|
|
|
if (flag) {
|
|
|
- this.showModal = true
|
|
|
+ this.showModal = true;
|
|
|
} else {
|
|
|
- this.$Message.warning('请选择班组')
|
|
|
+ this.$Message.warning("请选择班组");
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- handleDispatch () {
|
|
|
+ handleDispatch() {
|
|
|
if (!this.dispatchTime[0]) {
|
|
|
- this.$Message.warning('请选择起始时间')
|
|
|
+ this.$Message.warning("请选择起始时间");
|
|
|
} else {
|
|
|
- this.dispatchInfo.start_time = new Date(this.dispatchTime[0]).toLocaleDateString().replace(/\//g, "-")
|
|
|
- this.dispatchInfo.end_time = new Date(this.dispatchTime[1]).toLocaleDateString().replace(/\//g, "-")
|
|
|
- const subArr = []
|
|
|
- this.selected.forEach(element => {
|
|
|
- element.start_time = this.dispatchInfo.start_time
|
|
|
- element.end_time = this.dispatchInfo.end_time
|
|
|
- element.work_type = this.dispatchInfo.work_type
|
|
|
- subArr.push({ start_time: element.start_time, end_time: element.end_time, work_type: element.work_type, employee_id: element.employee_id, order_produce_id: element.order_produce_id, user_salary: element.user_salary })
|
|
|
+ this.dispatchInfo.start_time = new Date(this.dispatchTime[0])
|
|
|
+ .toLocaleDateString()
|
|
|
+ .replace(/\//g, "-");
|
|
|
+ this.dispatchInfo.end_time = new Date(this.dispatchTime[1])
|
|
|
+ .toLocaleDateString()
|
|
|
+ .replace(/\//g, "-");
|
|
|
+ const subArr = [];
|
|
|
+ this.selected.forEach((element) => {
|
|
|
+ element.start_time = this.dispatchInfo.start_time;
|
|
|
+ element.end_time = this.dispatchInfo.end_time;
|
|
|
+ element.work_type = this.dispatchInfo.work_type;
|
|
|
+ subArr.push({
|
|
|
+ start_time: element.start_time,
|
|
|
+ end_time: element.end_time,
|
|
|
+ work_type: element.work_type,
|
|
|
+ employee_id: element.employee_id,
|
|
|
+ order_produce_id: element.order_produce_id,
|
|
|
+ user_salary: element.user_salary,
|
|
|
+ });
|
|
|
});
|
|
|
this.axios({
|
|
|
- method: 'post',
|
|
|
- url: '/api/order_produce_pull',
|
|
|
+ method: "post",
|
|
|
+ url: "/api/order_produce_pull",
|
|
|
data: {
|
|
|
- ...subArr
|
|
|
- }
|
|
|
- }).then((res) => {
|
|
|
- this.showModal = false
|
|
|
- this.$Message.success(res.msg)
|
|
|
- this.initData()
|
|
|
- }).catch((err) => { });
|
|
|
+ ...subArr,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.showModal = false;
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.initData();
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
}
|
|
|
},
|
|
|
- changePage (e) {
|
|
|
+ changePage(e) {
|
|
|
this.page_index = e;
|
|
|
- this.initData()
|
|
|
+ this.initData();
|
|
|
},
|
|
|
- changeSize (e) {
|
|
|
+ changeSize(e) {
|
|
|
this.page_size = e;
|
|
|
- this.initData()
|
|
|
+ this.initData();
|
|
|
},
|
|
|
},
|
|
|
// 监听属性 类似于data概念
|
|
|
computed: {
|
|
|
- set_tableColumns () {
|
|
|
+ set_tableColumns() {
|
|
|
return [
|
|
|
...this.tableColumns,
|
|
|
...this.tableColumnsAdd,
|
|
|
{
|
|
|
- title: '班组', align: 'center', key: 'title', minWidth: 200,
|
|
|
+ title: "班组",
|
|
|
+ align: "center",
|
|
|
+ key: "title",
|
|
|
+ minWidth: 200,
|
|
|
render: (h, params) => {
|
|
|
- const { row, index } = params
|
|
|
- const currencyRow = this.tableData[index]
|
|
|
- return h('Select', {
|
|
|
- props: {
|
|
|
- value: currencyRow.employee_id,
|
|
|
- size: 'small'
|
|
|
+ const { row, index } = params;
|
|
|
+ const currencyRow = this.tableData[index];
|
|
|
+ return h(
|
|
|
+ "Select",
|
|
|
+ {
|
|
|
+ props: {
|
|
|
+ value: currencyRow.employee_id,
|
|
|
+ size: "small",
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ "on-change": (e) => {
|
|
|
+ currencyRow.employee_id = e;
|
|
|
+ this.selected.forEach((element) => {
|
|
|
+ if (element.id == currencyRow.id) {
|
|
|
+ element.employee_id = e;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
- on: {
|
|
|
- 'on-change': (e) => {
|
|
|
- currencyRow.employee_id = e
|
|
|
- this.selected.forEach(element => {
|
|
|
- if (element.id == currencyRow.id) {
|
|
|
- element.employee_id = e
|
|
|
- }
|
|
|
+ [
|
|
|
+ this.groupList.map((item) => {
|
|
|
+ return h("Option", {
|
|
|
+ props: { label: item.nickname, value: item.id },
|
|
|
});
|
|
|
- }
|
|
|
- }
|
|
|
- }, [
|
|
|
- this.groupList.map((item) => {
|
|
|
- return h('Option', { props: { label: item.nickname, value: item.id } })
|
|
|
- })
|
|
|
- ])
|
|
|
- }
|
|
|
+ }),
|
|
|
+ ]
|
|
|
+ );
|
|
|
+ },
|
|
|
},
|
|
|
- ]
|
|
|
- }
|
|
|
+ ];
|
|
|
+ },
|
|
|
},
|
|
|
// 监控data中的数据变化
|
|
|
watch: {},
|
|
|
- beforeCreate () { }, // 生命周期 - 创建之前
|
|
|
- beforeMount () { }, // 生命周期 - 挂载之前
|
|
|
- beforeUpdate () { }, // 生命周期 - 更新之前
|
|
|
- updated () { }, // 生命周期 - 更新之后
|
|
|
- beforeDestroy () { }, // 生命周期 - 销毁之前
|
|
|
- destroyed () { }, // 生命周期 - 销毁完成
|
|
|
- activated () { }, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
-}
|
|
|
+ beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
+ beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
+ updated() {}, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, // 生命周期 - 销毁之前
|
|
|
+ destroyed() {}, // 生命周期 - 销毁完成
|
|
|
+ activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
-<style lang='scss' scoped>
|
|
|
+<style lang="scss" scoped>
|
|
|
.pageSlotStyle {
|
|
|
display: flex;
|
|
|
justify-content: center;
|