Commit 444d7e2c authored by knight's avatar knight Committed by wux

需求38 预装-未装柜完成或出仓完成的订单修改货值

parent fe39f1d4
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:rules="rules" :rules="rules"
label-position="left" label-position="left"
inline inline
:disabled="updateChannel" :disabled="updateChannel || updateWorth"
:validate-on-rule-change="false" :validate-on-rule-change="false"
> >
<el-card v-if="form.applyStatus == 1" class="mb-10"> <el-card v-if="form.applyStatus == 1" class="mb-10">
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
<!-- <customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" type="1" /> --> <!-- <customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" type="1" /> -->
<div class="contact"> <div class="contact">
<el-input v-model="form.consignorName" placeholder="" :disabled2="inWarehouse"/> <el-input v-model="form.consignorName" placeholder="" :disabled2="inWarehouse"/>
<img v-if="!updateChannel" src="@/assets/svg/contacts.svg" class="phonebook" <img v-if="!updateChannel || !updateWorth" src="@/assets/svg/contacts.svg" class="phonebook"
@click="contactChooseType='consignor'"/> @click="contactChooseType='consignor'"/>
<img v-if="!updateChannel" src="@/assets/svg/contact_create.svg" class="phonebook" <img v-if="!updateChannel || !updateWorth" src="@/assets/svg/contact_create.svg" class="phonebook"
@click="quickCreateType='0'"/> @click="quickCreateType='0'"/>
</div> </div>
</el-form-item> </el-form-item>
...@@ -89,9 +89,9 @@ ...@@ -89,9 +89,9 @@
<!-- <customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" type="1" /> --> <!-- <customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" type="1" /> -->
<div class="contact"> <div class="contact">
<el-input v-model="form.consigneeName" placeholder="" :disabled="!hasConsignee"/> <el-input v-model="form.consigneeName" placeholder="" :disabled="!hasConsignee"/>
<img v-if="!updateChannel && hasConsignee" src="@/assets/svg/contacts.svg" class="phonebook" <img v-if="(!updateChannel || !updateWorth) && hasConsignee" src="@/assets/svg/contacts.svg" class="phonebook"
@click="contactChooseType='consignee'"/> @click="contactChooseType='consignee'"/>
<img v-if="!updateChannel && hasConsignee" src="@/assets/svg/contact_create.svg" class="phonebook" <img v-if="(!updateChannel || !updateWorth) && hasConsignee" src="@/assets/svg/contact_create.svg" class="phonebook"
@click="quickCreateType='1'"/> @click="quickCreateType='1'"/>
</div> </div>
</el-form-item> </el-form-item>
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
</el-form-item> </el-form-item>
<!--select是原生组件,不受el-form的disabled控制--> <!--select是原生组件,不受el-form的disabled控制-->
<select size="5" v-model="form.lineId" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px" <select size="5" v-model="form.lineId" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px"
@change="handleChangeLineId"> @change="handleChangeLineId" :disabled="updateWorth" >
<option v-for="item in routerList" :value="item.id" :key="item.id"> <option v-for="item in routerList" :value="item.id" :key="item.id">
{{ $l(item, 'startTitle') }} >> {{ $l(item, 'destTitle') }} {{ $l(item, 'startTitle') }} >> {{ $l(item, 'destTitle') }}
( (
...@@ -186,6 +186,7 @@ ...@@ -186,6 +186,7 @@
:options="channelList" :options="channelList"
value-field="channelId" value-field="channelId"
:label-field="$l(null, 'name')" :label-field="$l(null, 'name')"
:disabled="updateWorth"
clearable clearable
></selector> ></selector>
</el-form> </el-form>
...@@ -325,18 +326,22 @@ ...@@ -325,18 +326,22 @@
{{ $t('货值') }}(RMB) <span class="red">*</span> {{ $t('货值') }}(RMB) <span class="red">*</span>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item label="" <!-- 重写el-form标签,根据自定义规则控制disabled -->
:prop="`orderItemVOList.${scope.$index}.worth`" <el-form :model="form">
:rules="[ <el-form-item label=""
{ required: true, message: $t('货值不能为空'), trigger: 'blur'}, :prop="`orderItemVOList.${scope.$index}.worth`"
{ type: 'number', min: 0, message: $t('货值错误'), trigger: 'blur'} :rules="[
]" { required: true, message: $t('货值不能为空'), trigger: 'blur'},
class="mb-0 mr-0" { type: 'number', min: 0, message: $t('货值错误'), trigger: 'blur'}
> ]"
<!--input事件在快速输入的时候,可能最后拿到的结果不是最后输入的参数,所以改成在blur的时候计算--> class="mb-0 mr-0"
<el-input-number :min="0" :controls="false" style="width: 80px" v-model.number="scope.row.worth" >
:disabled="!canAddProduct" @blur="calculationPrice"/>
</el-form-item> <!--input事件在快速输入的时候,可能最后拿到的结果不是最后输入的参数,所以改成在blur的时候计算-->
<el-input-number :min="0" :controls="false" style="width: 80px" v-model.number="scope.row.worth"
:disabled="updateChannel || !canAddProduct" @blur="calculationPrice"/>
</el-form-item>
</el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('商品特性')" width="250px"> <el-table-column :label="$t('商品特性')" width="250px">
...@@ -371,7 +376,7 @@ ...@@ -371,7 +376,7 @@
<el-table-column :label="$t('操作')" width="80px" fixed="right"> <el-table-column :label="$t('操作')" width="80px" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="danger" @click="delProduct(scope.$index)" <el-button size="mini" type="danger" @click="delProduct(scope.$index)"
:disabled="!productEditable || updateChannel">{{ $t('删除') }} :disabled="!productEditable || updateChannel || updateWorth">{{ $t('删除') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -379,10 +384,10 @@ ...@@ -379,10 +384,10 @@
</el-table> </el-table>
<div class="flex justify-end mt-10"> <div class="flex justify-end mt-10">
<el-button type="primary" size="mini" @click="addProduct(null)" <el-button type="primary" size="mini" @click="addProduct(null)"
:disabled="!canAddProduct || !productEditable || updateChannel">{{ $t('添加') }} :disabled="!canAddProduct || !productEditable || updateChannel || updateWorth">{{ $t('添加') }}
</el-button> </el-button>
<el-button type="primary" size="mini" @click="showBatchImportDialog=true" <el-button type="primary" size="mini" @click="showBatchImportDialog=true"
:disabled="!canAddProduct || !productEditable || updateChannel">{{ $t('批量添加') }} :disabled="!canAddProduct || !productEditable || updateChannel || updateWorth">{{ $t('批量添加') }}
</el-button> </el-button>
</div> </div>
<!-- <!--
...@@ -692,7 +697,7 @@ ...@@ -692,7 +697,7 @@
</el-button> </el-button>
</template> </template>
<!--更新渠道的时候用一个form包裹按钮,脱离原form的disabled控制--> <!--更新渠道的时候用一个form包裹按钮,脱离原form的disabled控制-->
<el-form v-else-if="updateChannel" inline> <el-form v-else-if="updateChannel || updateWorth" inline>
<el-button type="primary" @click="submitForm(2)">{{ $t('编辑订单') }}</el-button> <!--修改--> <el-button type="primary" @click="submitForm(2)">{{ $t('编辑订单') }}</el-button> <!--修改-->
</el-form> </el-form>
<template v-else> <template v-else>
...@@ -871,6 +876,7 @@ export default { ...@@ -871,6 +876,7 @@ export default {
calculating: false, // 是否正在计算费用,防止频繁重新请求 calculating: false, // 是否正在计算费用,防止频繁重新请求
initing: true, // 初始化中, initing: true, // 初始化中,
updateChannel: false, // 是否更新渠道 updateChannel: false, // 是否更新渠道
updateWorth: false, // 是否更新货值
offerData: [],// 关联报价单 offerData: [],// 关联报价单
offerIdNochange: false, offerIdNochange: false,
offerNumber: null, offerNumber: null,
...@@ -1297,6 +1303,8 @@ export default { ...@@ -1297,6 +1303,8 @@ export default {
// 变更出货渠道 // 变更出货渠道
this.updateChannel = this.$route.query.updateChannel == 1 this.updateChannel = this.$route.query.updateChannel == 1
// 修改货值功能
this.updateWorth = this.$route.query.updateWorth == 1
}, },
async created() { async created() {
console.log("%c created", "color: red") console.log("%c created", "color: red")
...@@ -1327,6 +1335,10 @@ export default { ...@@ -1327,6 +1335,10 @@ export default {
if (this.$route.query.updateChannel) { if (this.$route.query.updateChannel) {
this.updateChannel = true this.updateChannel = true
} }
// 修改货值
if (this.$route.query.updateWorth) {
this.updateWorth = true
}
if (this.$route.query.id) { if (this.$route.query.id) {
console.log('created 加载订单数据') console.log('created 加载订单数据')
this.getOrder() this.getOrder()
......
...@@ -347,8 +347,7 @@ ...@@ -347,8 +347,7 @@
<el-dropdown-item <el-dropdown-item
@click.native="handleUpdate(scope.row)" @click.native="handleUpdate(scope.row)"
v-hasPermi="['ecw:order:shipment:update']" v-hasPermi="['ecw:order:shipment:update']"
>{{ $t("编辑") }}</el-dropdown-item >{{ $t("编辑") }}</el-dropdown-item>
>
</template> </template>
<!-- 其他编辑 --> <!-- 其他编辑 -->
<template <template
...@@ -368,6 +367,18 @@ ...@@ -368,6 +367,18 @@
> >
</template> </template>
<!-- 修改货值(已预装/已理货/添加到预装) -->
<template v-if="scope.row.shipmentState == 307 ||
scope.row.shipmentState == 407 ||
scope.row.shipmentState == 409 ||
(scope.row.status == 5 && scope.row.shipmentState == 304)
">
<el-dropdown-item
@click.native="handleUpdate(scope.row,false ,true)"
v-hasPermi="['ecw:order:edit-worth']"
>{{ $t("修改货值") }}</el-dropdown-item>
</template>
<!-- 删除 --> <!-- 删除 -->
<template v-if="include(scope.row.status, [0, 2, 88])"> <template v-if="include(scope.row.status, [0, 2, 88])">
<el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'deleteOrder')" v-hasPermi="['ecw:order:delete']">{{ $t("删除") }}</el-dropdown-item> <el-dropdown-item @click.native="oprateOrder(scope.row.orderId, 'deleteOrder')" v-hasPermi="['ecw:order:delete']">{{ $t("删除") }}</el-dropdown-item>
...@@ -1380,11 +1391,14 @@ export default { ...@@ -1380,11 +1391,14 @@ export default {
this.$router.push("create?transportType=" + this.transportId) this.$router.push("create?transportType=" + this.transportId)
}, },
/** 修改按钮操作, updateChannel表示变更出货渠道 */ /** 修改按钮操作, updateChannel表示变更出货渠道 */
handleUpdate(row, updateChannel = false) { handleUpdate(row, updateChannel = false, updateWorth = false) {
let url = "edit?id=" + row.orderId let url = "edit?id=" + row.orderId
if (updateChannel) { if (updateChannel) {
url += "&updateChannel=1" url += "&updateChannel=1"
}else if(updateWorth){
url += "&updateWorth=1"
} }
console.log('url:' + url);
this.$router.push(url) this.$router.push(url)
}, },
......
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