parent
4d8803abf4
commit
322788b756
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<el-dialog title="选择商品" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
|
||||
lock-scroll append-to-body width="800px">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div class="JNPF-common-search-box-right">
|
||||
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-row>
|
||||
<JNPF-table v-loading="listLoading" :data="list"
|
||||
@current-change="clickRow" highlight-current-row ref="tablelistref" :border="false">
|
||||
<el-table-column prop="name" label="商品名称" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="code" label="商品编码" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="productTypeId" label="商品类型" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="shortName" label="商品简称" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="spec" label="商品规格" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="barCode" label="商品条码" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="inventoryType" label="存货类型" align="left">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="brandId" label="品牌" align="left">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="productCategoryId" label="商品分类" align="left">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="area" label="产地" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="firstSupplierId" label="首选供应商" align="left">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="deliveryType" label="配送方式" align="left">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="salesMainUnitIds" label="销售单位" align="left">
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="inventoryUnitIds" label="库存单位" align="left">
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
|
||||
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
GoodsList
|
||||
} from '@/api/extend/order'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
listLoading: true,
|
||||
keyword: '',
|
||||
list: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
superQueryJson: '',
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
excludeIdList: [],
|
||||
checked: [],
|
||||
multipleTable: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(excludeIdList, val) {
|
||||
this.visible = true
|
||||
this.listLoading = true
|
||||
if (excludeIdList) {
|
||||
this.excludeIdList = excludeIdList;
|
||||
}
|
||||
let query = {
|
||||
...this.listQuery,
|
||||
keyword: this.keyword,
|
||||
excludeIdList: this.excludeIdList,
|
||||
dataType: 0,
|
||||
id: val,
|
||||
}
|
||||
/* GoodsList(query).then(res => {
|
||||
this.list = res.data.list
|
||||
this.listLoading = false
|
||||
}) */
|
||||
request({
|
||||
url: `/api/scm/ProductWarehouse/getBomProductlist`,
|
||||
method: 'post',
|
||||
data: query
|
||||
}).then(res => {
|
||||
this.list = res.data.list
|
||||
this.listLoading = false
|
||||
this.total = res.data.pagination.total
|
||||
})
|
||||
},
|
||||
refresh() {
|
||||
this.keyword = ''
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = 20
|
||||
this.listQuery.sort = "desc"
|
||||
this.listQuery.sidx = ""
|
||||
this.init()
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = 20
|
||||
this.listQuery.sort = "desc"
|
||||
this.listQuery.sidx = ""
|
||||
this.init()
|
||||
},
|
||||
select() {
|
||||
this.visible = false
|
||||
// console.log('this.checked',this.checked);
|
||||
this.$emit('refreshDataList', this.checked)
|
||||
},
|
||||
clickRow(val) {
|
||||
this.checked = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
>>>.el-dialog__body {
|
||||
height: 70vh;
|
||||
padding: 0 0 10px !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
.JNPF-common-search-box {
|
||||
margin-bottom: 0;
|
||||
|
||||
.JNPF-common-search-box-right {
|
||||
padding: 10px 10px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<el-dialog title="选择商品" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
|
||||
lock-scroll append-to-body width="800px">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div class="JNPF-common-search-box-right">
|
||||
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-row>
|
||||
<!-- <JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false"> -->
|
||||
<JNPF-table v-loading="listLoading" :data="list"
|
||||
@current-change="clickRow" highlight-current-row ref="tablelistref" :border="false">
|
||||
|
||||
<el-table-column prop="documentType1" label="单据类型" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="voucherCode" label="凭证编号" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="voucherType1" label="凭证类型" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="poundCode" label="磅单编号" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicleName" label="车牌号" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierName" label="供应商名字" align="left">
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
|
||||
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
GoodsList
|
||||
} from '@/api/extend/order'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
listLoading: true,
|
||||
keyword: '',
|
||||
list: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
superQueryJson: '',
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
excludeIdList: [],
|
||||
checked: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(excludeIdList, val) {
|
||||
this.visible = true
|
||||
this.listLoading = true
|
||||
if (excludeIdList) {
|
||||
this.excludeIdList = excludeIdList;
|
||||
}
|
||||
let query = {
|
||||
...this.listQuery,
|
||||
keyword: this.keyword,
|
||||
excludeIdList: this.excludeIdList,
|
||||
dataType: 0,
|
||||
documentType: val,
|
||||
|
||||
}
|
||||
/* GoodsList(query).then(res => {
|
||||
this.list = res.data.list
|
||||
this.listLoading = false
|
||||
}) */
|
||||
request({
|
||||
url: `/api/scm/Voucher/getList`,
|
||||
method: 'post',
|
||||
data: query
|
||||
}).then(res => {
|
||||
this.list = res.data.list
|
||||
this.listLoading = false
|
||||
this.total = res.data.pagination.total
|
||||
})
|
||||
},
|
||||
refresh() {
|
||||
this.keyword = ''
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = 20
|
||||
this.listQuery.sort = "desc"
|
||||
this.listQuery.sidx = ""
|
||||
this.init()
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = 20
|
||||
this.listQuery.sort = "desc"
|
||||
this.listQuery.sidx = ""
|
||||
this.init()
|
||||
},
|
||||
select() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', this.checked)
|
||||
},
|
||||
clickRow(val) {
|
||||
this.checked = val
|
||||
},
|
||||
|
||||
handleSelectionChange(val) {
|
||||
this.checked = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
>>>.el-dialog__body {
|
||||
height: 70vh;
|
||||
padding: 0 0 10px !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
.JNPF-common-search-box {
|
||||
margin-bottom: 0;
|
||||
|
||||
.JNPF-common-search-box-right {
|
||||
padding: 10px 10px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,925 @@
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" :close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<!-- 具体表单 -->
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item>
|
||||
<JnpfGroupTitle content="单据类型" contentPosition="left">
|
||||
</JnpfGroupTitle>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item>
|
||||
<JnpfText
|
||||
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
|
||||
content=" 不同的单据类型,需要选择不同的收货信息">
|
||||
</JnpfText>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="单据类型" prop="type">
|
||||
<JnpfRadio v-model="dataForm.type" @change="changeData('type',-1)" optionType="button"
|
||||
direction="horizontal" size="medium" :options="typeOptions" :props="typeProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item>
|
||||
<JnpfGroupTitle content="基础信息" contentPosition="left">
|
||||
</JnpfGroupTitle>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="单据编号" prop="code">
|
||||
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
|
||||
placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="工厂名称" prop="businessfactoryId">
|
||||
<JnpfPopupSelect v-model="dataForm.businessfactoryId"
|
||||
@change="changeData('businessfactoryId',-1)" :rowIndex="null" :formData="dataForm"
|
||||
:templateJson="interfaceRes.businessfactoryId" placeholder="请选择" hasPage
|
||||
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
|
||||
relationField='name' field='businessfactoryId' interfaceId="521651055751075845"
|
||||
:pageSize="20" :columnOptions="businessfactoryIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="生产线" prop="businessId">
|
||||
<JnpfPopupSelect v-model="dataForm.businessId" @change="changeData('businessId',-1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.businessId"
|
||||
placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='name' field='businessId'
|
||||
interfaceId="543324446463638853" :pageSize="20"
|
||||
:columnOptions="businessIdcolumnOptions" clearable :style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="加工时间" prop="workTime">
|
||||
<JnpfDatePicker v-model="dataForm.workTime" @change="changeData('workTime',-1)"
|
||||
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime"
|
||||
format="yyyy-MM-dd HH:mm:ss">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="外部单据编号" prop="businessCode">
|
||||
<JnpfInput v-model="dataForm.businessCode" @change="changeData('businessCode',-1)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="生产班组" prop="teamId">
|
||||
<JnpfPopupSelect v-model="dataForm.teamId" @change="changeData('teamId',-1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.teamId"
|
||||
placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='name' field='teamId'
|
||||
interfaceId="523050983727575621" :pageSize="20" :columnOptions="teamIdcolumnOptions"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<jnpf-form-tip-item label="仓库名称" prop="warehouseId">
|
||||
<JnpfPopupSelect v-model="dataForm.warehouseId" @change="changeData('warehouseId',-1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.warehouseId"
|
||||
placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='name' field='warehouseId'
|
||||
interfaceId="529573170819104773" :pageSize="20"
|
||||
:columnOptions="warehouseIdcolumnOptions" clearable :style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="备注" prop="remark">
|
||||
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item>
|
||||
<JnpfGroupTitle content="加工成品" contentPosition="left">
|
||||
</JnpfGroupTitle>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2>设计子表</h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.workOrderProductList" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column label="商品名称" prop="productId">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>商品名称
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfPopupSelect v-model="scope.row.productId"
|
||||
@change="changeData('workorderproduct-productId',scope.$index)"
|
||||
:rowIndex="scope.$index" :formData="dataForm"
|
||||
:templateJson="interfaceRes.workorderproductproductId" placeholder="请选择"
|
||||
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='name' :field="'productId'+scope.$index"
|
||||
interfaceId="519505017699307077" :pageSize="20"
|
||||
:columnOptions="workorderproductproductIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加工单位" prop="unitId">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>加工单位
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfPopupSelect v-model="scope.row.unitId"
|
||||
@change="changeData('workorderproduct-unitId',scope.$index)"
|
||||
:rowIndex="scope.$index" :formData="dataForm"
|
||||
:templateJson="interfaceRes.workorderproductunitId" placeholder="请选择" hasPage
|
||||
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
|
||||
relationField='unit_name' :field="'unitId'+scope.$index"
|
||||
interfaceId="523054191598383685" :pageSize="20"
|
||||
:columnOptions="workorderproductunitIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加工数量" prop="proportionNum">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>加工数量
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.proportionNum"
|
||||
@change="changeData('workorderproduct-proportionNum',scope.$index)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="BOM" prop="bomId">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>BOM
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfPopupSelect v-model="scope.row.bomId"
|
||||
@change="changeData('workorderproduct-bomId',scope.$index)"
|
||||
:rowIndex="scope.$index" :formData="dataForm"
|
||||
:templateJson="interfaceRes.workorderproductbomId" placeholder="请选择" hasPage
|
||||
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
|
||||
relationField='bom_name' :field="'bomId'+scope.$index"
|
||||
interfaceId="523054588681531973" :pageSize="20"
|
||||
:columnOptions="workorderproductbomIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参考成本价" prop="cost">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>参考成本价
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.cost"
|
||||
@change="changeData('workorderproduct-cost',scope.$index)" placeholder="请输入"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货区名称" prop="cargoId">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>货区名称
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfPopupSelect v-model="scope.row.cargoId"
|
||||
@change="changeData('workorderproduct-cargoId',scope.$index)"
|
||||
:rowIndex="scope.$index" :formData="dataForm"
|
||||
:templateJson="interfaceRes.workorderproductcargoId" placeholder="请选择" hasPage
|
||||
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
|
||||
relationField='cargo_name' :field="'cargoId'+scope.$index"
|
||||
interfaceId="530700536261903749" :pageSize="20"
|
||||
:columnOptions="workorderproductcargoIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>备注
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.remark"
|
||||
@change="changeData('workorderproduct-remark',scope.$index)" placeholder="请输入"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delworkorderproductList(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addworkorderproductList()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item>
|
||||
<JnpfGroupTitle content="原材料" contentPosition="left">
|
||||
</JnpfGroupTitle>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2>设计子表</h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.workOrderPrimaryList" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column label="商品id" prop="productId">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>商品id
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfPopupSelect v-model="scope.row.productId"
|
||||
@change="changeData('workorderprimary-productId',scope.$index)"
|
||||
:rowIndex="scope.$index" :formData="dataForm"
|
||||
:templateJson="interfaceRes.workorderprimaryproductId" placeholder="请选择"
|
||||
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='name' :field="'productId'+scope.$index"
|
||||
interfaceId="519505017699307077" :pageSize="20"
|
||||
:columnOptions="workorderprimaryproductIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="理论发料量" prop="theoryNum">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>理论发料量
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.theoryNum"
|
||||
@change="changeData('workorderprimary-theoryNum',scope.$index)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际发料量" prop="realityNum">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>实际发料量
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.realityNum"
|
||||
@change="changeData('workorderprimary-realityNum',scope.$index)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货区名称" prop="cargoId">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>货区名称
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfPopupSelect v-model="scope.row.cargoId"
|
||||
@change="changeData('workorderprimary-cargoId',scope.$index)"
|
||||
:rowIndex="scope.$index" :formData="dataForm"
|
||||
:templateJson="interfaceRes.workorderprimarycargoId" placeholder="请选择" hasPage
|
||||
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
|
||||
relationField='cargo_name' :field="'cargoId'+scope.$index"
|
||||
interfaceId="530700536261903749" :pageSize="20"
|
||||
:columnOptions="workorderprimarycargoIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delworkorderprimaryList(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addworkorderprimaryList()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- 表单结束 -->
|
||||
</template>
|
||||
</el-form>
|
||||
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
|
||||
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<div class="upAndDown-button" v-if="dataForm.id">
|
||||
<el-button @click="prev" :disabled='prevDis'>
|
||||
{{'上一条'}}
|
||||
</el-button>
|
||||
<el-button @click="next" :disabled='nextDis'>
|
||||
{{'下一条'}}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
|
||||
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from "vuex";
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
||||
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
||||
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dataFormSubmitType: 0,
|
||||
continueBtnLoading: false,
|
||||
index: 0,
|
||||
prevDis: false,
|
||||
nextDis: false,
|
||||
allList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
setting: {},
|
||||
eventType: '',
|
||||
userBoxVisible: false,
|
||||
selectDialogVisible: false,
|
||||
currTableConf: {},
|
||||
dataValueAll: {},
|
||||
addTableConf: {
|
||||
workOrderProductList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
|
||||
workOrderPrimaryList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
|
||||
},
|
||||
//可选范围默认值
|
||||
ableAll: {
|
||||
},
|
||||
tableRows: {
|
||||
workOrderProductList: {
|
||||
productId: '',
|
||||
productIdOptions: [],
|
||||
unitId: '',
|
||||
unitIdOptions: [],
|
||||
proportionNum: '',
|
||||
proportionNumOptions: [],
|
||||
bomId: '',
|
||||
bomIdOptions: [],
|
||||
cost: '',
|
||||
costOptions: [],
|
||||
cargoId: '',
|
||||
cargoIdOptions: [],
|
||||
remark: '',
|
||||
remarkOptions: [],
|
||||
enabledmark: undefined
|
||||
},
|
||||
workOrderPrimaryList: {
|
||||
productId: '',
|
||||
productIdOptions: [],
|
||||
theoryNum: '',
|
||||
theoryNumOptions: [],
|
||||
realityNum: '',
|
||||
realityNumOptions: [],
|
||||
cargoId: '',
|
||||
cargoIdOptions: [],
|
||||
enabledmark: undefined
|
||||
},
|
||||
},
|
||||
Vmodel: "",
|
||||
currVmodel: "",
|
||||
dataForm: {
|
||||
type: undefined,
|
||||
code: undefined,
|
||||
businessfactoryId: undefined,
|
||||
businessId: undefined,
|
||||
workTime: 1711987199000,
|
||||
businessCode: undefined,
|
||||
teamId: undefined,
|
||||
warehouseId: "520922296513201285",
|
||||
remark: undefined,
|
||||
creatorUserId: undefined,
|
||||
creatorTime: undefined,
|
||||
lastModifyUserId: undefined,
|
||||
lastModifyTime: undefined,
|
||||
workOrderProductList: [],
|
||||
workOrderPrimaryList: [],
|
||||
version: 0,
|
||||
},
|
||||
tableRequiredData: {},
|
||||
dataRule:
|
||||
{
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
businessfactoryId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
businessId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
workTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
teamId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
typeOptions: [{ "fullName": "完工入库", "id": "1" }, { "fullName": "计划加工", "id": "2" }, { "fullName": "其他加工", "id": "3" }],
|
||||
typeProps: { "label": "fullName", "value": "id" },
|
||||
businessfactoryIdcolumnOptions: [{ "label": "工厂编码", "value": "code" }, { "label": "工厂名称", "value": "name" },],
|
||||
businessIdcolumnOptions: [{ "label": "生产线编码", "value": "code" }, { "label": "生产线名称", "value": "name" },],
|
||||
teamIdcolumnOptions: [{ "label": "班组编码", "value": "team_code" }, { "label": "班组名称", "value": "team_name" },],
|
||||
warehouseIdcolumnOptions: [{ "label": "仓库名称", "value": "name" }, { "label": "仓库编码", "value": "code" },],
|
||||
workorderproductproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" },],
|
||||
workorderproductunitIdcolumnOptions: [{ "label": "单位名称", "value": "unit_name" },],
|
||||
workorderproductbomIdcolumnOptions: [{ "label": "bom名称", "value": "bom_name" }, { "label": "bom编码", "value": "bom_code" },],
|
||||
workorderproductcargoIdcolumnOptions: [{ "label": "货区名称", "value": "cargo_name" },],
|
||||
workorderprimaryproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" },],
|
||||
workorderprimarycargoIdcolumnOptions: [{ "label": "货区名称", "value": "cargo_name" },],
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
type: [],
|
||||
code: [],
|
||||
businessfactoryId: [],
|
||||
businessId: [],
|
||||
workTime: [],
|
||||
businessCode: [],
|
||||
teamId: [],
|
||||
warehouseId: [],
|
||||
remark: [],
|
||||
creatorUserId: [],
|
||||
creatorTime: [],
|
||||
lastModifyUserId: [],
|
||||
lastModifyTime: [],
|
||||
workorderproductproductId: [],
|
||||
workorderproductunitId: [],
|
||||
workorderproductproportionNum: [],
|
||||
workorderproductbomId: [{ "fieldName": "", "field": "productId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "Wldr122", "relationField": "workorderproductList-productId", "required": "0" }],
|
||||
workorderproductcost: [],
|
||||
workorderproductcargoId: [{ "fieldName": "", "field": "businessOrganizeId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "AyAmdw1", "relationField": "warehouseId", "required": "0" }],
|
||||
workorderproductremark: [],
|
||||
workorderprimaryproductId: [],
|
||||
workorderprimarytheoryNum: [],
|
||||
workorderprimaryrealityNum: [],
|
||||
workorderprimarycargoId: [{ "fieldName": "", "field": "businessOrganizeId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "AyAmdw1", "relationField": "warehouseId", "required": "0" }],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.dataAll()
|
||||
this.initDefaultData()
|
||||
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
prev() {
|
||||
this.index--
|
||||
if (this.index === 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
this.nextDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
next() {
|
||||
this.index++
|
||||
if (this.index === this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
this.prevDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
getInfo(id) {
|
||||
request({
|
||||
url: '/api/scm/WorkOrder/' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = false
|
||||
this.childIndex = index
|
||||
let modelAll = model.split("-");
|
||||
let faceMode = "";
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
for (let key in this.interfaceRes) {
|
||||
if (key != faceMode) {
|
||||
let faceReList = this.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
if (faceReList[i].relationField == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
if (this[options]) {
|
||||
this[options]()
|
||||
}
|
||||
this.changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!this.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < this.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
dataAll() {
|
||||
},
|
||||
workorderproductExist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.workOrderProductList.length; i++) {
|
||||
const e = this.dataForm.workOrderProductList[i];
|
||||
if (!e.productId) {
|
||||
this.$message({
|
||||
message: '商品名称不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.unitId) {
|
||||
this.$message({
|
||||
message: '加工单位不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.proportionNum) {
|
||||
this.$message({
|
||||
message: '加工数量不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.bomId) {
|
||||
this.$message({
|
||||
message: 'BOM不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
workorderprimaryExist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.workOrderPrimaryList.length; i++) {
|
||||
const e = this.dataForm.workOrderPrimaryList[i];
|
||||
if (!e.productId) {
|
||||
this.$message({
|
||||
message: '商品id不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
init(id, isDetail, allList) {
|
||||
this.prevDis = false
|
||||
this.nextDis = false
|
||||
this.allList = allList || []
|
||||
if (allList.length) {
|
||||
this.index = this.allList.findIndex(item => item.id === id)
|
||||
if (this.index == 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
if (this.index == this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
} else {
|
||||
this.prevDis = true
|
||||
this.nextDis = true
|
||||
}
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/scm/WorkOrder/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit(type) {
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.workorderproductExist()) return
|
||||
if (!this.workorderprimaryExist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
let _data = this.dataList()
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/scm/WorkOrder',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
})
|
||||
this.continueBtnLoading = false
|
||||
return
|
||||
}
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/scm/WorkOrder/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
addworkorderproductList() {
|
||||
let item = {
|
||||
productId: '',
|
||||
unitId: '',
|
||||
proportionNum: undefined,
|
||||
bomId: '',
|
||||
cost: undefined,
|
||||
cargoId: '',
|
||||
remark: undefined,
|
||||
}
|
||||
this.getworkorderproductList(item)
|
||||
},
|
||||
delworkorderproductList(index) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.dataForm.workOrderProductList.splice(index, 1);
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
getworkorderproductList(value) {
|
||||
let item = { ...this.tableRows.workOrderProductList, ...value }
|
||||
this.dataForm.workOrderProductList.push(item)
|
||||
this.childIndex = this.dataForm.workOrderProductList.length - 1
|
||||
this.isEdit = true
|
||||
this.isEdit = false
|
||||
this.childIndex = -1
|
||||
},
|
||||
addworkorderprimaryList() {
|
||||
let item = {
|
||||
productId: '',
|
||||
theoryNum: undefined,
|
||||
realityNum: undefined,
|
||||
cargoId: '',
|
||||
}
|
||||
this.getworkorderprimaryList(item)
|
||||
},
|
||||
delworkorderprimaryList(index) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.dataForm.workOrderPrimaryList.splice(index, 1);
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
getworkorderprimaryList(value) {
|
||||
let item = { ...this.tableRows.workOrderPrimaryList, ...value }
|
||||
this.dataForm.workOrderPrimaryList.push(item)
|
||||
this.childIndex = this.dataForm.workOrderPrimaryList.length - 1
|
||||
this.isEdit = true
|
||||
this.isEdit = false
|
||||
this.childIndex = -1
|
||||
},
|
||||
openSelectDialog(key) {
|
||||
this.currTableConf = this.addTableConf[key]
|
||||
this.currVmodel = key
|
||||
this.selectDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.selectDialog.init()
|
||||
})
|
||||
},
|
||||
addForSelect(data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let t = data[i]
|
||||
if (this['get' + this.currVmodel]) {
|
||||
this['get' + this.currVmodel](t)
|
||||
}
|
||||
}
|
||||
},
|
||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue = null;
|
||||
let timeValue = Number(timeValueData)
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime()
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getBeforeData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getLaterData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
||||
let timeDataValue = null
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00'
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00'
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
previousDate = getBeforeTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
previousDate = getLaterTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
dataList() {
|
||||
var _data = this.dataForm;
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
this.isEdit = true
|
||||
this.dataAll()
|
||||
for (let i = 0; i < _dataAll.workOrderProductList.length; i++) {
|
||||
this.childIndex = i
|
||||
}
|
||||
for (let i = 0; i < _dataAll.workOrderPrimaryList.length; i++) {
|
||||
this.childIndex = i
|
||||
}
|
||||
this.childIndex = -1
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
Loading…
Reference in new issue