|
@@ -1,109 +1,108 @@
|
|
<template>
|
|
<template>
|
|
- <a-modal
|
|
|
|
- :title="title"
|
|
|
|
- :width="1400"
|
|
|
|
- :visible="visible"
|
|
|
|
- :confirmLoading="confirmLoading"
|
|
|
|
- @cancel="handleCancel"
|
|
|
|
- >
|
|
|
|
- <a-card >
|
|
|
|
|
|
+ <a-modal :title="title" :width="1400" :visible="visible" :confirmLoading="confirmLoading" @cancel="handleCancel">
|
|
|
|
+ <a-card>
|
|
<a-form :form="form">
|
|
<a-form :form="form">
|
|
<row-list :col="1" v-show="false">
|
|
<row-list :col="1" v-show="false">
|
|
<row-item>
|
|
<row-item>
|
|
<a-form-item>
|
|
<a-form-item>
|
|
- <a-input v-decorator="['id']" type="hidden"/>
|
|
|
|
- <a-input v-decorator="['sbId']" type="hidden"/>
|
|
|
|
|
|
+ <a-input v-decorator="['id']" type="hidden" />
|
|
|
|
+ <a-input v-decorator="['sbId']" type="hidden" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
</row-list>
|
|
</row-list>
|
|
<row-list :col="2">
|
|
<row-list :col="2">
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="计划类型"
|
|
label="计划类型"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-select v-decorator="['type', { rules: [{required: true, message: '采购计划类型不能为空'}]}]" placeholder="请选择">
|
|
|
|
- <a-select-option
|
|
|
|
- v-for="(label,value) in typeMap"
|
|
|
|
- :key="value"
|
|
|
|
- :label="label"
|
|
|
|
- :value="parseInt(value)">{{ label }}
|
|
|
|
|
|
+ <a-select
|
|
|
|
+ v-decorator="['type', { rules: [{ required: true, message: '采购计划类型不能为空' }] }]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ <a-select-option v-for="(label, value) in typeMap" :key="value" :label="label" :value="parseInt(value)"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
|
|
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="请购原因"
|
|
label="请购原因"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-input
|
|
|
|
- v-decorator="['remark']"/>
|
|
|
|
|
|
+ <a-input v-decorator="['remark']" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="采购类型"
|
|
label="采购类型"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-select v-decorator="['cptcode', { rules: [{required: true, message: '采购类型不能为空'}]}]" placeholder="请选择">
|
|
|
|
- <a-select-option
|
|
|
|
- v-for="(label,value) in cptcodeMap"
|
|
|
|
- :key="value"
|
|
|
|
- :label="label"
|
|
|
|
- :value="value">{{ label }}
|
|
|
|
|
|
+ <a-select
|
|
|
|
+ v-decorator="['cptcode', { rules: [{ required: true, message: '采购类型不能为空' }] }]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ <a-select-option v-for="(label, value) in cptcodeMap" :key="value" :label="label" :value="value"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="业务类型"
|
|
label="业务类型"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-select v-decorator="['cbustype', {rules: [{required: true, message: '业务类型不能为空'}]}]" placeholder="请选择">
|
|
|
|
- <a-select-option
|
|
|
|
- v-for="(label,value) in cbustypeMap"
|
|
|
|
- :key="value"
|
|
|
|
- :label="label"
|
|
|
|
- :value="value">{{ label }}
|
|
|
|
|
|
+ <a-select
|
|
|
|
+ v-decorator="['cbustype', { rules: [{ required: true, message: '业务类型不能为空' }] }]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
|
|
+ <a-select-option v-for="(label, value) in cbustypeMap" :key="value" :label="label" :value="value"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="采购厂区"
|
|
label="采购厂区"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-select :disabled="title==='编辑'" v-decorator="['oldOrNew', {rules: [{required: true, message: '采购厂区不能为空'}]}]" @change="setTree">
|
|
|
|
- <a-select-option
|
|
|
|
- v-for="(label,value) in flagMap"
|
|
|
|
- :key="value"
|
|
|
|
- :label="label"
|
|
|
|
- :value="parseInt(value)">{{ label }}
|
|
|
|
|
|
+ <a-select
|
|
|
|
+ :disabled="title === '编辑'"
|
|
|
|
+ v-decorator="['oldOrNew', { rules: [{ required: true, message: '采购厂区不能为空' }] }]"
|
|
|
|
+ @change="setTree"
|
|
|
|
+ >
|
|
|
|
+ <a-select-option v-for="(label, value) in flagMap" :key="value" :label="label" :value="parseInt(value)"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="申请部门"
|
|
label="申请部门"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-select :disabled="!oldOrNew" v-decorator="['cdepcode', {rules: [{required: true, message: '申请部门不能为空'}]}]" placeholder="请选择">
|
|
|
|
|
|
+ <a-select
|
|
|
|
+ :disabled="!oldOrNew"
|
|
|
|
+ v-decorator="['cdepcode', { rules: [{ required: true, message: '申请部门不能为空' }] }]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
<a-select-option
|
|
<a-select-option
|
|
- v-for="(label,value) in oldOrNew===2?deptMap:deptNewMap"
|
|
|
|
|
|
+ v-for="(label, value) in oldOrNew === 2 ? deptMap : deptNewMap"
|
|
:key="value"
|
|
:key="value"
|
|
:label="label"
|
|
:label="label"
|
|
- :value="value">{{ label }}
|
|
|
|
|
|
+ :value="value"
|
|
|
|
+ >{{ label }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -124,7 +123,7 @@
|
|
<!-- </a-select>-->
|
|
<!-- </a-select>-->
|
|
<!-- </a-form-item>-->
|
|
<!-- </a-form-item>-->
|
|
<!-- </row-item>-->
|
|
<!-- </row-item>-->
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="计划到货日期"
|
|
label="计划到货日期"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
@@ -135,10 +134,11 @@
|
|
:disabled-date="disabledDate"
|
|
:disabled-date="disabledDate"
|
|
@change="dateChange"
|
|
@change="dateChange"
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
- v-decorator="['planGetDate', {rules: [{required: true, message: '计划到货日期不能为空'}]}]" />
|
|
|
|
|
|
+ v-decorator="['planGetDate', { rules: [{ required: true, message: '计划到货日期不能为空' }] }]"
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="需求日期"
|
|
label="需求日期"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
@@ -149,23 +149,23 @@
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
:disabled-date="disabledDate2"
|
|
:disabled-date="disabledDate2"
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
:format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
- v-decorator="['needDate', {rules: [{required: true, message: '需求日期不能为空'}]}]" />
|
|
|
|
|
|
+ v-decorator="['needDate', { rules: [{ required: true, message: '需求日期不能为空' }] }]"
|
|
|
|
+ />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="设备位号"
|
|
label="设备位号"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
>
|
|
>
|
|
- <a-input
|
|
|
|
- style="width: 70%"
|
|
|
|
- disabled
|
|
|
|
- v-decorator="['positionNo']" />
|
|
|
|
- <a-button :disabled="title==='编辑'" style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
|
|
|
|
|
|
+ <a-input style="width: 70%" disabled v-decorator="['positionNo']" />
|
|
|
|
+ <a-button :disabled="title === '编辑'" style="width: 30%" type="primary" @click="handleSbSelect"
|
|
|
|
+ >选择</a-button
|
|
|
|
+ >
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</row-item>
|
|
</row-item>
|
|
- <row-item >
|
|
|
|
|
|
+ <row-item>
|
|
<a-form-item
|
|
<a-form-item
|
|
label="关联项目"
|
|
label="关联项目"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
:labelCol="BaseTool.Constant.labelCol"
|
|
@@ -209,7 +209,7 @@
|
|
<a-card>
|
|
<a-card>
|
|
<div class="table-operator" style="margin-bottom: 8px;">
|
|
<div class="table-operator" style="margin-bottom: 8px;">
|
|
<a-button size="small" :disabled="!oldOrNew" type="primary" @click="handleSpareStoreSelect">
|
|
<a-button size="small" :disabled="!oldOrNew" type="primary" @click="handleSpareStoreSelect">
|
|
- <a-icon type="plus"/>
|
|
|
|
|
|
+ <a-icon type="plus" />
|
|
物料库添加
|
|
物料库添加
|
|
</a-button>
|
|
</a-button>
|
|
<!-- <a-button size="small" :disabled="!(oldOrNew&&sbId)" style="margin-left:20px;" type="primary" @click="handleBomSpareStoreSelect">
|
|
<!-- <a-button size="small" :disabled="!(oldOrNew&&sbId)" style="margin-left:20px;" type="primary" @click="handleBomSpareStoreSelect">
|
|
@@ -217,37 +217,32 @@
|
|
BOM添加
|
|
BOM添加
|
|
</a-button> -->
|
|
</a-button> -->
|
|
</div>
|
|
</div>
|
|
- <a-table
|
|
|
|
- bordered
|
|
|
|
- :data-source="data"
|
|
|
|
- :columns="columns"
|
|
|
|
- tableLayout="auto"
|
|
|
|
- rowKey="id"
|
|
|
|
- :scroll="{ x: 1500 }"
|
|
|
|
- >
|
|
|
|
|
|
+ <a-table bordered :data-source="data" :columns="columns" tableLayout="auto" rowKey="id" :scroll="{ x: 1500 }">
|
|
<template slot="iexchrate" slot-scope="text, record">
|
|
<template slot="iexchrate" slot-scope="text, record">
|
|
<a-input-number v-model="record.iexchrate" :step="0.01" />
|
|
<a-input-number v-model="record.iexchrate" :step="0.01" />
|
|
</template>
|
|
</template>
|
|
- <template slot="funitprice" slot-scope="text, record" >
|
|
|
|
- <a-input-number v-model="record.funitprice" :step="0.0001" @blur="computeTax(record,1)" />
|
|
|
|
|
|
+ <template slot="funitprice" slot-scope="text, record">
|
|
|
|
+ <a-input-number v-model="record.funitprice" :step="0.0001" @blur="computeTax(record, 1)" />
|
|
</template>
|
|
</template>
|
|
<template slot="fmoney" slot-scope="text, record">
|
|
<template slot="fmoney" slot-scope="text, record">
|
|
- <a-input-number v-model="record.fmoney" :step="0.01" @blur="computeTax(record,2)" />
|
|
|
|
|
|
+ <a-input-number v-model="record.fmoney" :step="0.01" @blur="computeTax(record, 2)" />
|
|
</template>
|
|
</template>
|
|
<template slot="num" slot-scope="text, record">
|
|
<template slot="num" slot-scope="text, record">
|
|
- <a-input-number
|
|
|
|
|
|
+ <!-- <a-input-number
|
|
v-model="record.num"
|
|
v-model="record.num"
|
|
:min="1"
|
|
:min="1"
|
|
:formatter="value => `${value+record.unit}`"
|
|
:formatter="value => `${value+record.unit}`"
|
|
:parser="value => value.replace(`${record.unit}`, '')"
|
|
:parser="value => value.replace(`${record.unit}`, '')"
|
|
- @blur="computeTax(record,1)" />
|
|
|
|
|
|
+ @blur="computeTax(record,1)" /> -->
|
|
|
|
+ <a-input-number v-model="record.num" :min="1" @blur="computeTax(record, 1)" />
|
|
</template>
|
|
</template>
|
|
<template slot="ipertaxrate" slot-scope="text, record">
|
|
<template slot="ipertaxrate" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
v-model="record.ipertaxrate"
|
|
v-model="record.ipertaxrate"
|
|
:step="0.01"
|
|
:step="0.01"
|
|
:formatter="value => `${value}%`"
|
|
:formatter="value => `${value}%`"
|
|
- :parser="value => value.replace('%', '')" />
|
|
|
|
|
|
+ :parser="value => value.replace('%', '')"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
<template slot="cbmemo" slot-scope="text, record">
|
|
<template slot="cbmemo" slot-scope="text, record">
|
|
<a-input v-model="record.cbmemo" />
|
|
<a-input v-model="record.cbmemo" />
|
|
@@ -273,10 +268,9 @@
|
|
<template slot="footer">
|
|
<template slot="footer">
|
|
<a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
|
|
<a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
|
|
</template>
|
|
</template>
|
|
- <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
|
|
|
|
- <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
|
|
|
|
- <BomSpareStoreSelectModal ref="bomSpareStoreSelectModal" @selected="handleSpareStoreSelected"/>
|
|
|
|
-
|
|
|
|
|
|
+ <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd" />
|
|
|
|
+ <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected" />
|
|
|
|
+ <BomSpareStoreSelectModal ref="bomSpareStoreSelectModal" @selected="handleSpareStoreSelected" />
|
|
</a-modal>
|
|
</a-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -295,9 +289,8 @@ export default {
|
|
SpareStoreSelectModal,
|
|
SpareStoreSelectModal,
|
|
SbInfoSelectModal,
|
|
SbInfoSelectModal,
|
|
BomSpareStoreSelectModal
|
|
BomSpareStoreSelectModal
|
|
-
|
|
|
|
},
|
|
},
|
|
- data () {
|
|
|
|
|
|
+ data() {
|
|
return {
|
|
return {
|
|
form: this.$form.createForm(this),
|
|
form: this.$form.createForm(this),
|
|
visible: false,
|
|
visible: false,
|
|
@@ -425,7 +418,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- created () {
|
|
|
|
|
|
+ created() {
|
|
this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
|
|
this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
|
|
this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_TYPE)
|
|
this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_TYPE)
|
|
this.cptcodeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_ORDER_PLAN_TYPE)
|
|
this.cptcodeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_ORDER_PLAN_TYPE)
|
|
@@ -435,7 +428,7 @@ export default {
|
|
this.soMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SO_TYPE)
|
|
this.soMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SO_TYPE)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- computeTax (record, type) {
|
|
|
|
|
|
+ computeTax(record, type) {
|
|
if (type === 1) {
|
|
if (type === 1) {
|
|
console.log(record)
|
|
console.log(record)
|
|
const data = (record.funitprice * record.num * (1 + record.ipertaxrate / 100)).toFixed(2)
|
|
const data = (record.funitprice * record.num * (1 + record.ipertaxrate / 100)).toFixed(2)
|
|
@@ -446,19 +439,19 @@ export default {
|
|
}
|
|
}
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
},
|
|
},
|
|
- disabledDate (current) {
|
|
|
|
|
|
+ disabledDate(current) {
|
|
// Can not select days before today and today
|
|
// Can not select days before today and today
|
|
return current && current < moment().endOf('day')
|
|
return current && current < moment().endOf('day')
|
|
},
|
|
},
|
|
- disabledDate2 (current) {
|
|
|
|
|
|
+ disabledDate2(current) {
|
|
// Can not select days before today and today
|
|
// Can not select days before today and today
|
|
return current && current <= this.date
|
|
return current && current <= this.date
|
|
},
|
|
},
|
|
- dateChange (data) {
|
|
|
|
|
|
+ dateChange(data) {
|
|
console.log(data)
|
|
console.log(data)
|
|
this.date = data
|
|
this.date = data
|
|
},
|
|
},
|
|
- base (record) {
|
|
|
|
|
|
+ base(record) {
|
|
this.visible = true
|
|
this.visible = true
|
|
if (this.BaseTool.Object.isBlank(record)) {
|
|
if (this.BaseTool.Object.isBlank(record)) {
|
|
this.title = '新增'
|
|
this.title = '新增'
|
|
@@ -467,57 +460,69 @@ export default {
|
|
this.title = '编辑'
|
|
this.title = '编辑'
|
|
this.data = record.detailVOS
|
|
this.data = record.detailVOS
|
|
this.setTree(record.oldOrNew)
|
|
this.setTree(record.oldOrNew)
|
|
- const { form: { setFieldsValue } } = this
|
|
|
|
|
|
+ const {
|
|
|
|
+ form: { setFieldsValue }
|
|
|
|
+ } = this
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- setFieldsValue(Object.assign(pick(record, [
|
|
|
|
- 'id',
|
|
|
|
- 'sbId',
|
|
|
|
- 'type',
|
|
|
|
- 'oldOrNew',
|
|
|
|
- 'projectId',
|
|
|
|
- 'positionNo',
|
|
|
|
- 'cdefine11',
|
|
|
|
- 'cdefine12',
|
|
|
|
- 'cptcode',
|
|
|
|
- 'remark',
|
|
|
|
- 'cdepcode',
|
|
|
|
- 'cbustype',
|
|
|
|
- 'planGetDate',
|
|
|
|
- 'needDate',
|
|
|
|
- 'cdefine22',
|
|
|
|
- 'cdefine28'
|
|
|
|
- ])))
|
|
|
|
|
|
+ setFieldsValue(
|
|
|
|
+ Object.assign(
|
|
|
|
+ pick(record, [
|
|
|
|
+ 'id',
|
|
|
|
+ 'sbId',
|
|
|
|
+ 'type',
|
|
|
|
+ 'oldOrNew',
|
|
|
|
+ 'projectId',
|
|
|
|
+ 'positionNo',
|
|
|
|
+ 'cdefine11',
|
|
|
|
+ 'cdefine12',
|
|
|
|
+ 'cptcode',
|
|
|
|
+ 'remark',
|
|
|
|
+ 'cdepcode',
|
|
|
|
+ 'cbustype',
|
|
|
|
+ 'planGetDate',
|
|
|
|
+ 'needDate',
|
|
|
|
+ 'cdefine22',
|
|
|
|
+ 'cdefine28'
|
|
|
|
+ ])
|
|
|
|
+ )
|
|
|
|
+ )
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 获取巡检人与巡检主管信息
|
|
// 获取巡检人与巡检主管信息
|
|
|
|
|
|
- handleSbSelect () {
|
|
|
|
|
|
+ handleSbSelect() {
|
|
this.$refs.sbInfoSelectModal.base({})
|
|
this.$refs.sbInfoSelectModal.base({})
|
|
},
|
|
},
|
|
- handleSbSelectd (keys, rows) {
|
|
|
|
- const [ key ] = keys
|
|
|
|
- const [ row ] = rows
|
|
|
|
- const { form: { setFieldsValue } } = this
|
|
|
|
|
|
+ handleSbSelectd(keys, rows) {
|
|
|
|
+ const [key] = keys
|
|
|
|
+ const [row] = rows
|
|
|
|
+ const {
|
|
|
|
+ form: { setFieldsValue }
|
|
|
|
+ } = this
|
|
this.sbId = key
|
|
this.sbId = key
|
|
// 日期处理
|
|
// 日期处理
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- setFieldsValue(Object.assign({
|
|
|
|
- 'sbId': key,
|
|
|
|
- 'positionNo': row.positionNo
|
|
|
|
- }))
|
|
|
|
|
|
+ setFieldsValue(
|
|
|
|
+ Object.assign({
|
|
|
|
+ sbId: key,
|
|
|
|
+ positionNo: row.positionNo
|
|
|
|
+ })
|
|
|
|
+ )
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- setTree (val) {
|
|
|
|
|
|
+ setTree(val) {
|
|
console.log(val)
|
|
console.log(val)
|
|
this.oldOrNew = val
|
|
this.oldOrNew = val
|
|
fetchProjectTree({
|
|
fetchProjectTree({
|
|
flag: val
|
|
flag: val
|
|
- }).then((res) => {
|
|
|
|
|
|
+ }).then(res => {
|
|
this.treeData = res.data
|
|
this.treeData = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- save () {
|
|
|
|
- const { form: { validateFieldsAndScroll } } = this
|
|
|
|
|
|
+ save() {
|
|
|
|
+ const {
|
|
|
|
+ form: { validateFieldsAndScroll }
|
|
|
|
+ } = this
|
|
// this.confirmLoading = true
|
|
// this.confirmLoading = true
|
|
validateFieldsAndScroll((errors, values) => {
|
|
validateFieldsAndScroll((errors, values) => {
|
|
if (errors) {
|
|
if (errors) {
|
|
@@ -528,12 +533,18 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
let status = 0
|
|
let status = 0
|
|
- values.needDate = values.needDate ? this.BaseTool.Date.formatter(values.needDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
|
|
|
|
- values.planGetDate = values.planGetDate ? this.BaseTool.Date.formatter(values.planGetDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
|
|
|
|
|
|
+ values.needDate = values.needDate
|
|
|
|
+ ? this.BaseTool.Date.formatter(values.needDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
|
|
+ : null
|
|
|
|
+ values.planGetDate = values.planGetDate
|
|
|
|
+ ? this.BaseTool.Date.formatter(values.planGetDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
|
|
|
|
+ : null
|
|
values.detailDTOS = this.data.map(item => {
|
|
values.detailDTOS = this.data.map(item => {
|
|
- if (!item.funitprice) {
|
|
|
|
|
|
+ if (!parseFloat(item.funitprice) > 0) {
|
|
status++
|
|
status++
|
|
|
|
+ console.log(item.funitprice)
|
|
this.$message.error('请填写' + item.spareName + '单价')
|
|
this.$message.error('请填写' + item.spareName + '单价')
|
|
|
|
+ return
|
|
}
|
|
}
|
|
item.funitprice = (+item.funitprice).toFixed(4)
|
|
item.funitprice = (+item.funitprice).toFixed(4)
|
|
item.ipertaxrate = (+item.ipertaxrate).toFixed(2)
|
|
item.ipertaxrate = (+item.ipertaxrate).toFixed(2)
|
|
@@ -557,14 +568,14 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handleSpareStoreSelect () {
|
|
|
|
|
|
+ handleSpareStoreSelect() {
|
|
console.log(this.oldOrNew)
|
|
console.log(this.oldOrNew)
|
|
this.$refs.spareStoreSelectModal.base({ tokenType: this.oldOrNew })
|
|
this.$refs.spareStoreSelectModal.base({ tokenType: this.oldOrNew })
|
|
},
|
|
},
|
|
- handleBomSpareStoreSelect () {
|
|
|
|
|
|
+ handleBomSpareStoreSelect() {
|
|
this.$refs.bomSpareStoreSelectModal.base({ tokenType: this.oldOrNew, sbId: this.sbId })
|
|
this.$refs.bomSpareStoreSelectModal.base({ tokenType: this.oldOrNew, sbId: this.sbId })
|
|
},
|
|
},
|
|
- handleSpareStoreSelected (record, keys, rows) {
|
|
|
|
|
|
+ handleSpareStoreSelected(record, keys, rows) {
|
|
console.log(rows)
|
|
console.log(rows)
|
|
const codes = []
|
|
const codes = []
|
|
const { data } = this
|
|
const { data } = this
|
|
@@ -591,18 +602,22 @@ export default {
|
|
isNew: this.oldOrNew
|
|
isNew: this.oldOrNew
|
|
}).then(res => {
|
|
}).then(res => {
|
|
data.forEach(item => {
|
|
data.forEach(item => {
|
|
- item.funitprice = !item.funitprice ? res.data.find(price => item.no === price.cinvCode) ? res.data.find(price => item.no === price.cinvCode).iunitPrice : 0 : item.funitprice
|
|
|
|
|
|
+ item.funitprice = !item.funitprice
|
|
|
|
+ ? res.data.find(price => item.no === price.cinvCode)
|
|
|
|
+ ? res.data.find(price => item.no === price.cinvCode).iunitPrice
|
|
|
|
+ : 0
|
|
|
|
+ : item.funitprice
|
|
const data = (item.funitprice * item.num * (1 + item.ipertaxrate / 100)).toFixed(2)
|
|
const data = (item.funitprice * item.num * (1 + item.ipertaxrate / 100)).toFixed(2)
|
|
item.fmoney = isNaN(data) ? 0 : data
|
|
item.fmoney = isNaN(data) ? 0 : data
|
|
})
|
|
})
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handleDelOne (record) {
|
|
|
|
|
|
+ handleDelOne(record) {
|
|
const data = [...this.data]
|
|
const data = [...this.data]
|
|
this.data = data.filter(item => record.spareId !== item.spareId)
|
|
this.data = data.filter(item => record.spareId !== item.spareId)
|
|
},
|
|
},
|
|
- handleCancel (values) {
|
|
|
|
|
|
+ handleCancel(values) {
|
|
this.visible = false
|
|
this.visible = false
|
|
this.data = []
|
|
this.data = []
|
|
this.date = null
|
|
this.date = null
|
|
@@ -612,16 +627,15 @@ export default {
|
|
this.oldOrNew = null
|
|
this.oldOrNew = null
|
|
this.$emit('ok', values)
|
|
this.$emit('ok', values)
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
-.tooltip{
|
|
|
|
- font-size:20px;
|
|
|
|
- color:#ccc;
|
|
|
|
|
|
+.tooltip {
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ color: #ccc;
|
|
&:hover {
|
|
&:hover {
|
|
- color:#2f54eb;
|
|
|
|
|
|
+ color: #2f54eb;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|