Commit c65f8fe6 authored by 我在何方's avatar 我在何方
parents 4fa9d11f 206319da
...@@ -166,7 +166,7 @@ export function orderWarehouseIn(data){ ...@@ -166,7 +166,7 @@ export function orderWarehouseIn(data){
// 入仓修改 // 入仓修改
export function orderWarehouseInUpdateApply(data){ export function orderWarehouseInUpdateApply(data){
return request({ return request({
url: '/order/order-warehouse-in/update-apply', url: '/order/order-warehouse-in/update-or-updateApply',
method: 'put', method: 'put',
data data
}) })
...@@ -337,6 +337,7 @@ export function feeApplicationGet(params){ ...@@ -337,6 +337,7 @@ export function feeApplicationGet(params){
params params
}) })
} }
// 调仓-明细-后台使用
export function getAdjustInfo(params){ export function getAdjustInfo(params){
return request({ return request({
url:'/order/order-warehouse-in/get-adjust-info', url:'/order/order-warehouse-in/get-adjust-info',
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{{orderData.marks?orderData.marks:$t('')}} {{orderData.marks?orderData.marks:$t('')}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('已实装箱数/总箱数')"> <el-descriptions-item :label="$t('已实装箱数/总箱数')">
<span>{{currRow.installNum||0}}/{{orderData.costVO?orderData.costVO.totalNum:0}}</span> <span>{{currRow.installNum||0}}/{{currRow.num||0}}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('订单状态')"> <el-descriptions-item :label="$t('订单状态')">
{{orderData.status==99? $t('异常'):$t('正常')}} {{orderData.status==99? $t('异常'):$t('正常')}}
...@@ -183,14 +183,14 @@ ...@@ -183,14 +183,14 @@
<el-row> <el-row>
<el-form-item :label="$t('中文品名')+':'" prop="zhId"> <el-form-item :label="$t('中文品名')+':'" prop="zhId">
<el-select v-model="shopForm.zhId" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh"> <el-select v-model="shopForm.zhId" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.id" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row> <el-row>
<el-form-item :label="$t('英文品名')+':'" prop="enId"> <el-form-item :label="$t('英文品名')+':'" prop="enId">
<el-select v-model="shopForm.enId" :placeholder="$t('请选择英文品名')" @change="changeProdTitleEn"> <el-select v-model="shopForm.enId" :placeholder="$t('请选择英文品名')" @change="changeProdTitleEn">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.id" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-row> <el-row>
...@@ -339,6 +339,14 @@ export default { ...@@ -339,6 +339,14 @@ export default {
}); });
return _total; return _total;
}, },
totalSplitQty() {
let _total = 0;
const { orderSplitItemBackVOList = [] } = this.splitData;
orderSplitItemBackVOList.forEach((v) => {
_total = Decimal.add(_total, Number(v.quantity)).toNumber();
});
return _total;
},
/* 打开拆单 */ /* 打开拆单 */
getSplit() { getSplit() {
this.orderItems = this.currRow.goodsList ?? []; this.orderItems = this.currRow.goodsList ?? [];
...@@ -352,6 +360,13 @@ export default { ...@@ -352,6 +360,13 @@ export default {
this.splitData = data.filter((item) => !item.isMaster)?.[0] ?? {}; this.splitData = data.filter((item) => !item.isMaster)?.[0] ?? {};
}); });
}, },
itemDisabled(data) {
const { orderSplitItemBackVOList = [] } = this.splitData;
const isExist = orderSplitItemBackVOList.find(
(item) => item.orderItemId === data.orderItemId
);
return isExist ? true : false;
},
/* 查询拆单项 */ /* 查询拆单项 */
querySplitGoods() { querySplitGoods() {
getSplitList({ getSplitList({
...@@ -448,32 +463,63 @@ export default { ...@@ -448,32 +463,63 @@ export default {
this.isQuantity = false; this.isQuantity = false;
}, },
async changeProdTitleZh() { async changeProdTitleZh() {
const data = await this.getSelectData("zhId"); const item = this.setShopForm("zhId");
this.shopForm.enId = data.id; this.shopForm.enId = item.id;
this.shopForm = { ...this.shopForm }; this.shopForm = { ...this.shopForm };
await this.getSelectData(item);
}, },
async changeProdTitleEn() { async changeProdTitleEn() {
const data = await this.getSelectData("enId"); const item = this.setShopForm("enId");
this.shopForm.zhId = data.id; this.shopForm.zhId = item.id;
this.shopForm = { ...this.shopForm }; this.shopForm = { ...this.shopForm };
await this.getSelectData(item);
}, },
async getSelectData(key) { setShopForm(key) {
let list = []; let list = [];
list = this.orderItems.filter((item) => item.id == this.shopForm[key]); list = this.orderItems.filter((item) => item.id == this.shopForm[key]);
this.shopForm.num = this.currRow.num - this.currRow.installNum;
const data = list[0]; const data = list[0];
const itemNum = data.num ?? 0;
const itemQty = data.quantity ?? 0;
// 获取拆单项的总num
const total = this.totalSplitNum();
// 订单的剩余
const orderNum = this.currRow.num - this.currRow.installNum;
// 剩余可装
const remainNum = Decimal.sub(orderNum, total).toNumber();
this.shopForm.num = 0;
this.shopForm.putNum = 0;
// 剩余可装大于等于订单项剩余,显示订单剩余
if (remainNum >= itemNum) {
this.shopForm.num = remainNum;
this.shopForm.putNum = itemNum;
}
// 订单剩余小于订单项剩余,显示订单项剩余
if (remainNum < itemNum) {
this.shopForm.num = this.shopForm.putNum = remainNum;
}
const totalQty = this.totalSplitQty();
this.shopForm.quantity = 0;
if (totalQty >= itemQty) {
this.shopForm.quantity = totalQty;
}
if (totalQty < itemQty) {
this.shopForm.quantity = itemQty;
}
this.shopForm.orderItemId = data.orderItemId; this.shopForm.orderItemId = data.orderItemId;
this.shopForm.putNum = data.num ?? 0;
this.shopForm.quantity = data.quantity ?? 0;
this.shopForm.putQuantity = Decimal.div( this.shopForm.putQuantity = Decimal.div(
data.quantity ?? 0, this.shopForm.quantity,
this.shopForm.num this.shopForm.num
).toFixed(0); ).toFixed(0);
return data;
},
async getSelectData(item) {
await quantitycheck({ await quantitycheck({
seaFreightVolume: data.seaFreightVolume, seaFreightVolume: item.seaFreightVolume,
clearanceFreightVolume: data.clearanceFreightVolume, clearanceFreightVolume: item.clearanceFreightVolume,
}).then((res) => { }).then((res) => {
if (res.data) { if (res.data) {
this.isQuantity = true; this.isQuantity = true;
...@@ -489,7 +535,6 @@ export default { ...@@ -489,7 +535,6 @@ export default {
delete this.shopRules.putQuantity; delete this.shopRules.putQuantity;
} }
}); });
return data;
}, },
shopAdd() { shopAdd() {
this.$refs["shopForm"].validate((valid) => { this.$refs["shopForm"].validate((valid) => {
......
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-table :data="list"> <el-table :data="list">
<el-table-column label="订单编号" prop="orderNo"></el-table-column>
<el-table-column label="客户编号" prop="number"></el-table-column> <el-table-column label="客户编号" prop="number"></el-table-column>
<el-table-column label="订单编号" prop="orderNo"></el-table-column>
<el-table-column label="客户名称" prop="name"></el-table-column> <el-table-column label="客户名称" prop="name"></el-table-column>
<el-table-column label="新客户经理" prop="newCustomerService"> <el-table-column label="新客户经理" prop="newCustomerService">
<template v-slot="{row}"> <template v-slot="{row}">
......
...@@ -19,21 +19,21 @@ ...@@ -19,21 +19,21 @@
:rules="{ required: true, trigger: ['blur', 'change'],message:$t('客户不能为空')}" :rules="{ required: true, trigger: ['blur', 'change'],message:$t('客户不能为空')}"
:error="$t('客户不能为空')" :error="$t('客户不能为空')"
> >
<customer-selector v-model="form.customerId" @change="consignor = $event" /> <!-- <customer-selector v-model="form.customerId" @change="consignor = $event" />-->
<!-- <el-select--> <el-select
<!-- v-model="form.customerId"--> v-model="form.customerId"
<!-- :placeholder="$t('请选择客户')"--> :placeholder="$t('请选择客户')"
<!-- filterable--> filterable
<!-- @change="selectChange(form.customerId)"--> @change="selectChange(form.customerId)"
<!-- :filter-method="getUserList"--> :filter-method="getUserList"
<!-- >--> >
<!-- <el-option--> <el-option
<!-- v-for="supplier in allSupplier"--> v-for="supplier in allSupplier"
<!-- :key="supplier.id"--> :key="supplier.id"
<!-- :label="supplier.name"--> :label="supplier.name"
<!-- :value="supplier.id"--> :value="supplier.id"
<!-- ></el-option>--> ></el-option>
<!-- </el-select>--> </el-select>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('部门')"> <el-descriptions-item :label="$t('部门')">
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')"> <el-form-item :label="$t('创建时间')">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" label-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" /> type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
......
...@@ -200,9 +200,21 @@ ...@@ -200,9 +200,21 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" :label="$t('填单快递单号')"> <el-table-column prop="" :label="$t('储位')">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{ row.expressNo }} <!-- <warehouse-area-select
v-if="row.warehouseInInfoVO"
v-model="row.warehouseInInfoVO.orderLocationBackVOList"
readonly
:order-id="orderId"></warehouse-area-select> -->
<template v-if="row.warehouseInInfoVO">
{{getLocationName(row.warehouseInInfoVO.orderLocationMergeVOSet)}}
</template>
</template>
</el-table-column>
<el-table-column prop="" :label="$t('快递单号')">
<template slot-scope="{row}">
{{ row.warehouseInInfoVO.expressNo }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -270,6 +282,34 @@ ...@@ -270,6 +282,34 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<!-- 这个地方v-hasPermi不生效,所以换checkPermi函数检查 -->
<el-tab-pane :label="$t('操作日志')" name="five" v-if="checkPermi(['ecw:order:logs'])">
<el-table :data="logs">
<el-table-column :label="$t('时间')" width="150">
<template slot-scope="{row}">{{ parseTime(row.createTime) }}</template>
</el-table-column>
<el-table-column :label="$t('操作人')" prop="creatorName" width="150"> </el-table-column>
<el-table-column :label="$t('操作人类型')" width="100">
<template slot-scope="{row}">{{ row.userType == 1 ? $t('会员') : $t('管理员') }}</template>
</el-table-column>
<el-table-column :label="$t('操作类型')" prop="type" width="150"></el-table-column>
<el-table-column :label="$t('操作描述')" prop="msg" width="300"></el-table-column>
<el-table-column :label="$t('备注')" prop="note">
<template slot-scope="{row}">
<div v-if="row.note">
<div v-for="item in parseLogNote(row.note)">
<template v-if="item.orgValue">
{{$t('【{name}】从【{orgValue}】修改为【{newValue}', item)}}
</template>
<template v-else>
{{$t('【{name}】设置为【{newValue}', item)}}
</template>
</div>
</div>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
...@@ -312,7 +352,7 @@ ...@@ -312,7 +352,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<div v-if="feeDetail && feeDetail.coupons && feeDetail.coupons.length" class="page-title">优惠详情</div> <div v-if="feeDetail && feeDetail.coupons && feeDetail.coupons.length" class="page-title">优惠详情</div>
<el-table v-if="feeDetail && feeDetail.coupons && feeDetail.coupons.length" :data="feeDetail.coupons"> <el-table v-if="feeDetail && feeDetail.coupons && feeDetail.coupons.length" :data="feeDetail.coupons">
<el-table-column label="优惠ID" prop="couponId"></el-table-column> <el-table-column label="优惠ID" prop="couponId"></el-table-column>
...@@ -344,7 +384,7 @@ ...@@ -344,7 +384,7 @@
</template> </template>
<script> <script>
import { getOrder } from '@/api/ecw/order' import { getOrder, operateLogPage } from '@/api/ecw/order'
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import PrintWarehouseReceipt from './components/PrintWarehouseReceipt' import PrintWarehouseReceipt from './components/PrintWarehouseReceipt'
import PrintLadingBill from './components/PrintLadingBill' import PrintLadingBill from './components/PrintLadingBill'
...@@ -356,11 +396,12 @@ import {listByIds} from '@/api/ecw/region' ...@@ -356,11 +396,12 @@ import {listByIds} from '@/api/ecw/region'
import WarehouseDetail from './components/WarehouseDetail'; import WarehouseDetail from './components/WarehouseDetail';
import {getProductBrank} from '@/api/ecw/productBrank' import {getProductBrank} from '@/api/ecw/productBrank'
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect"
import {checkPermi} from '@/utils/permission'
export default { export default {
name: "detail", name: "detail",
components: { components: {
PrintWarehouseReceipt, PrintLadingBill, WarehouseDetail PrintWarehouseReceipt, PrintLadingBill, WarehouseDetail, WarehouseAreaSelect
}, },
filters: { filters: {
customsTypeFilter(e, customsTypeList) { customsTypeFilter(e, customsTypeList) {
...@@ -398,6 +439,8 @@ export default { ...@@ -398,6 +439,8 @@ export default {
showWarehouseInItemId: null, // 当前显示的入仓 showWarehouseInItemId: null, // 当前显示的入仓
showFeeDetailDialog: null, // 是否显示费用详情弹层 showFeeDetailDialog: null, // 是否显示费用详情弹层
feeDetail: null, // 费用详情 feeDetail: null, // 费用详情
logs: [], // 操作日志
} }
}, },
computed:{ computed:{
...@@ -433,6 +476,9 @@ export default { ...@@ -433,6 +476,9 @@ export default {
if(!this.feeList.length && val == 'four'){ if(!this.feeList.length && val == 'four'){
this.loadFeeList() this.loadFeeList()
} }
if(!this.logs.length && val == 'five'){
this.loadLogs()
}
}, },
'order.channelId'(){ 'order.channelId'(){
this.getChannel() this.getChannel()
...@@ -457,10 +503,18 @@ export default { ...@@ -457,10 +503,18 @@ export default {
getCurrencyList().then(res => this.currencyList = res.data) getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data) getUnitList().then(res => this.unitList = res.data)
console.log('2023-01-14 23:23 看到此消息则表示代码最新')
}, },
methods: { methods: {
checkPermi, // 检查权限
// 获取储位名称
getLocationName(locationArr){
if(!locationArr || !locationArr.length) return ''
let arr = []
locationArr.forEach(item => {
arr.push(`${item.areaName}${item.locationName || ''}`)
})
return Array.from(new Set(arr)).join(",")
},
// 显示费用详情 // 显示费用详情
showFeeDetail(row, type){ showFeeDetail(row, type){
this.showFeeDetailDialog = true this.showFeeDetailDialog = true
...@@ -582,6 +636,12 @@ export default { ...@@ -582,6 +636,12 @@ export default {
this.feeList = res.data this.feeList = res.data
}) })
}, },
// 加载操作日志
loadLogs(){
operateLogPage({orderId: this.orderId, page: 1, rows: 10000}).then(res => {
this.logs = res.data.list
})
},
downloadPackingList(){ downloadPackingList(){
window.open(this.order.packingListUrl) window.open(this.order.packingListUrl)
}, },
...@@ -593,6 +653,11 @@ export default { ...@@ -593,6 +653,11 @@ export default {
getOrderWarehouseIn(this.order.id).then(res => { getOrderWarehouseIn(this.order.id).then(res => {
this.orderWarehouseIn = res.data this.orderWarehouseIn = res.data
}) })
},
// 解析日志node字段
parseLogNote(note){
if(!note) return []
return JSON.parse(note)
} }
} }
}; };
......
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
<!-- 入仓修改 --> <!-- 入仓修改 -->
<template v-if=" <template v-if="
( (
include(scope.row.inWarehouseState, [202, 207, 202, 209, 210, 202, 211, 212, 202, 213, 214, 215, 216, 204, 205]) && include(scope.row.inWarehouseState, [201, 202, 207, 202, 209, 210, 202, 211, 212, 202, 213, 214, 215, 216, 204, 205]) &&
scope.row.status != 11 && exclude(scope.row.shipmentState, [314,315,317,318]) scope.row.status != 11 && exclude(scope.row.shipmentState, [314,315,317,318])
) )
"> ">
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
:disabled="type == 2" :disabled="type == 2"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
v-model="params.deliveryDate" v-model="params.deliveryDate"
type="date" type="datetime"
:placeholder="$t('选择日期')"> :placeholder="$t('选择日期')">
</el-date-picker> </el-date-picker>
</el-descriptions-item> </el-descriptions-item>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<el-date-picker <el-date-picker
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
v-model="params.arrivalDate" v-model="params.arrivalDate"
type="date" type="datetime"
:placeholder="$t('选择日期')"> :placeholder="$t('选择日期')">
</el-date-picker> </el-date-picker>
</el-descriptions-item> </el-descriptions-item>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<el-button v-if="type == 1" size="medium" @click="cancellationOfOrder">{{$t('取消调仓')}}</el-button> <el-button v-if="type == 1" size="medium" @click="cancellationOfOrder">{{$t('取消调仓')}}</el-button>
<el-button size="medium" @click="$tab.closeOpenPage({path:'/order/order'})">{{$t('返回')}}</el-button> <el-button size="medium" @click="$tab.closeOpenPage({path:'/order/order'})">{{$t('返回')}}</el-button>
</div> </div>
<warehouse-location ref="area" :visible.sync="areaVisible" v-model="params.orderLocationCreateReqVOList" :warehouse-id="warehouseDetails.warehouseInId" :order-id="Number(orderId)"></warehouse-location> <warehouse-location ref="area" :visible.sync="areaVisible" v-model="params.orderLocationCreateReqVOList" :warehouse-id="Number(this.type) === 1 ? warehouseDetails.warehouseOutId : warehouseDetails.warehouseInId" :order-id="Number(orderId)"></warehouse-location>
<el-dialog :title="$t('订单转异')" center :visible.sync="escapeBol"> <el-dialog :title="$t('订单转异')" center :visible.sync="escapeBol">
<el-form label-position="top" label-width="200"> <el-form label-position="top" label-width="200">
<el-form-item :label="$t('原因类型')"> <el-form-item :label="$t('原因类型')">
...@@ -259,6 +259,7 @@ export default { ...@@ -259,6 +259,7 @@ export default {
arrivalRemark: this.params.deliveryRemark, arrivalRemark: this.params.deliveryRemark,
id: this.params.id, id: this.params.id,
urls: this.params.urls, urls: this.params.urls,
orderLocationCreateReqVOList: this.params.orderLocationCreateReqVOList,
} }
}, },
...@@ -275,37 +276,42 @@ export default { ...@@ -275,37 +276,42 @@ export default {
} }
}, },
created() { created() {
//获得品牌
getProductBrankPage({pageNo:1,pageSize:10000,}).then(r => { getProductBrankPage({pageNo:1,pageSize:10000,}).then(r => {
this.brandList = r.data.list this.brandList = r.data.list
}) })
if(this.type == 1){ if(this.type == 1){
// 查参调仓记录
adjustLastWithStatus({orderId:this.orderId,lang:0}).then(r =>{ adjustLastWithStatus({orderId:this.orderId,lang:0}).then(r =>{
this.applyStatus = r.data}) this.applyStatus = r.data})
} }
// 获取供应商
getSupplierPage({ pageNo: 1, pageSize: 10000}).then(r => { getSupplierPage({ pageNo: 1, pageSize: 10000}).then(r => {
this.expressList = r.data.list; this.expressList = r.data.list;
}) })
// 获得订单
getOrder(this.orderId).then(r => { getOrder(this.orderId).then(r => {
if (r.code === 0) { if (r.code === 0) {
this.orderDetails = r.data; this.orderDetails = r.data;
} }
}) })
if(this.type == 2){ if(this.type == 2){
// 调仓-明细-后台使用
getAdjustInfo({orderId:this.orderId,lang:0}).then(r => { getAdjustInfo({orderId:this.orderId,lang:0}).then(r => {
this.warehouseList = r.data this.warehouseList = r.data
}) })
} }
// 获取调仓明细
orderWarehouseInGetAdjustInfo({orderId: this.orderId, lang: 0}).then(r => { orderWarehouseInGetAdjustInfo({orderId: this.orderId, lang: 0}).then(r => {
this.warehouseDetails = r.data[r.data.length - 1] this.warehouseDetails = r.data[r.data.length - 1]
listByOrderId({orderId:this.orderId}).then(res => { listByOrderId({orderId:this.orderId}).then(res => {
if(res.code === 0){ if(res.code === 0 && Number(this.type) === 1){
this.params.orderLocationCreateReqVOList = res.data this.params.orderLocationCreateReqVOList = res.data
// 等待仓库id和已选的储位后初始化储位信息
this.$nextTick(() => {
this.$refs.area.updateArea()
})
} }
// 等待仓库id和已选的储位后初始化储位信息
this.$nextTick(() => {
this.$refs.area.updateArea()
})
}) })
this.warehouseInShi = this.warehouseDetails.warehouseInShi || '' this.warehouseInShi = this.warehouseDetails.warehouseInShi || ''
this.params.phone = this.warehouseDetails.phone || ''; this.params.phone = this.warehouseDetails.phone || '';
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<h2>{{$t('货物信息')}}</h2> <h2>{{$t('货物信息')}}</h2>
<el-table <el-table
v-if="order.orderItemVOList && order.orderItemVOList.length > 0 && orderItemList && orderItemList.length > 0"
:data="order.orderItemVOList || []" :data="order.orderItemVOList || []"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
...@@ -81,16 +82,38 @@ ...@@ -81,16 +82,38 @@
prop="address" prop="address"
:label="$t('操作')"> :label="$t('操作')">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<warehouse v-if="isEdit" :warehousing="{...order.orderItemVOList[$index], ...orderItemList[$index]}" :title="$t('修改')" :order="order" @close="getList"></warehouse> <warehouse
v-if="isEdit"
:edit="true"
:order-item-a="order.orderItemVOList[$index]"
:order-item-b="orderItemList[$index]"
:title="$t('修改')"
:order="order"
@close="getList"></warehouse>
<!-- <el-button v-if="isEdit" size="mini" type="text" @click="handleWarehousing(row)">{{$t('修改')}}</el-button>--> <!-- <el-button v-if="isEdit" size="mini" type="text" @click="handleWarehousing(row)">{{$t('修改')}}</el-button>-->
<template v-else-if="wareItem(row.orderItemId) && wareItem(row.orderItemId).orderWarehouseInBackItemDoList && wareItem(row.orderItemId).orderWarehouseInBackItemDoList.length > 0"> <template v-else-if="
wareItem(row.orderItemId)
&& wareItem(row.orderItemId).orderWarehouseInBackItemDoList
&& wareItem(row.orderItemId).orderWarehouseInBackItemDoList.length > 0">
<!-- <template v-if="!order.parentOrderId">--> <!-- <template v-if="!order.parentOrderId">-->
<warehouse :warehousing="{...order.orderItemVOList[$index], ...orderItemList[$index]}" :title="$t('追加')" :order="order" @close="getList"></warehouse> <warehouse
v-if="!isEdit"
:order-item-a="order.orderItemVOList[$index]"
:order-item-b="orderItemList[$index]"
:title="$t('追加')"
:order="order"
@close="getList"></warehouse>
<!-- <el-button size="mini" type="text" @click="handleWarehousing(row)">{{$t('追加')}}</el-button>--> <!-- <el-button size="mini" type="text" @click="handleWarehousing(row)">{{$t('追加')}}</el-button>-->
<el-button size="mini" type="text" @click="handleWarehousingReturn(row)">{{$t('退仓')}}</el-button> <el-button size="mini" type="text" @click="handleWarehousingReturn(row)">{{$t('退仓')}}</el-button>
<!-- </template>--> <!-- </template>-->
</template> </template>
<warehouse v-else :warehousing="{...order.orderItemVOList[$index], ...orderItemList[$index]}" :title="$t('入仓')" :order="order" @close="getList"></warehouse> <warehouse
v-else
:order-item-a="order.orderItemVOList[$index]"
:order-item-b="orderItemList[$index]"
:title="$t('入仓')"
:order="order"
@close="getList"></warehouse>
<!-- <el-button v-else size="mini" type="text" @click="handleWarehousing(row)">{{$t('入仓')}}</el-button>--> <!-- <el-button v-else size="mini" type="text" @click="handleWarehousing(row)">{{$t('入仓')}}</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
...@@ -147,7 +170,7 @@ ...@@ -147,7 +170,7 @@
<image-and-video-upload :fileSize="50" :isShowTip="true" v-model="form.urls" ></image-and-video-upload> <image-and-video-upload :fileSize="50" :isShowTip="true" v-model="form.urls" ></image-and-video-upload>
</div> </div>
</el-card> </el-card>
<div style="text-align: center;margin-top: 15px" v-if="!isEdit"> <div style="text-align: center;margin-top: 15px" v-if="!(order.status !== 3 && isEdit)">
<el-button @click="escapeBol = true;" type="primary">{{$t('转异')}}</el-button> <el-button @click="escapeBol = true;" type="primary">{{$t('转异')}}</el-button>
<el-button type="primary" @click="finishVisible = true">{{$t('完成入仓')}}</el-button> <el-button type="primary" @click="finishVisible = true">{{$t('完成入仓')}}</el-button>
</div> </div>
...@@ -233,7 +256,7 @@ export default { ...@@ -233,7 +256,7 @@ export default {
mounted() { mounted() {
if(this.$route.query.id){ if(this.$route.query.id){
this.orderId = parseInt(this.$route.query.id || undefined) this.orderId = parseInt(this.$route.query.id || undefined)
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data) this.getOrderItemList()
getSpecialListByOrderId(this.orderId).then(r => this.specialList = r.data) getSpecialListByOrderId(this.orderId).then(r => this.specialList = r.data)
Promise.all([ Promise.all([
...@@ -291,9 +314,13 @@ export default { ...@@ -291,9 +314,13 @@ export default {
}, },
methods: { methods: {
getOrderItemList(){
this.orderItemList = []
return getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data)
},
getList(){ getList(){
this.getOrder() this.getOrder()
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data) this.getOrderItemList()
}, },
getWarehousePictureList(){ getWarehousePictureList(){
return warehousePictureList({ return warehousePictureList({
...@@ -448,7 +475,7 @@ export default { ...@@ -448,7 +475,7 @@ export default {
message: this.$t('货物退仓成功!') message: this.$t('货物退仓成功!')
}); });
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data) this.getOrderItemList()
this.getOrder() this.getOrder()
}) })
...@@ -461,7 +488,7 @@ export default { ...@@ -461,7 +488,7 @@ export default {
warehousingVisible(val) { warehousingVisible(val) {
if (!val){ if (!val){
this.getOrder() this.getOrder()
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data) this.getOrderItemList()
} }
}, },
orderSpecialNeeds(val){ orderSpecialNeeds(val){
......
...@@ -206,19 +206,6 @@ ...@@ -206,19 +206,6 @@
<el-radio v-model.number="form.needBook" :label="1">{{$t('是')}}</el-radio> <el-radio v-model.number="form.needBook" :label="1">{{$t('是')}}</el-radio>
<el-radio v-model.number="form.needBook" :label="0">{{$t('否')}}</el-radio> <el-radio v-model.number="form.needBook" :label="0">{{$t('否')}}</el-radio>
</el-form-item> </el-form-item>
<el-form-item v-if="this.form.id == null " :label="$t('可参与优惠')">
<!-- <el-select multiple v-model="form.couponlds" size="5" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px">-->
<!-- <el-option v-for="item in preferentialList" :value="item.couponId" :label="item.titleZh" :key="item.couponId" :disabled="item.mandatory">{{item.titleZh}}</el-option>-->
<!-- </el-select>-->
<div style="width: 300px;height: 400px;border: 1px solid;overflow-y: auto">
<div @click="selectMoveAbout(item)" style="display: flex;justify-content: space-between; align-items: center;" :style="{'cursor':item.mandatory ? 'no-drop' : 'pointer' }" v-for="item in preferentialList">
<div>
{{$l(item, 'title')}}
</div>
<i v-if="form.couponIds.includes(item.couponId)" style="margin-right: 20px;" class="el-icon-check"></i>
</div>
</div>
</el-form-item>
<!-- <el-form-item :label="$t('可参与优惠活动')" prop="you"> <!-- <el-form-item :label="$t('可参与优惠活动')" prop="you">
<el-select v-model="form.you" :placeholder="$t('可参与优惠活动')" clearable> <el-select v-model="form.you" :placeholder="$t('可参与优惠活动')" clearable>
<el-option v-for="packageItem in packagingList" :key="packageItem.value" :label="packageItem.label" :value="packageItem.value" /> <el-option v-for="packageItem in packagingList" :key="packageItem.value" :label="packageItem.label" :value="packageItem.value" />
...@@ -229,7 +216,19 @@ ...@@ -229,7 +216,19 @@
<template slot="append">{{$t('立方米')}}</template> <template slot="append">{{$t('立方米')}}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('可参与优惠')">
<!-- <el-select multiple v-model="form.couponlds" size="5" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px">-->
<!-- <el-option v-for="item in preferentialList" :value="item.couponId" :label="item.titleZh" :key="item.couponId" :disabled="item.mandatory">{{item.titleZh}}</el-option>-->
<!-- </el-select>-->
<div style="width: 300px;height: 400px;border: 1px solid;overflow-y: auto">
<div @click="selectMoveAbout(item)" style="display: flex;justify-content: space-between; align-items: center;" :style="{'cursor':item.mandatory ? 'no-drop' : 'pointer' }" v-for="item in preferentialList" :key="item.couponId" >
<div>
{{$l(item, 'title')}}
</div>
<i v-if="form.couponIds.includes(item.couponId)" style="margin-right: 20px;" class="el-icon-check"></i>
</div>
</div>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{$t('确定')}}</el-button> <el-button type="primary" @click="submitForm">{{$t('确定')}}</el-button>
...@@ -242,19 +241,20 @@ ...@@ -242,19 +241,20 @@
<script> <script>
import { import {
createProduct, createProduct,
updateProduct,
deleteProduct, deleteProduct,
exportProductExcel,
getProduct, getProduct,
getProductPage, getProductPage,
exportProductExcel, product_coupon_newProd,
product_coupon_newProd updateProduct
} from "@/api/ecw/product"; } from "@/api/ecw/product";
import { getProductAttrList } from "@/api/ecw/productAttr"; import {getProductAttrList} from "@/api/ecw/productAttr";
import { getProductTypeList } from "@/api/ecw/productType"; import {getProductTypeList} from "@/api/ecw/productType";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import {DICT_TYPE, getDictDatas} from '@/utils/dict';
import { CommonStatusEnum, AuditStatusEnum } from '@/utils/constants'; import {AuditStatusEnum, CommonStatusEnum} from '@/utils/constants';
import { uploadFile } from "@/api/infra/file"; import {uploadFile} from "@/api/infra/file";
import ImageUpload from '@/components/ImageUpload' import ImageUpload from '@/components/ImageUpload'
export default { export default {
name: "EcwProductIndex", name: "EcwProductIndex",
components: { components: {
...@@ -382,10 +382,6 @@ export default { ...@@ -382,10 +382,6 @@ export default {
this.getAttrList(); this.getAttrList();
this.getTypeList(); this.getTypeList();
this.getList(); this.getList();
product_coupon_newProd().then(r => {
this.preferentialList = r.data
this.reset()
})
}, },
methods: { methods: {
/** 获取产品属性列表 */ /** 获取产品属性列表 */
...@@ -462,8 +458,6 @@ export default { ...@@ -462,8 +458,6 @@ export default {
needBook: 0, needBook: 0,
couponIds:[], couponIds:[],
}; };
let c = this.preferentialList.filter(i => i.isDefault).map(i => i.couponId)
this.form.couponIds = c
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -482,6 +476,10 @@ export default { ...@@ -482,6 +476,10 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = this.$t("添加商品"); this.title = this.$t("添加商品");
product_coupon_newProd().then(r => {
this.preferentialList = r.data
this.form.couponIds = this.preferentialList.filter(i => i.isDefault).map(i => i.couponId)
})
if (this.queryParams.typeId) { if (this.queryParams.typeId) {
this.form.typeId = this.queryParams.typeId; this.form.typeId = this.queryParams.typeId;
} }
...@@ -491,7 +489,7 @@ export default { ...@@ -491,7 +489,7 @@ export default {
// this.reset(); // this.reset();
const id = row.id; const id = row.id;
getProduct(id).then(response => { getProduct(id).then(response => {
this.form = {...response.data}; this.form = {...response.data,couponIds:[]};
let attrArray = this.form.attrId.split(','); let attrArray = this.form.attrId.split(',');
for (let index in attrArray) { for (let index in attrArray) {
let value = attrArray[index]; let value = attrArray[index];
...@@ -502,6 +500,11 @@ export default { ...@@ -502,6 +500,11 @@ export default {
}) })
this.open = true; this.open = true;
this.title = this.$t("修改商品"); this.title = this.$t("修改商品");
product_coupon_newProd().then(r => {
this.preferentialList = r.data
this.form.couponIds = this.preferentialList.filter(i => i.isDefault).map(i => i.couponId)
// this.reset()
})
}); });
}, },
...@@ -607,15 +610,33 @@ export default { ...@@ -607,15 +610,33 @@ export default {
}, },
selectMoveAbout(val){ selectMoveAbout(val){
if(!val.mandatory){ if(!val.mandatory){
let index = this.form.couponIds.findIndex(i => val.couponId == i) let index = this.form.couponIds.findIndex(i => val.couponId == i)
if(index >= 0){ if(index >= 0){
this.form.couponIds.splice(index,1) this.$confirm(this.$t(`您确定要将商品从优惠活动${this.$l(val,'title')}中移出吗?`), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText:this.$t('取消') ,
type: 'warning'
}).then(() => {
this.form.couponIds.splice(index,1)
this.$forceUpdate()
}).catch(() => {
});
}else { }else {
this.form.couponIds.push(val.couponId) this.$confirm(this.$t(`您确定要将商品加入到优惠活动${this.$l(val,'title')}中吗?`), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText:this.$t('取消') ,
type: 'warning'
}).then(() => {
this.form.couponIds.push(val.couponId)
this.$forceUpdate()
}).catch(() => {
});
} }
} }
} }
} },
}; };
</script> </script>
......
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