作者 张晓杰

Merge branch 'dev' of http://39.105.222.208:1024/leihd/factory-web into dev

# Conflicts:
#	dist.zip
不能预览此文件类型
... ... @@ -80,6 +80,14 @@ export function selectUp(url,parameter){
params: parameter
})
}
//根据产品类型查询对应工序
export function gongxuList(url,parameter){
return axios({
url:url,
method:'get',
params:parameter
})
}
//新增派工
export function addPg(url,parameter){
return axios({
... ... @@ -96,6 +104,14 @@ export function queryBynumber(url,parameter){
params:parameter
})
}
//生产计划验收
export function yanshouList(url,parameter){
return axios({
url:url,
method:'get',
params:parameter
})
}
//工序查询
export function querygx(url,parameter){
return axios({
... ...
... ... @@ -261,12 +261,20 @@ 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;
},
//验收
handleYans:function(record){
this.$refs.yansModalForm.yanshouList(record);
this.$refs.yansModalForm.title="验收";
this.$refs.yansModalForm.disableSubmit=false;
},
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
//TODO 筛选
... ... @@ -298,10 +306,10 @@ export const JeecgListMixin = {
},
// 生产计划查看
handleDetail2: function (record) {
console.log("生产计划查看:",record.orderNumber)
console.log("生产计划查看:",record.orderId)
this.$refs.modalForm.edit(record);
this.$refs.modalForm.queryBynumber(record.orderNumber);
this.$refs.modalForm.querygx(record.orderNumber,record.productType)
this.$refs.modalForm.queryBynumber(record.orderId);
this.$refs.modalForm.querygx(record.orderId,record.productType)
this.$refs.modalForm.title = "生产订单>详情";
this.$refs.modalForm.disableSubmit = true;
},
... ...
... ... @@ -6,7 +6,7 @@
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="订货单位">
<j-input placeholder="请输入订货单位" v-model="queryParam.danwei"></j-input>
<j-input placeholder="请输入订货单位" v-model="queryParam.orderCompany"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
... ... @@ -18,7 +18,7 @@
<a-form-item label="产品类型">
<!-- <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-option v-for="(item,index) in options" :key="index" :value="item.productTypeId">{{ item.productTypeName }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
... ... @@ -108,15 +108,16 @@
<span slot="action" slot-scope="text, record">
<a @click="handleDetail2(record)">查看</a>
<a-divider type="vertical" />
<a @click="handleAddpg(record)">派工</a>
<a @click="handleAddpg(record)" :disabled="record.totalWorkingHours - record.dispatchedWorkingHours === 0">派工</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">验收</a>
<a @click="handleYans(record)">验收</a>
</span>
</a-table>
</div>
<tbl-production-plan-modal ref="modalForm" @ok="modalFormOk"></tbl-production-plan-modal>
<TblProductionAddpg ref="pgModalForm" @ok="modalFormOk"></TblProductionAddpg>
<TblProductionYans ref="yansModalForm" @ok="modalFormOk"></TblProductionYans>
</a-card>
</template>
... ... @@ -126,12 +127,13 @@ import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TblProductionPlanModal from './planModules/TblProductionPlanModal'
import TblProductionAddpg from './planModules/TblProductionAddpg.vue'
import TblProductionYans from './planModules/TblProductionYans.vue'
import {listProductType} from '@/api/ProductTpye'
export default {
name: 'TblProductionPlanList',
mixins: [JeecgListMixin, mixinDevice],
components: {
TblProductionPlanModal,TblProductionAddpg
TblProductionPlanModal,TblProductionAddpg,TblProductionYans
},
data() {
return {
... ... @@ -152,12 +154,12 @@ export default {
{
title: '订单号',
align: 'center',
dataIndex: 'orderNumber',
dataIndex: 'orderId',
},
{
title: '订货单位',
align: 'center',
dataIndex: 'danwei',
dataIndex: 'orderCompany',
},
{
title: '工作令',
... ... @@ -192,7 +194,7 @@ export default {
{
title: '任务下达时间',
align: 'center',
dataIndex: 'workTime',
dataIndex: 'orderDate',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
... ... @@ -200,7 +202,7 @@ export default {
{
title: '派工时间',
align: 'center',
dataIndex: 'dispatchTime',
dataIndex: 'dispatchDate',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
... ... @@ -208,7 +210,7 @@ export default {
{
title: '交货时间',
align: 'center',
dataIndex: 'deliveryTime',
dataIndex: 'deliveryDate',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
... ... @@ -216,17 +218,17 @@ export default {
{
title: '数量(套)',
align: 'center',
dataIndex: 'num',
dataIndex: 'quantity',
},
{
title: '总工时',
align: 'center',
dataIndex: 'totalWork',
dataIndex: 'totalWorkingHours',
},
{
title: '已派发工时',
align: 'center',
dataIndex: 'pai',
dataIndex: 'dispatchedWorkingHours',
},
{
title: '操作',
... ...
... ... @@ -5,69 +5,79 @@
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
@cancel="handleCancel"
cancelText="关闭">
<TblProductionAddpgForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></TblProductionAddpgForm>
cancelText="关闭"
>
<TblProductionAddpgForm
ref="realForm"
@ok="submitCallback"
:disabled="disableSubmit"
normal
></TblProductionAddpgForm>
</j-modal>
</template>
<script>
import TblProductionAddpgForm from './TblProductionAddpgForm'
import TblProductionAddpgForm from './TblProductionAddpgForm'
export default {
export default {
name: 'TblProductionAddpg',
components: {
TblProductionAddpgForm
TblProductionAddpgForm,
},
data () {
data() {
return {
title:"操作",
width:670,
title: '操作',
width: 670,
visible: false,
disableSubmit: false
disableSubmit: false,
}
},
methods: {
add (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(record);
add(record) {
if (record.totalWorkingHours - record.dispatchedWorkingHours === 0) {
this.$message.error('工时已派完')
} else {
this.visible = true
this.$nextTick(() => {
this.$refs.realForm.add(record)
})
}
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
edit(record) {
this.visible = true
this.$nextTick(() => {
this.$refs.realForm.edit(record)
})
},
close () {
this.$emit('close');
this.visible = false;
close() {
this.$emit('close')
this.visible = false
},
submitCallback(){
this.$emit('ok');
this.visible = false;
submitCallback() {
this.$emit('ok')
this.visible = false
},
handleOk () {
this.$refs.realForm.submitForm();
handleOk() {
this.$refs.realForm.submitForm()
},
handleCancel () {
handleCancel() {
this.close()
}
}
}
},
},
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
}
.drawer-footer {
position: absolute;
bottom: -8px;
width: 100%;
... ... @@ -77,5 +87,5 @@
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
}
</style>
\ No newline at end of file
... ...
... ... @@ -2,862 +2,54 @@
<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'">
<!-- <table style="width: 100%; text-align: center" border>
<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>
<tr v-for="(item, index) in res" :key="index">
<td>
<a-form-model-item prop="workingProcedure" style="margin-bottom: 0px">
<a-form-model-item prop="gongxu" style="margin-bottom: 0px">
<a-input
v-model="model.fsgjuc"
v-model="item.gongxu"
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-form-model-item prop="undertakerjig" style="margin-bottom: 0px">
<a-select size="small" v-model="model.undertaker" placeholder="请选择承接人" allowClear>
<a-select-option
v-for="(option, optionIndex) in options"
:key="optionIndex"
:value="option.userName"
>{{ option.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-input v-model="model.workHoursjig" style="text-align: center"></a-input>
</a-form-model-item>
</td>
</tr>
</table> -->
<!-- 附属刚铆焊一 -->
<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-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>
... ... @@ -867,7 +59,7 @@
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import Axios from 'axios'
import { addPg, queryBynumber, querygx } from '../../../api/manage'
import { addPg, gongxuList, queryBynumber, querygx } from '../../../api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { listSalary } from '@/api/TblSalaryBase'
import { mapGetters } from 'vuex'
... ... @@ -887,85 +79,45 @@ export default {
return {
orderNumber: '',
productType: '',
zong:0,
yp:0,
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%)',
},
model: {},
res: [],
panduan: [],
columns: [
{
title: '工序',
align: 'center',
width: 200,
dataIndex: 'workingProcedure',
},
{
title: '承接人',
align: 'center',
dataIndex: 'undertaker',
width: 200,
scopedSlots: { customRender: 'undertaker' },
customRender: (text, record, index) => {
return (
<a-select size="small" v-model={record.undertaker} placeholder="请选择承接人" allowClear>
{this.options.map((option, optionIndex) => (
<a-select-option key={optionIndex} value={option.userName}>
{option.userName}
</a-select-option>
))}
</a-select>
)
},
},
{
title: '工时',
align: 'center',
dataIndex: 'workHours',
scopedSlots: { customRender: 'workHours' },
customRender: (text, record, index) => {
return <a-input v-model={record.workHours} style="text-align: center" />
},
},
],
labelCol: {
... ... @@ -978,18 +130,12 @@ export default {
},
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: '请选择承接人!' }],
undertaker: [{ required: true, message: '请选择承接人!' }],
},
url: {
add: '/production/tblProductionGongxu/add',
list: '/production/tblProductionPlan/list',
queryByType: '/production/tblProductTypeGongxu/queryByType',
},
}
},
... ... @@ -1014,410 +160,72 @@ export default {
})
},
add(record) {
this.orderNumber = record.orderNumber
console.log('产品类型:', record.productType)
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')
this.panduan = record
gongxuList(this.url.queryByType, { productTypeId: record.productType }).then((ress) => {
if (ress) {
//如果已派工时为0总工时*工时比例,否则(总工时-已派工时)*工时比例
console.log(record.dispatchedWorkingHours)
if (record.dispatchedWorkingHours <= 0) {
console.log('aa', ress.result)
console.log(record.totalWorkingHours)
// 将获取到的工序列表添加到数据源中
this.res = ress.result.map((item) => ({
workingProcedure: item.gongxu,
undertaker: '', // 初始为空,等待用户输入
workHours: parseFloat((record.totalWorkingHours * item.bili).toFixed(2))
.toString()
.replace(/(\.\d*?[1-9])0+$/, '$1'), // 初始为空,等待用户输入
dispatchTime: new Date(),
orderNumber: record.orderId,
dispatchRen: this.userInfo().realname,
productType: record.productType,
}))
} else if (record.dispatchedWorkingHours > 0) {
console.log('bb', ress.result)
console.log(record.totalWorkingHours)
// 将获取到的工序列表添加到数据源中
this.res = ress.result.map((item) => ({
workingProcedure: item.gongxu,
undertaker: '', // 初始为空,等待用户输入
workHours: parseFloat(((record.totalWorkingHours - record.dispatchedWorkingHours) * item.bili).toFixed(2))
.toString()
.replace(/(\.\d*?[1-9])0+$/, '$1'), // 初始为空,等待用户输入
dispatchTime: new Date(),
orderNumber: record.orderId,
dispatchRen: this.userInfo().realname,
productType: record.productType,
}))
}
}
})
console.log('派发人:', this.userInfo().realname)
},
...mapGetters(['nickname', 'avatar', 'userInfo']),
submitForm() {
const that = this
// 构造数据对象数组
let data = [];
let data = []
// 触发表单验证
this.$refs.form.validate((valid) => {
if (valid) {
if (!this.res.some((record) => !record.undertaker) && !this.res.some((record)=>!record.workHours)) {
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)
console.log('res:', this.res)
// 使用 reduce 方法累加工时字段值
const zong = this.res.reduce((acc, current) => {
console.log('current.workhours:', current.workHours)
return acc + parseFloat(current.workHours)
}, 0)
console.log(this.panduan.dispatchedWorkingHours)
const zongpaifa = parseFloat(this.panduan.dispatchedWorkingHours) + zong
console.log('派发工时和:', zong)
console.log('已派发工时:', zongpaifa)
if (zongpaifa <= this.panduan.totalWorkingHours) {
addPg(this.url.add, this.res)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
... ... @@ -1429,50 +237,14 @@ export default {
.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(() => {
} else if (zongpaifa > this.panduan.totalWorkingHours) {
that.$message.error('派发工时超过总工时')
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.$message.error('页面字段不能为空')
that.confirmLoading = false
}
}
})
},
... ...
... ... @@ -5,11 +5,11 @@
<div class="align-colon">
<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>
><a-input v-model="model.orderId" 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>
><a-input v-model="model.orderCompany" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<p style="margin-bottom: -5px; margin-left: 50px">
<span>工作令:</span
... ... @@ -21,30 +21,30 @@
</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>
><a-input v-model="this.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>
><a-input v-model="model.orderDate" 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>
><a-input v-model="model.dispatchDate" 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>
><a-input v-model="model.deliveryDate" 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>
><a-input v-model="model.quantity" 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>
><a-input v-model="model.totalWorkingHours" 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>
<span>已派发工时:</span><a-input v-model="model.dispatchedWorkingHours" style="width: 200px; border: 0px; font-weight: bold"></a-input>
</p>
<!-- 图片容器 -->
... ... @@ -111,6 +111,7 @@ export default {
},
data() {
return {
productType:'',
picList: '',
show: '',
num: 0,
... ... @@ -218,16 +219,7 @@ export default {
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
})
},
queryBynumber(orderNumber) {
console.log('1订单号:', orderNumber)
querygx(orderId, productType) {
if(this.model.productType === '接地'){
this.model.productType='JD'
}else if(this.model.productType === '线槽'){
... ... @@ -241,16 +233,48 @@ export default {
}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)
querygx(this.url.querygx, this.model).then((res) => {
console.log('工序订单号:', orderId)
console.log('工序产品类型:', productType)
console.log('工序查询:', res)
this.res = res.result
})
},
queryBynumber(orderId) {
console.log('1订单号:', orderId)
if(this.model.productType === '接地'){
this.productType='接地'
}else if(this.model.productType === '线槽'){
this.productType= '线槽'
}else if(this.model.productType === '卡子'){
this.productType= '卡子'
}else if(this.model.productType === '司机室'){
this.productType= '司机室'
}else if(this.model.productType === '柜、箱、盒'){
this.productType= '柜、箱、盒'
}else if(this.model.productType === '附属钢'){
this.productType= '附属钢'
}
queryBynumber(this.url.queryBynumber, { orderId: orderId }).then((res) => {
if (res.result) {
const result = res.result;
if (result.designPic) {
this.imageSrc = result.designPic;
this.picList = result.designPic.split(',');
this.show = this.picList[0];
}
if (result.designFile) {
this.designFile = result.designFile;
console.log('files:', this.designFile);
}
} else {
console.log('Response result or required properties are missing.');
}
})
.catch((error) => {
console.error('Error while fetching data:', error);
});
},
add() {
this.edit(this.modelDefault)
... ...
... ... @@ -35,16 +35,16 @@
this.$refs.realForm.add();
})
},
queryBynumber(orderNumber){
queryBynumber(orderId){
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.queryBynumber(orderNumber);
this.$refs.realForm.queryBynumber(orderId);
})
},
querygx(orderNumber,productType){
querygx(orderId,productType){
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.querygx(orderNumber,productType)
this.$refs.realForm.querygx(orderId,productType)
})
},
edit (record) {
... ...
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<TblProductionYansForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></TblProductionYansForm>
</j-modal>
</template>
<script>
import TblProductionYansForm from './TblProductionYansForm.vue'
export default {
name: 'TblProductionYans',
components: {
TblProductionYansForm
},
data () {
return {
title:"操作",
width:670,
visible: false,
disableSubmit: false
}
},
methods: {
add (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add(record);
})
},
yanshouList (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.yanshouList(record.orderNumber);
});
},
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">
<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>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { yanshou } from '../../../api/manage'
export default {
name: 'TblProductionYansForm',
mixins: [JeecgListMixin],
components: {},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false,
},
},
data() {
return {
model: {},
res: [],
columns: [
{
title: '工序',
align: 'center',
dataIndex: 'workingProcedure',
},
{
title: '承接人',
align: 'center',
dataIndex: 'undertaker',
},
{
title: '工时',
align: 'center',
dataIndex: 'workHours',
},
{
title: '验收结果',
align: 'center',
dataIndex: 'yanResult',
},
{
title: '备注',
align: 'center',
dataIndex: 'notes',
},
],
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
jobId: [{ required: true, message: '请输入岗位编号!' }],
jobTitle: [{ required: true, message: '请输入岗位名称!' }],
basicSalary: [{ required: true, message: '请输入基本工资!' }],
bili: [{ required: true, message: '请输入计算比例!' }],
zongPrice: [{ required: true, message: '请输入总工资算法!' }],
},
url: {
list:'/production/tblProductionGongxu/list',
edit: '/production/tblProductionGongxu/edit',
queryByNumber:'/production/tblProductionGongxu/queryByNumber'
},
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model))
},
methods: {
yanshouList(record){
console.log(record.orderNumber)
yanshouList(this.url.queryByNumber,{orderNumber:record.orderNumber}).then((res) =>{
if(res){
this.res=res.result
}
})
},
edit(record) {
this.model = Object.assign({}, record)
this.visible = true
},
submitForm() {
const that = this
// 触发表单验证
this.$refs.form.validate((valid) => {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method = ''
httpAction(this.url, this.model, method)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}
})
},
},
}
</script>
\ No newline at end of file
... ...