|
@@ -1,114 +1,277 @@
|
|
|
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <Toptitle title="生产排产详情">
|
|
|
- <Button @click="$router.go(-1)">返回</Button>
|
|
|
- </Toptitle>
|
|
|
- <Form :label-width='100' style="margin-top:10px;display:flex;flex-wrap:wrap">
|
|
|
- <FormItem label='图号:'>
|
|
|
- <Input clearable style="width:200px" placeholder="请输入图号"/>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='组件:'>
|
|
|
- <Input clearable style="width:200px" placeholder="请输入组件"/>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='房号:'>
|
|
|
- <Input clearable style="width:200px" placeholder="请输入房号"/>
|
|
|
- </FormItem>
|
|
|
- <FormItem label='派工状态:'>
|
|
|
- <Select filterable clearable v-model="searchData.state" style="width:200px">
|
|
|
- <Option label="未派工" :value="0"></Option>
|
|
|
- <Option label="已派工" :value="1"></Option>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem :label-width='30'>
|
|
|
- <Button type="primary" @click="handleSearch">搜索</Button>
|
|
|
- </FormItem>
|
|
|
- </Form>
|
|
|
- <Table border :data='tableData' :columns='tableColumns' max-height='550'>
|
|
|
- <template slot="img" slot-scope="{row}">
|
|
|
- <img v-for="(item,index) in row.url_img" :key="index" :src="$store.state.ip+item" alt="">
|
|
|
- </template>
|
|
|
- <template slot="set" slot-scope="{row}">
|
|
|
- <a @click="goPage(row)">详情</a>
|
|
|
- </template>
|
|
|
- </Table>
|
|
|
- <Page
|
|
|
- style="text-align:center;margin-top:10px"
|
|
|
- :page-size-opts="[10, 20, 30, 40, 100]"
|
|
|
- @on-page-size-change="changeSize"
|
|
|
- @on-change="changePage"
|
|
|
- :current="pageIndex"
|
|
|
- show-total
|
|
|
- show-elevator
|
|
|
- :total="total"
|
|
|
- show-sizer
|
|
|
- :page-size="pageSize"
|
|
|
+ <div>
|
|
|
+ <Toptitle title="生产排产详情">
|
|
|
+ <Button
|
|
|
+ @click="$router.go(-1)"
|
|
|
+ style="margin-right:10px"
|
|
|
+ >返回</Button>
|
|
|
+ <Button
|
|
|
+ @click="handlePlanWork"
|
|
|
+ type="primary"
|
|
|
+ >批量派工</Button>
|
|
|
+ </Toptitle>
|
|
|
+ <Form
|
|
|
+ :label-width='100'
|
|
|
+ style="margin-top:10px;display:flex;flex-wrap:wrap"
|
|
|
+ >
|
|
|
+ <FormItem label='图号:'>
|
|
|
+ <Input
|
|
|
+ clearable
|
|
|
+ style="width:200px"
|
|
|
+ placeholder="请输入图号"
|
|
|
/>
|
|
|
- </div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label='组件:'>
|
|
|
+ <Input
|
|
|
+ clearable
|
|
|
+ style="width:200px"
|
|
|
+ placeholder="请输入组件"
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label='房号:'>
|
|
|
+ <Input
|
|
|
+ clearable
|
|
|
+ style="width:200px"
|
|
|
+ placeholder="请输入房号"
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label='派工状态:'>
|
|
|
+ <Select
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ v-model="searchData.state"
|
|
|
+ style="width:200px"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ label="未派工"
|
|
|
+ :value="0"
|
|
|
+ ></Option>
|
|
|
+ <Option
|
|
|
+ label="已派工"
|
|
|
+ :value="1"
|
|
|
+ ></Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem :label-width='30'>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ @click="handleSearch"
|
|
|
+ >搜索</Button>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
+ <Table
|
|
|
+ border
|
|
|
+ :data='tableData'
|
|
|
+ :columns='tableColumns'
|
|
|
+ max-height='550'
|
|
|
+ @on-selection-change='handleSelect'
|
|
|
+ >
|
|
|
+ <template
|
|
|
+ slot="img"
|
|
|
+ slot-scope="{row}"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ v-for="(item,index) in row.url_img"
|
|
|
+ :key="index"
|
|
|
+ :src="$store.state.ip+item"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template
|
|
|
+ slot="set"
|
|
|
+ slot-scope="{row}"
|
|
|
+ >
|
|
|
+ <a @click="goPage(row)">详情</a>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ <Page
|
|
|
+ style="text-align:center;margin-top:10px"
|
|
|
+ :page-size-opts="[10, 20, 30, 40, 100]"
|
|
|
+ @on-page-size-change="changeSize"
|
|
|
+ @on-change="changePage"
|
|
|
+ :current="pageIndex"
|
|
|
+ show-total
|
|
|
+ show-elevator
|
|
|
+ :total="total"
|
|
|
+ show-sizer
|
|
|
+ :page-size="pageSize"
|
|
|
+ />
|
|
|
+ <Modal
|
|
|
+ v-model="show_work"
|
|
|
+ title="确认派工"
|
|
|
+ >
|
|
|
+ <Form
|
|
|
+ :label-width="85"
|
|
|
+ ref="forms"
|
|
|
+ >
|
|
|
+ <FormItem label="选择时间">
|
|
|
+ <DatePicker
|
|
|
+ style="width:100%;"
|
|
|
+ v-model="dispatchTime"
|
|
|
+ clearable
|
|
|
+ type="daterange"
|
|
|
+ split-panels
|
|
|
+ placeholder="请选择日期"
|
|
|
+ ></DatePicker>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label='班组'>
|
|
|
+ <Select
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ v-model="modalData.employee_id"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="(item,index) in employeeList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.nickname"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="点工单形式">
|
|
|
+ <RadioGroup v-model="modalData.work_type">
|
|
|
+ <Radio :label="1">是</Radio>
|
|
|
+ <Radio :label="0">否</Radio>
|
|
|
+ </RadioGroup>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ label="日薪"
|
|
|
+ v-if="modalData.work_type==1"
|
|
|
+ >
|
|
|
+ <Input v-model="modalData.user_salary">
|
|
|
+ <span slot="append">元</span>
|
|
|
+ </Input>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
+ <div slot="footer">
|
|
|
+ <Button @click="show_work = false">取消</Button>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ @click="handleDispatch"
|
|
|
+ >确认</Button>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
export default {
|
|
|
- data(){
|
|
|
- return{
|
|
|
- searchData:{},
|
|
|
- total:0,
|
|
|
- pageSize:10,
|
|
|
- pageIndex:1,
|
|
|
- tableData:[{
|
|
|
- order_no:'订单',
|
|
|
- url_number:'01',
|
|
|
- assembly:'产品组件',
|
|
|
- house_number:'房号',
|
|
|
- url_img:[],
|
|
|
- }],
|
|
|
- tableColumns:[
|
|
|
- {title:'订单号',key:'order_no',align:'center',minWidth:120},
|
|
|
- {title:'图号',key:'url_number',align:'center',minWidth:120},
|
|
|
- {title:'产品名称',key:'product_title',align:'center',minWidth:120},
|
|
|
- {title:'产品组件',key:'compose_name',align:'center',minWidth:120},
|
|
|
- {title:'房号',key:'house_title',align:'center',minWidth:120},
|
|
|
- {title:'图纸',key:'url_img',align:'center',minWidth:120,slot:'img'},
|
|
|
- {title:'派工状态',key:'state',align:'center',minWidth:120,render:(h,params)=>{
|
|
|
- const {row} = params;
|
|
|
- return h('span',{},row.state==0?'未派工':'已派工')
|
|
|
- }},
|
|
|
- {title:'操作',key:'set',align:'center',minWidth:120,slot:'set'},
|
|
|
- ],
|
|
|
- proxyData:{}
|
|
|
- }
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ employeeList: [],
|
|
|
+ dispatchTime: [],
|
|
|
+ modalData: {
|
|
|
+ work_type: '',
|
|
|
+ user_salary: '',
|
|
|
+ start_time: '',
|
|
|
+ end_time: '',
|
|
|
+ employee_id: '',
|
|
|
+ },
|
|
|
+ selectData: [],
|
|
|
+ show_work: false,
|
|
|
+ searchData: {},
|
|
|
+ total: 0,
|
|
|
+ pageSize: 10,
|
|
|
+ pageIndex: 1,
|
|
|
+ tableData: [{
|
|
|
+ order_no: '订单',
|
|
|
+ url_number: '01',
|
|
|
+ assembly: '产品组件',
|
|
|
+ house_number: '房号',
|
|
|
+ url_img: [],
|
|
|
+ }],
|
|
|
+ tableColumns: [
|
|
|
+ { type: 'selection', align: 'center', minWidth: 80 },
|
|
|
+ { title: '订单号', key: 'order_no', align: 'center', minWidth: 120 },
|
|
|
+ { title: '图号', key: 'url_number', align: 'center', minWidth: 120 },
|
|
|
+ { title: '产品名称', key: 'product_title', align: 'center', minWidth: 120 },
|
|
|
+ { title: '产品组件', key: 'compose_name', align: 'center', minWidth: 120 },
|
|
|
+ { title: '房号', key: 'house_title', align: 'center', minWidth: 120 },
|
|
|
+ { title: '图纸', key: 'url_img', align: 'center', minWidth: 120, slot: 'img' },
|
|
|
+ {
|
|
|
+ title: '派工状态', key: 'state', align: 'center', minWidth: 120, render: (h, params) => {
|
|
|
+ const { row } = params;
|
|
|
+ return h('span', {}, row.state == 0 ? '未派工' : '已派工')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { title: '操作', key: 'set', align: 'center', minWidth: 120, slot: 'set' },
|
|
|
+ ],
|
|
|
+ proxyData: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //获取班组
|
|
|
+ this.axios("/api/employee_list").then(
|
|
|
+ (res) => (this.employeeList = res.data.data)
|
|
|
+ );
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.initData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleDispatch() {
|
|
|
+ if (this.dispatchTime.length != 2) {
|
|
|
+ this.$Message.warning('请先选择时间!')
|
|
|
+ } else {
|
|
|
+ this.modalData.start_time = new Date(this.dispatchTime[0])
|
|
|
+ .toLocaleDateString()
|
|
|
+ .replace(/\//g, "-");
|
|
|
+ this.modalData.end_time = new Date(this.dispatchTime[1])
|
|
|
+ .toLocaleDateString()
|
|
|
+ .replace(/\//g, "-");
|
|
|
+ }
|
|
|
+ this.selectData.forEach((v, index) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.axios.post('/api/order_produce_pull_all', { ...v, ...this.modalData }).then(res => {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ if (index == this.selectData.length - 1) {
|
|
|
+ this.initData(this.proxyData);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ this.show_work = false;
|
|
|
},
|
|
|
- mounted(){
|
|
|
- this.initData();
|
|
|
+ handleSelect(e) {
|
|
|
+ this.selectData = e;
|
|
|
},
|
|
|
- methods:{
|
|
|
- handleSearch(){
|
|
|
- this.proxyData = JSON.parse(JSON.stringify(this.searchData));
|
|
|
- this.pageIndex=1;
|
|
|
- this.initData(this.proxyData);
|
|
|
- },
|
|
|
- goPage(row){
|
|
|
- this.$router.push({path:'/cms/productionorderlist/productionplanlist/details',query:{...this.$route.query,house_id:row.house_id,
|
|
|
-compose_name:row.compose_name,
|
|
|
-url_number:row.url_number}})
|
|
|
- },
|
|
|
- initData(obj){
|
|
|
- this.axios.post('/api/new_product_scheduling_list',{order_no:this.$route.query.order_no,...obj,page_size:this.pageSize,page_index:this.pageIndex}).then(res=>{
|
|
|
- this.tableData = res.data.data;
|
|
|
- this.total = res.data.total;
|
|
|
- })
|
|
|
- },
|
|
|
- changeSize(e){
|
|
|
- this.pageSize = e;
|
|
|
- this.pageIndex = 1;
|
|
|
- this.initData(this.proxyData);
|
|
|
- },
|
|
|
- changePage(e){
|
|
|
- this.pageIndex = e;
|
|
|
- this.initData(this.proxyData);
|
|
|
+ handlePlanWork() {
|
|
|
+ if (this.selectData.length == 0) {
|
|
|
+ return this.$Message.warning('请先选择数据!')
|
|
|
+ }
|
|
|
+ this.show_work = true;
|
|
|
+ },
|
|
|
+ handleSearch() {
|
|
|
+ this.proxyData = JSON.parse(JSON.stringify(this.searchData));
|
|
|
+ this.pageIndex = 1;
|
|
|
+ this.initData(this.proxyData);
|
|
|
+ },
|
|
|
+ goPage(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/cms/productionorderlist/productionplanlist/details', query: {
|
|
|
+ ...this.$route.query, house_id: row.house_id,
|
|
|
+ compose_name: row.compose_name,
|
|
|
+ url_number: row.url_number
|
|
|
}
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initData(obj) {
|
|
|
+ this.axios.post('/api/new_product_scheduling_list', { order_no: this.$route.query.order_no, ...obj, page_size: this.pageSize, page_index: this.pageIndex }).then(res => {
|
|
|
+ this.tableData = res.data.data;
|
|
|
+ this.total = res.data.total;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeSize(e) {
|
|
|
+ this.pageSize = e;
|
|
|
+ this.pageIndex = 1;
|
|
|
+ this.initData(this.proxyData);
|
|
|
+ },
|
|
|
+ changePage(e) {
|
|
|
+ this.pageIndex = e;
|
|
|
+ this.initData(this.proxyData);
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-
|
|
|
</style>
|