Commit 419de07a authored by dragondean@qq.com's avatar dragondean@qq.com

修复部分bug

parent d6ae5a8e
...@@ -96,8 +96,10 @@ export default { ...@@ -96,8 +96,10 @@ export default {
isAllProduct(isAllProduct){ isAllProduct(isAllProduct){
this.$emit('setall', isAllProduct) this.$emit('setall', isAllProduct)
}, },
defaultIds(){ defaultIds(newValue, oldValue){
this.loadDefaultProds() if(!oldValue || !oldValue.length){
this.loadDefaultProds()
}
}, },
isall(isall){ isall(isall){
this.isAllProduct = isall this.isAllProduct = isall
...@@ -119,6 +121,9 @@ export default { ...@@ -119,6 +121,9 @@ export default {
this.isAllProduct = true this.isAllProduct = true
}, */ }, */
loadDefaultProds(){ loadDefaultProds(){
if(!this.defaultIds || !this.defaultIds.length){
return false
}
getProductList({ids: this.defaultIds.join(',')}).then(res => { getProductList({ids: this.defaultIds.join(',')}).then(res => {
res.data.forEach(item => { res.data.forEach(item => {
this.choose(item) this.choose(item)
......
...@@ -84,9 +84,7 @@ ...@@ -84,9 +84,7 @@
<el-input :value="selectedRouter ? $l(selectedRouter, 'startTitle') + ' > ' + $l(selectedRouter, 'destTitle') : ''" disabled :placeholder="$t('请在右侧选择线路')"></el-input> <el-input :value="selectedRouter ? $l(selectedRouter, 'startTitle') + ' > ' + $l(selectedRouter, 'destTitle') : ''" disabled :placeholder="$t('请在右侧选择线路')"></el-input>
</el-form-item> </el-form-item>
<select size="5" v-model="form.lineId" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px" :disabled="inWarehouse"> <select size="5" v-model="form.lineId" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px" :disabled="inWarehouse">
<template v-for="item in routerList"> <option v-for="item in routerList" :value="item.id" :key="item.id">{{$l(item, 'startTitle')}} >> {{$l(item, 'destTitle')}}</option>
<option :value="item.id" :key="item.id">{{$l(item, 'startTitle')}} >> {{$l(item, 'destTitle')}}</option>
</template>
</select> </select>
</div> </div>
</el-card> </el-card>
...@@ -120,7 +118,7 @@ ...@@ -120,7 +118,7 @@
@change="onProductChange(scope.row, $event)" @change="onProductChange(scope.row, $event)"
:disabled="!canAddProduct || !productEditable" :disabled="!canAddProduct || !productEditable"
@focus="scope.row.updated = true" @focus="scope.row.updated = true"
/> />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -137,14 +135,9 @@ ...@@ -137,14 +135,9 @@
:disabled="!canAddProduct || !productEditable" /> :disabled="!canAddProduct || !productEditable" />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="商品类型" width="160px">
<template slot-scope="{row}">
<selector disabled v-model="row.goodsType" :options="productAttrList" label-field="attrName" value-field="id"></selector>
</template>
</el-table-column> -->
<el-table-column :label="$t('品牌')" width="100px"> <el-table-column :label="$t('品牌')" width="100px">
<template slot="header" slot-scope="scope"> <template slot="header">
{{$t('品牌')}} <span class="red">*</span> {{$t('品牌')}} <span class="red">*</span>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -160,7 +153,7 @@ ...@@ -160,7 +153,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('件数')" width="90px"> <el-table-column :label="$t('件数')" width="90px">
<template slot="header" slot-scope="scope"> <template slot="header">
{{$t('件数')}} <span class="red">*</span> {{$t('件数')}} <span class="red">*</span>
</template> </template>
<template slot-scope="{row}"> <template slot-scope="{row}">
...@@ -180,29 +173,29 @@ ...@@ -180,29 +173,29 @@
<el-input v-model="row.quantity" @keyup.native="checkPositiveInterge(row, 'quantity')" :disabled="!canAddProduct || !productEditable" /> <el-input v-model="row.quantity" @keyup.native="checkPositiveInterge(row, 'quantity')" :disabled="!canAddProduct || !productEditable" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('总体积') + '(m³)'" width="100px"> <el-table-column :label="$t('总体积') + '(m³)'" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item label="" <el-form-item label=""
:prop="`orderItemVOList.${scope.$index}.volume`" :prop="`orderItemVOList.${scope.$index}.volume`"
:rules="[ :rules="[
{ type: 'number', min: 0, message: $t('体积错误'), trigger: 'blur'} { validator: validatorPositiveNumber, message: $t('体积错误'), trigger: 'blur'}
]" ]"
class="mb-0 mr-0" class="mb-0 mr-0"
> >
<el-input v-model.number="scope.row.volume" :disabled="!canAddProduct || !productEditable" /> <el-input v-model="scope.row.volume" :disabled="!canAddProduct || !productEditable" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('总重量') + '(kg)'" width="100px"> <el-table-column :label="$t('总重量') + '(kg)'" width="120px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item label="" <el-form-item label=""
:prop="`orderItemVOList.${scope.$index}.weight`" :prop="`orderItemVOList.${scope.$index}.weight`"
:rules="[ :rules="[
{ type: 'number', min: 0, message: $t('重量错误'), trigger: 'blur'} { validator: validatorPositiveNumber, message: $t('重量错误'), trigger: 'blur'}
]" ]"
class="mb-0 mr-0" class="mb-0 mr-0"
> >
<el-input v-model.number="scope.row.weight" :disabled="!canAddProduct || !productEditable" /> <el-input v-model="scope.row.weight" :disabled="!canAddProduct || !productEditable" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -528,13 +521,22 @@ import WorkFlow from '@/components/WorkFlow' ...@@ -528,13 +521,22 @@ import WorkFlow from '@/components/WorkFlow'
// 缓存默认的表单数据 // 缓存默认的表单数据
let defaultFormData = null let defaultFormData = null
window.Decimal = Decimal window.Decimal = Decimal
export default { export default {
name: "EcwOrderEdit", name: "EcwOrderEdit",
components: { components: {
ProductSelector, Selector, CustomerContactSelector, AreaSelector, FileUpload, AreaCodeSelector, ChooseContactDialog, QuickCreateCustomer, SupplierSelector, WorkFlow ProductSelector, Selector, CustomerContactSelector, AreaSelector, FileUpload, AreaCodeSelector, ChooseContactDialog, QuickCreateCustomer, SupplierSelector, WorkFlow
}, },
data() { data() {
let validatorPositiveNumber = (rule, value, callback) => {
if (!value) return callback(new Error('请输入数字'))
if (!Number(value)) return callback(new Error('请输入有效数字'))
let reg = /((^[1-9]\d*)|^0)(\.\d*){0,1}$/;
if (!reg.test(value)) return callback(new Error('请输入有效数字'));
callback();
}
return { return {
validatorPositiveNumber,
customDraweeList: [], customDraweeList: [],
// draweeList: [], // draweeList: [],
// 遮罩层 // 遮罩层
...@@ -957,29 +959,9 @@ export default { ...@@ -957,29 +959,9 @@ export default {
}, },
// 检查正整数 // 检查正整数
checkPositiveInterge(row, field){ checkPositiveInterge(row, field){
console.log('checkPositiveInterge', field, row[field])
row[field] = row[field].replace(/[^\d]/g, '') row[field] = row[field].replace(/[^\d]/g, '')
}, },
/* // 检查正数
checkPositive(row, field){
if(row.field < 0){
row[field] = 0
}
}, */
/* onFileChoosed(e){
window.choosed = e
console.log('onFileChoosed', e)
const reader = new FileReader();
reader.readAsBinaryString(e.target.files[0]);
reader.onload = function(e) {
const data = e.target.result;
const zzexcel = xlsx.read(data, {
type: 'binary'
})
window.zzexcel = zzexcel
window.tableJson = xlsx.utils.sheet_to_json(zzexcel.Sheets[zzexcel.SheetNames[0]])
}
}, */
onProductChange(row, product){ onProductChange(row, product){
console.log(product) console.log(product)
// 如果是清除商品 // 如果是清除商品
......
...@@ -228,8 +228,7 @@ ...@@ -228,8 +228,7 @@
<!-- 特价 --> <!-- 特价 -->
<template v-if=" <template v-if="
exclude(scope.row.status, [0]) && exclude(scope.row.status, [0]) &&
exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14]) && exclude(scope.row.abnormalState, [1 ,99 ,2 ,3 ,4 ,9 ,10 ,11 ,12 ,14])
exclude(scope.row.shipmentState, [320,322,323])
"> ">
<el-dropdown-item @click.native="$router.push('/order/special/' + scope.row.orderId)" v-hasPermi="['ecw:order:update']" >{{$t('特价')}}</el-dropdown-item> <el-dropdown-item @click.native="$router.push('/order/special/' + scope.row.orderId)" v-hasPermi="['ecw:order:update']" >{{$t('特价')}}</el-dropdown-item>
</template> </template>
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<template v-slot="{row}"> <template v-slot="{row}">
<el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showDiscountItem=row">{{$t('优惠申请')}}</el-button> <el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showDiscountItem=row">{{$t('优惠申请')}}</el-button>
<el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showCommissionItem=row">{{$t('佣金规则')}}</el-button> <el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showCommissionItem=row">{{$t('佣金规则')}}</el-button>
<el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:update']" @click="showAllowanceItem=row">{{$t('管理折扣')}}</el-button> <el-button v-if="row.originalSeaFreight" size="mini" type="text" v-hasPermi="['ecw:order:discount']" @click="showAllowanceItem=row">{{$t('管理折扣')}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment