作者 雷海东

生产计划查看、派工

... ... @@ -80,6 +80,14 @@ export function selectUp(url,parameter){
params: parameter
})
}
//新增派工
export function addPg(url,parameter){
return axios({
url:url,
method:'post',
data:parameter
})
}
//生产计划查看
export function queryBynumber(url,parameter){
return axios({
... ...
... ... @@ -232,8 +232,10 @@
* https://github.com/zhangdaiscott/jeecg-boot/issues/1779
*/
/deep/ .imgupload .iconp{padding:20px;}
/* /deep/ */
.imgupload .iconp{padding:20px;}
/* update--end--autor:lvdandan-----date:20201016------for:j-image-upload图片组件单张图片详情回显空白*/
/deep/ .image-upload-single-over .ant-upload-select{display: none}
/* /deep/ */
.image-upload-single-over .ant-upload-select{display: none}
</style>
... ...
... ... @@ -261,6 +261,12 @@ export const JeecgListMixin = {
this.$refs.modalForm.title = "新增";
this.$refs.modalForm.disableSubmit = false;
},
//新增派工
handleAddpg:function(record){
this.$refs.pgModalForm.add(record)
this.$refs.pgModalForm.title="派工"
this.$refs.pgModalForm.disableSubmit = false;
},
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
//TODO 筛选
... ...
... ... @@ -16,7 +16,10 @@
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="产品类型">
<j-input placeholder="请输入产品类型" v-model="queryParam.productType"></j-input>
<!-- <j-input placeholder="请选择产品类型" v-model="queryParam.productType"></j-input> -->
<a-select size="small" v-model="queryParam.productType" placeholder="请选择产品类型" allowClear>
<a-select-option v-for="(item,index) in options" :key="index" :value="item.productTypeName">{{ item.productTypeName }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
... ... @@ -50,12 +53,12 @@
ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"
></j-super-query> -->
<a-dropdown v-if="selectedRowKeys.length > 0">
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-dropdown> -->
</div>
<!-- table区域-begin -->
... ... @@ -77,7 +80,7 @@
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio' }"
class="j-table-force-nowrap"
@change="handleTableChange"
>
... ... @@ -105,7 +108,7 @@
<span slot="action" slot-scope="text, record">
<a @click="handleDetail2(record)">查看</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">派工</a>
<a @click="handleAddpg(record)">派工</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">验收</a>
</span>
... ... @@ -113,6 +116,7 @@
</div>
<tbl-production-plan-modal ref="modalForm" @ok="modalFormOk"></tbl-production-plan-modal>
<TblProductionAddpg ref="pgModalForm" @ok="modalFormOk"></TblProductionAddpg>
</a-card>
</template>
... ... @@ -121,15 +125,17 @@ import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TblProductionPlanModal from './planModules/TblProductionPlanModal'
import TblProductionAddpg from './planModules/TblProductionAddpg.vue'
import {listProductType} from '@/api/ProductTpye'
export default {
name: 'TblProductionPlanList',
mixins: [JeecgListMixin, mixinDevice],
components: {
TblProductionPlanModal,
TblProductionPlanModal,TblProductionAddpg
},
data() {
return {
options:[],
description: 'tbl_production_plan管理页面',
// 表头
columns: [
... ... @@ -167,6 +173,21 @@ export default {
title: '产品类型',
align: 'center',
dataIndex: 'productType',
customRender :function(text){
if(text === 'JD'){
return '接地'
}else if(text === 'XC'){
return '线槽'
}else if(text === 'QZ'){
return '卡子'
}else if(text === 'SJ'){
return '司机室'
}else if(text === 'GX'){
return '柜、箱、盒'
}else if(text === 'FS'){
return '附属钢'
}
}
},
{
title: '任务下达时间',
... ... @@ -229,6 +250,7 @@ export default {
},
created() {
this.getSuperFieldList()
this.loadTree()
},
computed: {
importExcelUrl: function () {
... ... @@ -236,6 +258,15 @@ export default {
},
},
methods: {
loadTree(){
var that = this;
listProductType().then((res)=>{
if(res.success){
// that.treeData = [];
that.options = res.result
}
});
},
initDictConfig() {},
getSuperFieldList() {
let fieldList = []
... ...
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<TblProductionAddpgForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></TblProductionAddpgForm>
</j-modal>
</template>
<script>
import TblProductionAddpgForm from './TblProductionAddpgForm'
export default {
name: 'TblProductionAddpg',
components: {
TblProductionAddpgForm
},
data () {
return {
title:"操作",
width:670,
visible: false,
disableSubmit: false
}
},
methods: {
add (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(record);
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
\ No newline at end of file
... ...
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<!-- 接地表 -->
<table style="width: 100%; text-align: center" border v-if="productType === 'JD'">
<tr>
<th style="width: 200px">工序</th>
<th style="width: 200px">承接人</th>
<th style="width: 200px">工时</th>
</tr>
<!-- 接地激光 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.jiedijig"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item.userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjig" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 接地锯床 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.jiedijuc"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjuc" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 接地钳工 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.jiediqg"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursqg" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 接地焊工 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.jiedihg"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerhg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHourshg" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
</table>
<!-- 线槽表 -->
<table style="width: 100%; text-align: center" border v-if="productType === 'XC'">
<tr>
<th style="width: 200px">工序</th>
<th style="width: 200px">承接人</th>
<th style="width: 200px">工时</th>
</tr>
<!-- 线槽激光 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.xiancjig"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjig" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 线槽锯床 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.xiancjuc"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjuc" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 线槽钳工 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.xiancqg"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursqg" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 线槽焊工 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.xianchg"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerhg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHourshg" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
</table>
<!-- 卡子表 -->
<table style="width: 100%; text-align: center" border v-if="productType === 'QZ'">
<tr>
<th style="width: 200px">工序</th>
<th style="width: 200px">承接人</th>
<th style="width: 200px">工时</th>
</tr>
<!-- 卡子激光 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.qzjig"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjig" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 卡子锯床 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.qzjuc"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjuc" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 卡子钳工 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.qzqg"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursqg" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 卡子焊工 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.qzhg"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<a-form-model-item prop="undertakerhg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHourshg" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
</table>
<!-- 柜、箱、盒表 -->
<table style="width: 100%; text-align: center" border v-if="productType === 'GX'">
<tr>
<th style="width: 200px">工序</th>
<th style="width: 200px">承接人</th>
<th style="width: 200px">工时</th>
</tr>
<!-- 柜、箱、盒激光 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.gxhjig"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjig" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 柜、箱、盒锯床 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.gxhjuc"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjuc" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 柜、箱、盒折弯+打孔 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.gxhqg"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursqg" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 柜、箱、盒铆焊一 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.gxhmh1"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakermh1" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh1" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursmh1" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 柜、箱、盒铆焊二 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.gxhmh2"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakermh2" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh2" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursmh2" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 柜、箱、盒焊磨 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.gxhhm"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerhm" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhm" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHourshm" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 柜、箱、盒装配 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.gxhzp"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerzp" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerzp" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHourszp" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
</table>
<!-- 司机室表 -->
<table style="width: 100%; text-align: center" border v-if="productType === 'SJ'">
<tr>
<th style="width: 200px">工序</th>
<th style="width: 200px">承接人</th>
<th style="width: 200px">工时</th>
</tr>
<!-- 司机室激光 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.sjsjig"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjig" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 司机室锯床 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.sjsjuc"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjuc" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 司机室折弯+打孔 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.sjsqg"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerqg" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerqg" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursqg" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 司机室铆焊一 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.sjsmh1"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakermh1" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh1" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursmh1" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 司机室铆焊二 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.sjsmh2"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakermh2" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh2" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursmh2" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 司机室焊磨 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.sjshm"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerhm" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhm" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHourshm" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 司机室装配 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.sjszp"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerzp" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerzp" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHourszp" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
</table>
<!-- 附属钢表 -->
<table style="width: 100%; text-align: center" border v-if="productType === 'FS'">
<tr>
<th style="width: 200px">工序</th>
<th style="width: 200px">承接人</th>
<th style="width: 200px">工时</th>
</tr>
<!-- 附属刚激光 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.fsgjig"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjig" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjig" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 附属刚锯床 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.fsgjuc"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerjuc" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerjuc" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursjuc" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 附属刚铆焊一 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.fsgmh1"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakermh1" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh1" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursmh1" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 附属刚铆焊二 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.fsgmh2"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakermh2" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakermh2" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHoursmh2" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
<!-- 附属刚焊磨 -->
<tr>
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-input
v-model="model.fsghm"
style="border: none; background-color: transparent; text-align: center"
:readOnly="true"
></a-input>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="undertakerhm" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertakerhm" placeholder="请选择承接人" allowClear>
<a-select-option v-for="(item, index) in options" :key="index" :value="item. userName">{{
item.userName
}}</a-select-option>
</a-select>
</a-form-model-item>
</td>
<td>
<a-form-model-item prop="workHours" style="margin-bottom: 0px">
<a-input v-model="model.workHourshm" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
</table>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import Axios from 'axios'
import { addPg, queryBynumber, querygx } from '../../../api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { listSalary } from '@/api/TblSalaryBase'
import { mapGetters } from 'vuex'
export default {
name: 'TblProductionAddpgForm',
mixins: [JeecgListMixin],
components: {},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false,
},
},
data() {
return {
orderNumber: '',
productType: '',
zong:0,
yp:0,
options: [],
model: {
//接地
jiedijig: '激光(50%)',
workHoursjig: 0,
undertakerjig: '',
jiedijuc: '锯床下料(0%)',
workHoursjuc: 0,
undertakerjuc: '',
jiediqg: '钳工(50%)',
workHoursqg: 0,
undertakerqg: '',
jiedihg: '焊工(0%)',
workHourshg: 0,
undertakerhg: '',
//线槽
xiancjig: '激光(20%)',
xiancjuc: '锯床下料(6%)',
xiancqg: '钳工(32%)(折弯、打孔)',
xianchg: '焊工(42%)(焊、磨、装车)',
//卡子
qzjig: '激光(0%)',
qzjuc: '锯床下料(50%)',
qzqg: '钳工(50%)',
qzhg: '焊工(0%)',
//柜、箱、盒
gxhjig: '激光(13%)',
gxhjuc: '锯床下料(5%)',
gxhqg: '折弯+打孔(17%)',
gxhmh1: '铆焊一(17%)',
workHoursmh1: 0,
undertakermh1: '',
gxhmh2: '铆焊二(14%)',
workHoursmh2: 0,
undertakermh2: '',
gxhhm: '焊磨(15%)',
workHourshm: 0,
undertakerhm: '',
gxhzp: '装配(19%)',
workHourszp: 0,
undertakerzp: '',
//司机室
sjsjig: '激光(13%)',
sjsjuc: '锯床下料(5%)',
sjsqg: '折弯(16%)',
sjsmh1: '铆焊一(22%)',
sjsmh2: '铆焊二(17%)',
sjshm: '焊磨(16%)',
sjszp: '装配(11%)',
//附属钢
fsgjig: '激光(10%)',
fsgjuc: '锯床下料(4%)',
fsgmh1: '铆焊一(35%)',
fsgmh2: '铆焊二(30%)',
fsghm: '焊磨(21%)',
},
res: [],
columns: [
{
title: '工序',
align: 'center',
dataIndex: 'workingProcedure',
},
{
title: '承接人',
align: 'center',
dataIndex: 'undertaker',
},
{
title: '工时',
align: 'center',
dataIndex: 'workHours',
},
],
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
undertakerjig: [{ required: true, message: '请选择承接人!' }],
undertakermh1: [{ required: true, message: '请选择承接人!' }],
undertakermh2: [{ required: true, message: '请选择承接人!' }],
undertakerjuc: [{ required: true, message: '请选择承接人!' }],
undertakerhg: [{ required: true, message: '请选择承接人!' }],
undertakerqg: [{ required: true, message: '请选择承接人!' }],
undertakerzp: [{ required: true, message: '请选择承接人!' }],
undertakerhm: [{ required: true, message: '请选择承接人!' }],
},
url: {
add: '/production/tblProductionGongxu/add',
list: '/production/tblProductionPlan/list',
},
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//备份model原始值
// this.modelDefault = JSON.parse(JSON.stringify(this.model))
this.loadUser()
},
methods: {
loadUser() {
var that = this
listSalary().then((res) => {
if (res.success) {
// that.treeData = [];
that.options = res.result
}
})
},
add(record) {
this.orderNumber = record.orderNumber
this.productType = record.productType
this.zong=record.totalWork
this.yp=record.pai
console.log('派工订单号:', this.orderNumber, '产品类型:', this.productType,"总工时:",this.zong,"已派工时:",this.yp)
console.log('派发人:', this.userInfo().realname)
if (this.productType === 'JD') {
this.model.workHoursjig = parseFloat((record.totalWork * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat((record.totalWork * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = record.totalWork * 0
this.model.workHourshg = record.totalWork * 0
} else if (this.productType === 'XC') {
this.model.workHoursjig = parseFloat((record.totalWork * 0.2).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = parseFloat((record.totalWork * 0.06).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat((record.totalWork * 0.32).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshg = parseFloat((record.totalWork * 0.42).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
} else if (this.productType === 'QZ') {
this.model.workHoursjig = record.totalWork * 0
this.model.workHoursjuc = parseFloat((record.totalWork * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat((record.totalWork * 0.5).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshg = record.totalWork * 0
} else if (this.productType === 'GX') {
this.model.workHoursjig = parseFloat((record.totalWork * 0.13).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = parseFloat((record.totalWork * 0.05).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat((record.totalWork * 0.17).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh1 = parseFloat((record.totalWork * 0.17).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh2 = parseFloat((record.totalWork * 0.14).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshm = parseFloat((record.totalWork * 0.15).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourszp = parseFloat((record.totalWork * 0.19).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
} else if (this.productType === 'SJ') {
this.model.workHoursjig = parseFloat((record.totalWork * 0.13).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = parseFloat((record.totalWork * 0.05).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursqg = parseFloat((record.totalWork * 0.16).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh1 = parseFloat((record.totalWork * 0.22).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh2 = parseFloat((record.totalWork * 0.17).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshm = parseFloat((record.totalWork * 0.16).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourszp = parseFloat((record.totalWork * 0.11).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
} else if (this.productType === 'FS') {
this.model.workHoursjig = parseFloat((record.totalWork * 0.1).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursjuc = parseFloat((record.totalWork * 0.04).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh1 = parseFloat((record.totalWork * 0.35).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHoursmh2 = parseFloat((record.totalWork * 0.3).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
this.model.workHourshm = parseFloat((record.totalWork * 0.21).toFixed(2)).toString().replace(/(\.\d*?[1-9])0+$/, '$1')
}
},
...mapGetters(['nickname', 'avatar', 'userInfo']),
submitForm() {
const that = this
// 构造数据对象数组
let data = [];
// 触发表单验证
this.$refs.form.validate((valid) => {
if (valid) {
that.confirmLoading = true
if (this.productType === 'JD') {
// 构造需要发送的数据数组对象
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.jiedijig,
undertaker: this.model.undertakerjig,
workHours: this.model.workHoursjig,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.jiedijuc,
undertaker: this.model.undertakerjuc,
workHours: this.model.workHoursjuc,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.jiediqg,
undertaker: this.model.undertakerqg,
workHours: this.model.workHoursqg,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.jiedihg,
undertaker: this.model.undertakerhg,
workHours: this.model.workHourshg,
},
]
} else if (this.productType === 'XC') {
// 构造需要发送的数据数组对象
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.xiancjig,
undertaker: this.model.undertakerjig,
workHours: this.model.workHoursjig,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.xiancjuc,
undertaker: this.model.undertakerjuc,
workHours: this.model.workHoursjuc,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.xiancqg,
undertaker: this.model.undertakerqg,
workHours: this.model.workHoursqg,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.xianchg,
undertaker: this.model.undertakerhg,
workHours: this.model.workHourshg,
},
]
} else if (this.productType === 'QZ') {
// 构造需要发送的数据数组对象
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.qzjig,
undertaker: this.model.undertakerjig,
workHours: this.model.workHoursjig,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.qzjuc,
undertaker: this.model.undertakerjuc,
workHours: this.model.workHoursjuc,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.qzqg,
undertaker: this.model.undertakerqg,
workHours: this.model.workHoursqg,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.qzhg,
undertaker: this.model.undertakerhg,
workHours: this.model.workHourshg,
},
]
}else if (this.productType === 'GX') {
// 构造需要发送的数据数组对象
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.gxhjig,
undertaker: this.model.undertakerjig,
workHours: this.model.workHoursjig,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.gxhjuc,
undertaker: this.model.undertakerjuc,
workHours: this.model.workHoursjuc,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.gxhqg,
undertaker: this.model.undertakerqg,
workHours: this.model.workHoursqg,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.gxhmh1,
undertaker: this.model.undertakermh1,
workHours: this.model.workHoursmh1,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.gxhmh2,
undertaker: this.model.undertakermh2,
workHours: this.model.workHoursmh2,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.gxhhm,
undertaker: this.model.undertakerhm,
workHours: this.model.workHourshm,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.gxhzp,
undertaker: this.model.undertakerzp,
workHours: this.model.workHourszp,
},
]
}else if (this.productType === 'SJ') {
// 构造需要发送的数据数组对象
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.sjsjig,
undertaker: this.model.undertakerjig,
workHours: this.model.workHoursjig,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.sjsjuc,
undertaker: this.model.undertakerjuc,
workHours: this.model.workHoursjuc,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.sjsqg,
undertaker: this.model.undertakerqg,
workHours: this.model.workHoursqg,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.sjsmh1,
undertaker: this.model.undertakermh1,
workHours: this.model.workHoursmh1,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.sjsmh2,
undertaker: this.model.undertakermh2,
workHours: this.model.workHoursmh2,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.sjshm,
undertaker: this.model.undertakerhm,
workHours: this.model.workHourshm,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.sjszp,
undertaker: this.model.undertakerzp,
workHours: this.model.workHourszp,
},
]
}else if (this.productType === 'FS') {
// 构造需要发送的数据数组对象
data = [
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.fsgjig,
undertaker: this.model.undertakerjig,
workHours: this.model.workHoursjig,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.fsgjuc,
undertaker: this.model.undertakerjuc,
workHours: this.model.workHoursjuc,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.fsgmh1,
undertaker: this.model.undertakermh1,
workHours: this.model.workHoursmh1,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.fsgmh2,
undertaker: this.model.undertakermh2,
workHours: this.model.workHoursmh2,
},
{
dispatchTime: new Date(),
orderNumber: this.orderNumber,
productType: this.productType,
dispatchRen: this.userInfo().realname,
workingProcedure: this.model.fsghm,
undertaker: this.model.undertakerhm,
workHours: this.model.workHourshm,
},
]
}
//接地工时和
var jiedihe=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHourshg+this.model.workHoursqg+this.yp
//线槽
var xche=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHourshg+this.model.workHoursqg
console.log(xche)
//卡子
var qzhe=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHourshg+this.model.workHoursqg+this.yp
//柜箱盒
var gxhe=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHoursqg+this.yp+this.model.workHoursmh1+this.model.workHoursmh2+this.model.workHourshm+this.model.workHourszp
//司机室
var sjshe=this.model.workHoursjig+this.model.workHoursjuc+this.model.workHoursqg+this.yp+this.model.workHoursmh1+this.model.workHoursmh2+this.model.workHourshm+this.model.workHourszp
//附属钢
var fsghe=this.model.workHoursjig+this.model.workHoursjuc+this.yp+this.model.workHoursmh1+this.model.workHoursmh2+this.model.workHourshm
if(this.productType === 'JD' && data.workHours<=this.zong && jiedihe<=this.zong){
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'XC' && data.workHours<=this.zong && xche<=this.zong){
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'QZ' && data.workHours<=this.zong && qzhe<=this.zong){
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'GX' && data.workHours<=this.zong && gxhe<=this.zong){
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'SJ' && data.workHours<=this.zong && sjshe<=this.zong){
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else if(this.productType === 'FS' && data.workHours<=this.zong && fsghe<=this.zong){
addPg(this.url.add, data)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}else{
that.$message.error("派发工时超过总工时")
that.confirmLoading = false
}
}
})
},
},
}
</script>
<style lang="less" scoped>
.input_dis {
border-color: #91d5ff;
background-color: #e6f7ff;
}
</style>
\ No newline at end of file
... ...
... ... @@ -3,29 +3,88 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<div class="align-colon">
<p style="margin-bottom: 0px;margin-left: 50px;"><span>订单号:</span><a-input v-model="model.orderNumber" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>订货单位:</span><a-input v-model="model.danwei" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>工作令:</span><a-input v-model="model.workOrder" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>产品名称:</span><a-input v-model="model.productName" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>产品类型:</span><a-input v-model="model.productType" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>任务下达时间:</span><a-input v-model="model.workTime" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>派工时间:</span><a-input v-model="model.dispatchTime" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>交货时间:</span><a-input v-model="model.deliveryTime" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>数量(套):</span><a-input v-model="model.num" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>总工时:</span><a-input v-model="model.totalWork" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-left: 50px;"><span>已派发工时:</span><a-input v-model="model.pai" style="width: 200px;border:0px"></a-input></p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>订单号:</span
><a-input v-model="model.orderNumber" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>订货单位:</span
><a-input v-model="model.danwei" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>工作令:</span
><a-input v-model="model.workOrder" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>产品名称:</span
><a-input v-model="model.productName" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>产品类型:</span
><a-input v-model="model.productType" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>任务下达时间:</span
><a-input v-model="model.workTime" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>派工时间:</span
><a-input v-model="model.dispatchTime" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>交货时间:</span
><a-input v-model="model.deliveryTime" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>数量(套):</span
><a-input v-model="model.num" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>总工时:</span
><a-input v-model="model.totalWork" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-left: 50px">
<span>已派发工时:</span><a-input v-model="model.pai" style="width: 200px; border: 0px"></a-input>
</p>
<!-- 图片容器 -->
<div class="image-container-wrapper">
<div class="image-container">
<!-- <div class="image-container">
<j-image-upload isMultiple v-model="files" class="custom-image"></j-image-upload>
</div>
<div class="image-container">
<j-image-upload isMultiple v-model="imageSrc"></j-image-upload>
</div> -->
<div style="display: inline-block; width: 45%">
<div class="show">
<img :src="getImgView(show)" :preview="num" alt="" height="100px" />
</div>
<div class="imgBox">
<div
:class="[num == index ? 'borderShow' : '']"
v-for="(item, index) of picList"
:key="index"
@click="onImg(index)"
>
<img :src="getImgView(item)" height="25px" alt="" style="margin-left: 20px" />
</div>
</div>
</div>
</div>
</div>
<a-table :columns="columns" :data-source="res" style="width: auto" :pagination="false"></a-table>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
class="j-table-force-nowrap"
:scroll="{ x: true }"
:columns="columns"
:dataSource="res"
:pagination="false"
>
</a-table>
</a-form-model>
</j-form-container>
</a-spin>
... ... @@ -36,9 +95,11 @@ import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import Axios from 'axios'
import { queryBynumber, querygx } from '../../../api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: 'TblProductionPlanForm',
mixins: [JeecgListMixin],
components: {},
props: {
//表单禁用
... ... @@ -50,10 +111,13 @@ export default {
},
data() {
return {
picList: '',
show: '',
num: 0,
imageSrc: '',
files: '',
model: {},
res:[],
res: [],
columns: [
{
title: '工序',
... ... @@ -70,7 +134,7 @@ export default {
align: 'center',
dataIndex: 'workHours',
},
{
title: '派发时间',
align: 'center',
... ... @@ -136,6 +200,7 @@ export default {
queryById: '/production/tblProductionPlan/queryById',
queryBynumber: '/production/tblProductionPlan/queryBynumber',
querygx: '/production/tblProductionPlan/querygx',
list: "/order_form/tblOrderForm/list",
},
}
},
... ... @@ -147,23 +212,42 @@ export default {
created() {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model))
},
methods: {
querygx(orderNumber,productType) {
onImg(e) {
this.show = this.picList[e]
this.num = e
},
querygx(orderNumber, productType) {
querygx(this.url.querygx, this.model).then((res) => {
console.log('工序订单号:', orderNumber)
console.log('工序产品类型:', productType)
console.log("工序查询:",res)
this.res=res.result
console.log('工序订单号:', orderNumber)
console.log('工序产品类型:', productType)
console.log('工序查询:', res)
this.res = res.result
})
},
queryBynumber(orderNumber) {
console.log('1订单号:', orderNumber)
if(this.model.productType === '接地'){
this.model.productType='JD'
}else if(this.model.productType === '线槽'){
this.model.productType= 'XC'
}else if(this.model.productType === '卡子'){
this.model.productType= 'QZ'
}else if(this.model.productType === '司机室'){
this.model.productType= 'SJ'
}else if(this.model.productType === '柜、箱、盒'){
this.model.productType= 'GX'
}else if(this.model.productType === '附属钢'){
this.model.productType= 'FS'
}
queryBynumber(this.url.queryBynumber, this.model).then((res) => {
console.log(res.result)
this.imageSrc = res.result.pics
this.files = res.result.files
var picList = res.result.pics.split(',')
this.picList = picList
this.show = this.picList[0]
console.log('files:', this.files)
console.log(this.imageSrc)
})
... ... @@ -173,6 +257,19 @@ export default {
},
edit(record) {
this.model = Object.assign({}, record)
if(this.model.productType === 'JD'){
this.model.productType='接地'
}else if(this.model.productType === 'XC'){
this.model.productType= '线槽'
}else if(this.model.productType === 'QZ'){
this.model.productType= '卡子'
}else if(this.model.productType === 'SJ'){
this.model.productType= '司机室'
}else if(this.model.productType === 'GX'){
this.model.productType= '柜、箱、盒'
}else if(this.model.productType === 'FS'){
this.model.productType= '附属钢'
}
this.visible = true
},
submitForm() {
... ... @@ -227,6 +324,28 @@ export default {
float: right; /* 右浮动 */
margin-top: -300px; /* 调整顶部外边距以与其他内容对齐 */
}
.imgBox {
display: flex;
}
.imgBox img {
width: 50px;
height: 50px;
margin: 10px;
}
.show img{
margin-bottom: 10px;
height: 200px;
width: 200px;
}
.imgBox div {
margin: 5px;
}
.borderShow {
border: 2px solid rgb(141, 134, 134);
}
.image-container {
margin-bottom: -10px; /* 图片容器下边距 */
... ...
... ... @@ -8,7 +8,7 @@
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tbl-production-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tbl-production-plan-form>
<tbl-production-plan-form ref="realForm" @ok="submitCallback"></tbl-production-plan-form>
</j-modal>
</template>
... ...