Commit ba2adbc1 authored by Smile's avatar Smile

需求 127后台-集运-包裹列表 校验添加

parent c0213666
...@@ -121,6 +121,63 @@ ...@@ -121,6 +121,63 @@
> >
<span>{{ scope.row.expressNo }}</span> <span>{{ scope.row.expressNo }}</span>
</router-link> </router-link>
<div
style="display: flex;flex-wrap: wrap"
v-if="scope.row.hasErrors || scope.row.hasReturnStatus || scope.row.returnStatus===0 || scope.row.hasExitApproval || scope.row.hasAddApproval || scope.row.isOverLimit"
>
<el-button
size="mini"
style="margin-left: 2px;margin-bottom:2px;"
type="danger"
circle
v-if="scope.row.hasErrors"
>{{ $t('') }}</el-button>
<el-button
size="mini"
style="margin-left: 2px;margin-bottom:2px;"
type="danger"
circle
v-if="scope.row.isFollowOverTime"
>{{ $t('') }}</el-button>
<el-button
size="mini"
style="margin-left: 2px;margin-bottom:2px;"
type="danger"
circle
v-if="scope.row.hasReturnStatus || scope.row.returnStatus===0"
>{{ $t('退') }}</el-button>
<el-button
size="mini"
style="margin-left: 2px;margin-bottom:2px;"
type="danger"
circle
v-if="scope.row.hasExitApproval"
>{{ $t('') }}</el-button>
<el-button
size="mini"
style="margin-left: 2px;margin-bottom:2px;"
type="danger"
circle
v-if="scope.row.hasAddApproval"
>{{ $t('') }}</el-button>
<el-button
size="mini"
style="margin-left: 2px;margin-bottom:2px;"
type="danger"
circle
v-if="scope.row.isOverLimit"
>{{ $t('') }}</el-button>
<el-button
size="mini"
style="margin-left: 2px;margin-bottom:2px;"
type="danger"
circle
v-if="scope.row.consSpecialNeeds&&scope.row.consSpecialNeeds.length>0"
v-for="(item, index) in specialRendering(scope.row.consSpecialNeeds)"
:key="index"
>{{ item.symbol }}</el-button
>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户" align="center"> <el-table-column label="客户" align="center">
...@@ -136,7 +193,13 @@ ...@@ -136,7 +193,13 @@
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId"/> <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="scope.row.transportId"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('在仓时长')" align="center" prop="inWarehouseDays"></el-table-column> <el-table-column :label="$t('在仓时长')" align="center" prop="inWarehouseDays">
<template slot-scope="scope">
<span :style="{ color: scope.row.isOverTime ? 'red' : '' }">
{{ scope.row.inWarehouseDays }}
</span>
</template>
</el-table-column>
<el-table-column :label="$t('动态')" align="center"> <el-table-column :label="$t('动态')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CONS_BUSINESS_NODE" :value="scope.row.businessNode"/> <dict-tag :type="DICT_TYPE.CONS_BUSINESS_NODE" :value="scope.row.businessNode"/>
...@@ -161,7 +224,9 @@ ...@@ -161,7 +224,9 @@
</el-table-column> </el-table-column>
<el-table-column label="验货数据" align="center"> <el-table-column label="验货数据" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ getInspectionInfo(scope.row.consItemList, scope.row.inspectStatus) }} <span :style="{ color: scope.row.isOverLimit ? 'red' : '' }">
{{ getInspectionInfo(scope.row.consItemList, scope.row.inspectStatus) }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="货值(RMB)" align="center" prop="worth"/> <el-table-column label="货值(RMB)" align="center" prop="worth"/>
...@@ -175,6 +240,11 @@ ...@@ -175,6 +240,11 @@
<span>{{ parseTime(scope.row.signedTime) }}</span> <span>{{ parseTime(scope.row.signedTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="签收图片" align="center" prop="mediaUrl" width="180">
<template slot-scope="scope">
<a v-if="scope.row.signed==1" :style="{ color: 'blue' }" @click="showSignImage(scope.row.mediaUrl)">{{ $t("签收图片") }}</a>
</template>
</el-table-column>
<el-table-column label="签收备注" align="center" prop="signedRemarks"/> <el-table-column label="签收备注" align="center" prop="signedRemarks"/>
<el-table-column label="始发仓" align="center"> <el-table-column label="始发仓" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -225,7 +295,7 @@ ...@@ -225,7 +295,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('退仓处理状态')" align="center"> <el-table-column :label="$t('退仓处理状态')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.AUDIT_STATUS" :value="scope.row.returnStatus"/> {{ scope.row.returnStatus === null ? '' : scope.row.returnStatus === 0 ? $t('未处理') : $t('已处理') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="包裹号" align="center" prop="consNum"/> <el-table-column label="包裹号" align="center" prop="consNum"/>
...@@ -240,10 +310,9 @@ ...@@ -240,10 +310,9 @@
<el-dropdown> <el-dropdown>
<el-button type="text">{{ $t("操作") }}</el-button> <el-button type="text">{{ $t("操作") }}</el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="handleUpdate(scope.row)">修改 <el-dropdown-item v-if="isEditable(scope.row)" @click.native="handleUpdate(scope.row)">修改
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item size="mini" type="text" icon="el-icon-delete" @click.native="handleDelete(scope.row)" <el-dropdown-item size="mini" type="text" v-if="scope.row.status==1" @click.native="handleDelete(scope.row)">删除
v-hasPermi="['ecw:cons:delete']">删除
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.native="handleInspect(scope.row)"> <el-dropdown-item @click.native="handleInspect(scope.row)">
{{ $t('验货') }} {{ $t('验货') }}
...@@ -255,7 +324,7 @@ ...@@ -255,7 +324,7 @@
<el-dropdown-item @click.native="specialNeedsConsLook(scope.row)"> <el-dropdown-item @click.native="specialNeedsConsLook(scope.row)">
{{ $t('特需查看') }} {{ $t('特需查看') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.native="feeApplication(scope.row)"> <el-dropdown-item v-if="scope.row.status!=2&&!scope.row.hasAddApproval&&!scope.row.hasExitApproval" @click.native="feeApplication(scope.row)">
{{ $t('费用申请') }} {{ $t('费用申请') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.native="consFollowup(scope.row)">{{ $t('跟进') }} <el-dropdown-item @click.native="consFollowup(scope.row)">{{ $t('跟进') }}
...@@ -286,6 +355,7 @@ ...@@ -286,6 +355,7 @@
</el-dropdown-item> </el-dropdown-item>
<!-- 退仓 --> <!-- 退仓 -->
<el-dropdown-item <el-dropdown-item
v-if="scope.row.status===2&&!hasAddApproval"
@click.native=" @click.native="
show = true show = true
consId = scope.row.id consId = scope.row.id
...@@ -294,6 +364,16 @@ ...@@ -294,6 +364,16 @@
>{{ $t("退仓") }} >{{ $t("退仓") }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item <el-dropdown-item
v-if="!hasExitApproval"
@click.native="
show = true
consId = scope.row.id
"
v-hasPermi="['ecw:order:warehouse_exit']"
>{{ $t("取消退仓") }}
</el-dropdown-item>
<el-dropdown-item
v-if="scope.row.status===2&&!hasAddApproval"
@click.native=" @click.native="
showReturnWarehouse = true showReturnWarehouse = true
consId = scope.row.id consId = scope.row.id
...@@ -396,6 +476,9 @@ ...@@ -396,6 +476,9 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :title="$t('签收图片')" :visible.sync="mvShow" :before-close="closeMv" :close-on-click-modal="false">
<image-and-video-upload readonly :fileSize="50" :isShowTip="true" :value="this.mediaUrl" ></image-and-video-upload>
</el-dialog>
<Transmutation :showException.sync="showException" :id="id" @determine="getList"></Transmutation> <Transmutation :showException.sync="showException" :id="id" @determine="getList"></Transmutation>
<SpecialNeedsCons :showSpecialNeedsCons.sync="showSpecialNeedsCons" :currency="JSON.stringify(currencyList)" <SpecialNeedsCons :showSpecialNeedsCons.sync="showSpecialNeedsCons" :currency="JSON.stringify(currencyList)"
:consId="id" :consNum="consNum" @determine="getList"></SpecialNeedsCons> :consId="id" :consNum="consNum" @determine="getList"></SpecialNeedsCons>
...@@ -438,10 +521,12 @@ import {DICT_TYPE} from "@/utils/dict"; ...@@ -438,10 +521,12 @@ import {DICT_TYPE} from "@/utils/dict";
import {arrryToKeyedObjectBy} from "@/utils"; import {arrryToKeyedObjectBy} from "@/utils";
import Selector from "@/components/Selector/index.vue"; import Selector from "@/components/Selector/index.vue";
import Label from "@/views/cms/label/index.vue"; import Label from "@/views/cms/label/index.vue";
import ImageAndVideoUpload from "@/components/ImageAndVideoUpload/index.vue";
export default { export default {
name: "Cons", name: "Cons",
components: { components: {
ImageAndVideoUpload,
Label, Label,
Selector, Selector,
ConsWithdrawal, ConsWithdrawal,
...@@ -539,7 +624,9 @@ export default { ...@@ -539,7 +624,9 @@ export default {
id: null, id: null,
currencyList: [], currencyList: [],
consNum: null, consNum: null,
feeApplicationBol: false feeApplicationBol: false,
mvShow:false,
mediaUrl:null
}; };
}, },
created() { created() {
...@@ -587,6 +674,46 @@ export default { ...@@ -587,6 +674,46 @@ export default {
}, },
}, },
methods: { methods: {
isEditable(item){
debugger
if (item.status===1){
return true;
}else if (item.status===2&&!item.hasAddApproval&&!item.hasExitApproval){
return true;
}else {
return false
}
},
showSignImage(val){
if (val) {
this.mediaUrl = val
}
this.mvShow = true
},
closeMv(){
this.mediaUrl = null
this.mvShow = false
},
specialRendering(val) {
console.log("val", val);
if (val !== undefined && val!==null &&val.length>0) {
// let i = val.split(",");
let i = val.map(item => item.needStatus).join(",");
return this.getDictDatas(this.DICT_TYPE.CONS_SPECIAL_NEEDS_STATUS)
.filter((e) => {
return i.indexOf(e.value) > -1;
})
.map((item) => {
// 打字开头的用最后一个字,否则取第一个字
item.symbol =
item.label[0] == ""
? item.label[item.label.length - 1]
: item.label[0];
return item;
});
}
},
/* 跳转订单详情 */ /* 跳转订单详情 */
jumpOrderDetail(row) { jumpOrderDetail(row) {
this.$router.push({ this.$router.push({
...@@ -723,6 +850,10 @@ export default { ...@@ -723,6 +850,10 @@ export default {
if (!this.consIds.length) { if (!this.consIds.length) {
return this.$message.error(this.$t('最少选择一个包裹')) return this.$message.error(this.$t('最少选择一个包裹'))
} }
const hasSigned = this.consList.some(item => item.signed);
if (hasSigned) {
return this.$message.error(this.$t('已签收包裹不允许操作,请检查'));
}
this.showConsBatchSignOff = true; this.showConsBatchSignOff = true;
}, },
...@@ -730,12 +861,30 @@ export default { ...@@ -730,12 +861,30 @@ export default {
if (!this.consIds.length) { if (!this.consIds.length) {
return this.$message.error(this.$t('最少选择一个包裹')) return this.$message.error(this.$t('最少选择一个包裹'))
} }
//如果状态不是代签收或已签收但无在途追加 signed=0 代签收 signed=1 已签收 hasAddApproval 是否存在追加 使用some
if (!this.consList.every(item =>
item.status === 0 ||
(item.status === 1 && !item.hasAddApproval)
)) {
return this.$message.error(this.$t('包裹不允许操作,请检查'));
}
this.showConsBatchEdit = true; this.showConsBatchEdit = true;
}, },
handleTransfer() { handleTransfer() {
if (!this.consIds.length) { if (!this.consIds.length) {
return this.$message.error(this.$t('最少选择一个包裹')) return this.$message.error(this.$t('最少选择一个包裹'))
} }
// 查找第一个不符合条件的包裹
const invalidItem = this.consList.find(item =>
// 条件逻辑:允许转运的条件(取反后检测非法项)
!(item.status === 2 && !item.hasReturnStatus && !item.hasExitApproval && !item.hasAddApproval)
);
if (invalidItem) {
return this.$message.error(
this.$t('{consNum}不允许转运,请检查!', { consNum: invalidItem.consNum })
);
}
// 2. 防御空数组 // 2. 防御空数组
if (!this.consList?.length) return if (!this.consList?.length) return
// 新增客户ID非空校验(在所有校验前优先检查) // 新增客户ID非空校验(在所有校验前优先检查)
......
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