|
@@ -121,7 +121,7 @@
|
|
|
<!-- 发货数量 :rules="rules.shipQuantity"-->
|
|
|
<template slot="shipmentQuantity" slot-scope="text, record, index">
|
|
|
<a-form-model-item prop="shipmentQuantity">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.shipmentQuantity" />
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.shipmentQuantity" @blur="dataDefault('2',record)" />
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
|
|
@@ -154,20 +154,20 @@
|
|
|
<!-- 报关单价 :rules="rules.customsDeclarationUnitPrice"-->
|
|
|
<template slot="customsDeclarationUnitPrice" slot-scope="text, record, index">
|
|
|
<a-form-model-item prop="customsDeclarationUnitPrice">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.customsDeclarationUnitPrice" />
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.customsDeclarationUnitPrice" @blur="dataDefault('1',record)"/>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<!-- 套装件数 :rules="rules.numberOfSets"-->
|
|
|
<template slot="numberOfSets" slot-scope="text, record, index">
|
|
|
<a-form-model-item prop="numberOfSets">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.numberOfSets" />
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.numberOfSets" @blur="dataDefault('3',record)"/>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
|
|
|
<!-- 工厂单价 :rules="rules.factoryUnitPrice"-->
|
|
|
<template slot="factoryUnitPrice" slot-scope="text, record, index">
|
|
|
<a-form-model-item prop="factoryUnitPrice">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.factoryUnitPrice" />
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.factoryUnitPrice" @blur="dataDefault('4',record)" />
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
|
|
@@ -192,7 +192,7 @@
|
|
|
<!--手册纱单价 -->
|
|
|
<template slot="manualYarnUnitPrice" slot-scope="text, record, index">
|
|
|
<a-form-model-item prop="manualYarnUnitPrice">
|
|
|
- <a-input style="width:100%" type="text" v-model="record.manualYarnUnitPrice" :disabled='manualYarnDisabled' @change="changeManualYarn('Price',record.manualYarnUnitPrice)" />
|
|
|
+ <a-input style="width:100%" type="text" v-model="record.manualYarnUnitPrice" :disabled='manualYarnDisabled' @blur="dataDefault('5',record)" @change="changeManualYarn('Price',record.manualYarnUnitPrice)" />
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
|
|
@@ -250,10 +250,10 @@
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
import moment from 'moment'
|
|
|
-
|
|
|
import ReferOrderDataModal from '@views/shipment-details/referOrderDataModal.vue'
|
|
|
-
|
|
|
import { addShipmentList } from '@api/document/shipmentList'
|
|
|
+import { getDotConfig, getDotValidExpress } from '@/utils/myutil'
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
name: 'AddShipDetDrawer', // 新增 发运明细 抽屉
|
|
@@ -655,6 +655,7 @@ export default {
|
|
|
},
|
|
|
// 参照订单数据
|
|
|
referOrderDataOpen() {
|
|
|
+ this.$refs.referOrderDataModal.range = []
|
|
|
if(this.syShippingDetailsItemList.length !== 0){
|
|
|
this.$refs.referOrderDataModal.fatherData.push(this.syShippingDetailsItemList[0])
|
|
|
}
|
|
@@ -724,6 +725,7 @@ export default {
|
|
|
|
|
|
addShipmentList(newObj).then(res => {
|
|
|
if (res.success) {
|
|
|
+ debugger
|
|
|
this.$message.success('新增成功');
|
|
|
this.close();
|
|
|
// 清空信息
|
|
@@ -791,6 +793,52 @@ export default {
|
|
|
// this.syShippingDetailsItemList.push(addrow)
|
|
|
// },
|
|
|
// --------------------------------------
|
|
|
+
|
|
|
+
|
|
|
+ //输入框小数点位数限制
|
|
|
+ dataDefault(data,record){
|
|
|
+ this.syShippingDetailsItemList
|
|
|
+ var i = 0
|
|
|
+ for(;i<this.syShippingDetailsItemList.length;i++){
|
|
|
+ // if()
|
|
|
+ }
|
|
|
+ //报关单价
|
|
|
+ if(data === '1'){
|
|
|
+ var position = record.customsDeclarationUnitPrice.indexOf('.') + 1; //小数点的位置
|
|
|
+ var digit = record.customsDeclarationUnitPrice.length - position; //小数的位数
|
|
|
+ if(digit >= 4){this.$message.error('报关单价最多四位小数!'); record.customsDeclarationUnitPrice = ''}
|
|
|
+ }
|
|
|
+ //发货数量
|
|
|
+ if(data === '2'){
|
|
|
+ var position = record.shipmentQuantity.indexOf('.') + 1; //小数点的位置
|
|
|
+ var digit = record.shipmentQuantity.length - position; //小数的位数
|
|
|
+ if(digit !== 0){this.$message.error('发货数量必须是整数!'); record.shipmentQuantity = ''}
|
|
|
+ }
|
|
|
+ //套装件数
|
|
|
+ if(data === '3'){
|
|
|
+ var position = record.numberOfSets.indexOf('.') + 1; //小数点的位置
|
|
|
+ var digit = record.numberOfSets.length - position; //小数的位数
|
|
|
+ if(digit !== 0){this.$message.error('套装件数必须是整数!');record.numberOfSets = ''}
|
|
|
+ }
|
|
|
+ //工厂单价
|
|
|
+ if(data === '4'){
|
|
|
+ var position = record.factoryUnitPrice.indexOf('.') + 1; //小数点的位置
|
|
|
+ var digit = record.factoryUnitPrice.length - position; //小数的位数
|
|
|
+ if(digit >= 4){this.$message.error('工厂单价最多四位小数!'); record.factoryUnitPrice = ''}
|
|
|
+ }
|
|
|
+ //手册纱单价
|
|
|
+ if(data === '5'){
|
|
|
+ var position = record.manualYarnUnitPrice.indexOf('.') + 1; //小数点的位置
|
|
|
+ var digit = record.manualYarnUnitPrice.length - position; //小数的位数
|
|
|
+ if(digit >= 4){
|
|
|
+ this.$message.error('手册纱最多四位小数!');
|
|
|
+ this.syShippingDetailsItemList.map(item => {
|
|
|
+ item.manualYarnUnitPrice = ''
|
|
|
+ })
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 操作 删除
|
|
|
handleDelete(index) {
|
|
|
return this.syShippingDetailsItemList.splice(index, 1)
|