Commit c65f8fe6 authored by 我在何方's avatar 我在何方
parents 4fa9d11f 206319da
......@@ -166,7 +166,7 @@ export function orderWarehouseIn(data){
// 入仓修改
export function orderWarehouseInUpdateApply(data){
return request({
url: '/order/order-warehouse-in/update-apply',
url: '/order/order-warehouse-in/update-or-updateApply',
method: 'put',
data
})
......@@ -337,6 +337,7 @@ export function feeApplicationGet(params){
params
})
}
// 调仓-明细-后台使用
export function getAdjustInfo(params){
return request({
url:'/order/order-warehouse-in/get-adjust-info',
......
......@@ -10,7 +10,7 @@
{{orderData.marks?orderData.marks:$t('')}}
</el-descriptions-item>
<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 :label="$t('订单状态')">
{{orderData.status==99? $t('异常'):$t('正常')}}
......@@ -183,14 +183,14 @@
<el-row>
<el-form-item :label="$t('中文品名')+':'" prop="zhId">
<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-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('英文品名')+':'" prop="enId">
<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-form-item>
<el-row>
......@@ -339,6 +339,14 @@ export default {
});
return _total;
},
totalSplitQty() {
let _total = 0;
const { orderSplitItemBackVOList = [] } = this.splitData;
orderSplitItemBackVOList.forEach((v) => {
_total = Decimal.add(_total, Number(v.quantity)).toNumber();
});
return _total;
},
/* 打开拆单 */
getSplit() {
this.orderItems = this.currRow.goodsList ?? [];
......@@ -352,6 +360,13 @@ export default {
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() {
getSplitList({
......@@ -448,32 +463,63 @@ export default {
this.isQuantity = false;
},
async changeProdTitleZh() {
const data = await this.getSelectData("zhId");
this.shopForm.enId = data.id;
const item = this.setShopForm("zhId");
this.shopForm.enId = item.id;
this.shopForm = { ...this.shopForm };
await this.getSelectData(item);
},
async changeProdTitleEn() {
const data = await this.getSelectData("enId");
this.shopForm.zhId = data.id;
const item = this.setShopForm("enId");
this.shopForm.zhId = item.id;
this.shopForm = { ...this.shopForm };
await this.getSelectData(item);
},
async getSelectData(key) {
setShopForm(key) {
let list = [];
list = this.orderItems.filter((item) => item.id == this.shopForm[key]);
this.shopForm.num = this.currRow.num - this.currRow.installNum;
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.putNum = data.num ?? 0;
this.shopForm.quantity = data.quantity ?? 0;
this.shopForm.putQuantity = Decimal.div(
data.quantity ?? 0,
this.shopForm.quantity,
this.shopForm.num
).toFixed(0);
return data;
},
async getSelectData(item) {
await quantitycheck({
seaFreightVolume: data.seaFreightVolume,
clearanceFreightVolume: data.clearanceFreightVolume,
seaFreightVolume: item.seaFreightVolume,
clearanceFreightVolume: item.clearanceFreightVolume,
}).then((res) => {
if (res.data) {
this.isQuantity = true;
......@@ -489,7 +535,6 @@ export default {
delete this.shopRules.putQuantity;
}
});
return data;
},
shopAdd() {
this.$refs["shopForm"].validate((valid) => {
......
......@@ -56,8 +56,8 @@
</el-descriptions>
</el-card>
<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="orderNo"></el-table-column>
<el-table-column label="客户名称" prop="name"></el-table-column>
<el-table-column label="新客户经理" prop="newCustomerService">
<template v-slot="{row}">
......
......@@ -19,21 +19,21 @@
:rules="{ required: true, trigger: ['blur', 'change'],message:$t('客户不能为空')}"
:error="$t('客户不能为空')"
>
<customer-selector v-model="form.customerId" @change="consignor = $event" />
<!-- <el-select-->
<!-- v-model="form.customerId"-->
<!-- :placeholder="$t('请选择客户')"-->
<!-- filterable-->
<!-- @change="selectChange(form.customerId)"-->
<!-- :filter-method="getUserList"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="supplier in allSupplier"-->
<!-- :key="supplier.id"-->
<!-- :label="supplier.name"-->
<!-- :value="supplier.id"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- <customer-selector v-model="form.customerId" @change="consignor = $event" />-->
<el-select
v-model="form.customerId"
:placeholder="$t('请选择客户')"
filterable
@change="selectChange(form.customerId)"
:filter-method="getUserList"
>
<el-option
v-for="supplier in allSupplier"
:key="supplier.id"
:label="supplier.name"
:value="supplier.id"
></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('部门')">
......
......@@ -20,7 +20,7 @@
</el-form-item>
<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('结束日期')" />
</el-form-item>
<el-form-item>
......
......@@ -200,9 +200,21 @@
</template>
</template>
</el-table-column>
<el-table-column prop="" :label="$t('填单快递单号')">
<el-table-column prop="" :label="$t('储位')">
<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>
</el-table-column>
</el-table>
......@@ -270,6 +282,34 @@
</el-table-column>
</el-table>
</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-card>
......@@ -312,7 +352,7 @@
</div>
</el-col>
</el-row>
<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-column label="优惠ID" prop="couponId"></el-table-column>
......@@ -344,7 +384,7 @@
</template>
<script>
import { getOrder } from '@/api/ecw/order'
import { getOrder, operateLogPage } from '@/api/ecw/order'
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import PrintWarehouseReceipt from './components/PrintWarehouseReceipt'
import PrintLadingBill from './components/PrintLadingBill'
......@@ -356,11 +396,12 @@ import {listByIds} from '@/api/ecw/region'
import WarehouseDetail from './components/WarehouseDetail';
import {getProductBrank} from '@/api/ecw/productBrank'
import { parseTime } from '@/utils/ruoyi';
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect"
import {checkPermi} from '@/utils/permission'
export default {
name: "detail",
components: {
PrintWarehouseReceipt, PrintLadingBill, WarehouseDetail
PrintWarehouseReceipt, PrintLadingBill, WarehouseDetail, WarehouseAreaSelect
},
filters: {
customsTypeFilter(e, customsTypeList) {
......@@ -398,6 +439,8 @@ export default {
showWarehouseInItemId: null, // 当前显示的入仓
showFeeDetailDialog: null, // 是否显示费用详情弹层
feeDetail: null, // 费用详情
logs: [], // 操作日志
}
},
computed:{
......@@ -433,6 +476,9 @@ export default {
if(!this.feeList.length && val == 'four'){
this.loadFeeList()
}
if(!this.logs.length && val == 'five'){
this.loadLogs()
}
},
'order.channelId'(){
this.getChannel()
......@@ -457,10 +503,18 @@ export default {
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
console.log('2023-01-14 23:23 看到此消息则表示代码最新')
},
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){
this.showFeeDetailDialog = true
......@@ -582,6 +636,12 @@ export default {
this.feeList = res.data
})
},
// 加载操作日志
loadLogs(){
operateLogPage({orderId: this.orderId, page: 1, rows: 10000}).then(res => {
this.logs = res.data.list
})
},
downloadPackingList(){
window.open(this.order.packingListUrl)
},
......@@ -593,6 +653,11 @@ export default {
getOrderWarehouseIn(this.order.id).then(res => {
this.orderWarehouseIn = res.data
})
},
// 解析日志node字段
parseLogNote(note){
if(!note) return []
return JSON.parse(note)
}
}
};
......
......@@ -356,7 +356,7 @@
<!-- 入仓修改 -->
<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])
)
">
......
......@@ -107,7 +107,7 @@
:disabled="type == 2"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="params.deliveryDate"
type="date"
type="datetime"
:placeholder="$t('选择日期')">
</el-date-picker>
</el-descriptions-item>
......@@ -118,7 +118,7 @@
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="params.arrivalDate"
type="date"
type="datetime"
:placeholder="$t('选择日期')">
</el-date-picker>
</el-descriptions-item>
......@@ -139,7 +139,7 @@
<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>
</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-form label-position="top" label-width="200">
<el-form-item :label="$t('原因类型')">
......@@ -259,6 +259,7 @@ export default {
arrivalRemark: this.params.deliveryRemark,
id: this.params.id,
urls: this.params.urls,
orderLocationCreateReqVOList: this.params.orderLocationCreateReqVOList,
}
},
......@@ -275,37 +276,42 @@ export default {
}
},
created() {
//获得品牌
getProductBrankPage({pageNo:1,pageSize:10000,}).then(r => {
this.brandList = r.data.list
})
if(this.type == 1){
// 查参调仓记录
adjustLastWithStatus({orderId:this.orderId,lang:0}).then(r =>{
this.applyStatus = r.data})
}
// 获取供应商
getSupplierPage({ pageNo: 1, pageSize: 10000}).then(r => {
this.expressList = r.data.list;
})
// 获得订单
getOrder(this.orderId).then(r => {
if (r.code === 0) {
this.orderDetails = r.data;
}
})
if(this.type == 2){
// 调仓-明细-后台使用
getAdjustInfo({orderId:this.orderId,lang:0}).then(r => {
this.warehouseList = r.data
})
}
// 获取调仓明细
orderWarehouseInGetAdjustInfo({orderId: this.orderId, lang: 0}).then(r => {
this.warehouseDetails = r.data[r.data.length - 1]
listByOrderId({orderId:this.orderId}).then(res => {
if(res.code === 0){
if(res.code === 0 && Number(this.type) === 1){
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.params.phone = this.warehouseDetails.phone || '';
......
......@@ -12,12 +12,12 @@
<el-descriptions border :column="2">
<el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template>
<product-selector v-if="!order.parentOrderId" v-model="form.prodId" @change="onProductChange"/>
<product-selector v-if="!order.parentOrderId && !isAdd" v-model="form.prodId" @change="onProductChange"/>
<span v-else>{{ warehousing.prodTitleZh }}</span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('英文品名') }}</template>
<product-selector v-if="!order.parentOrderId" lang="En" v-model="form.prodId" @change="onProductChange"/>
<product-selector v-if="!order.parentOrderId && !isAdd" lang="En" v-model="form.prodId" @change="onProductChange"/>
<span v-else>{{ warehousing.prodTitleEn }}</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('品牌')">
......@@ -65,7 +65,7 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{ $t('入仓记录') }}</span>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete"></el-button>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete" :disabled="form.table.length <= protectRowCount"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd()"></el-button>
</div>
<el-form ref="tableForm" :rules="tableFormRules" :model="form" size="mini">
......@@ -77,10 +77,10 @@
<span style="color: red">*</span>{{ $t('箱数') }}</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.cartonsNum">
<el-input v-model="form.table[$index].cartonsNum" placeholder="" @blur="handleVolume($index)">
<el-input v-model="form.table[$index].cartonsNum" placeholder="" @blur="handleVolume($index)" :disabled="$index <= protectRowCount">
<span slot="append">{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, form.table[$index].specificationType) }}</span>
</el-input>
<dict-selector :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="form.table[$index].specificationType" @change="handleVolume($index)"></dict-selector>
<dict-selector :disabled="$index <= protectRowCount" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="form.table[$index].specificationType" @change="handleVolume($index)"></dict-selector>
</el-form-item>
</template>
</el-table-column>
......@@ -89,7 +89,7 @@
<span style="color: red">*</span>{{ $t('包装类型') }}</template>
<template v-slot="{r,c,$index}">
<el-form-item>
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="form.table[$index].unit"></dict-selector>
<dict-selector :disabled="$index <= protectRowCount" :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="form.table[$index].unit"></dict-selector>
</el-form-item>
</template>
</el-table-column>
......@@ -99,7 +99,7 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge1">
<el-input type="number" v-model="form.table[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
<el-input :disabled="$index <= protectRowCount" type="number" v-model="form.table[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template>
</el-table-column>
......@@ -109,7 +109,7 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge2">
<el-input type="number" v-model="form.table[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
<el-input :disabled="$index <= protectRowCount" type="number" v-model="form.table[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template>
</el-table-column>
......@@ -119,7 +119,7 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge3">
<el-input type="number" v-model="form.table[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
<el-input :disabled="$index <= protectRowCount" type="number" v-model="form.table[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item>
</template>
</el-table-column>
......@@ -129,7 +129,7 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.volume">
<el-input v-model="form.table[$index].volume" placeholder="" type="number"></el-input>
<el-input :disabled="$index <= protectRowCount" v-model="form.table[$index].volume" placeholder="" type="number"></el-input>
</el-form-item>
</template>
</el-table-column>
......@@ -139,14 +139,14 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.weight">
<el-input v-model="form.table[$index].weight" placeholder="" type="number"></el-input>
<el-input :disabled="$index <= protectRowCount" v-model="form.table[$index].weight" placeholder="" type="number"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('数量')" width="130px">
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.quantityAll">
<el-input v-model.number="form.table[$index].quantityAll" placeholder="">
<el-input :disabled="$index <= protectRowCount" v-model.number="form.table[$index].quantityAll" placeholder="">
<template slot="append">{{ $t('') }}</template>
</el-input>
</el-form-item>
......@@ -155,7 +155,7 @@
<el-table-column :label="$t('快递单号')">
<template v-slot="{r,c,$index}">
<el-form-item>
<el-input v-model="form.table[$index].expressNo" placeholder=""></el-input>
<el-input :disabled="$index <= protectRowCount" v-model="form.table[$index].expressNo" placeholder=""></el-input>
</el-form-item>
</template>
</el-table-column>
......@@ -359,8 +359,7 @@
</el-tab-pane>
</el-tabs>
<div v-if="edit">
<div v-if="edit && order.status !== 3">
<h2>{{ $t('审批流程') }}</h2>
<work-flow xmlkey="free_apply" v-model="selectedUsers" />
<!-- <div>选择的用户:{{selectedUsers}}</div>-->
......@@ -420,7 +419,17 @@ export default {
type: Boolean,
default: false
},
warehousing: {
orderItemA: {
type: Object,
default: () => {
return {
material: undefined,
inTime: undefined,
orderWarehouseInBackItemDoList: []
}
}
},
orderItemB: {
type: Object,
default: () => {
return {
......@@ -433,6 +442,12 @@ export default {
},
computed: {
isAdd() {
return this.$route.path === "/order/warehousing-add"
},
warehousing(){
return {...this.orderItemA, ...this.orderItemB}
},
orderId(){
return this.order.orderId
},
......@@ -490,6 +505,9 @@ export default {
if (val) {
this.getProductBrandPage(this.warehousing.brandName)
this.handleBrandChange(parseInt(this.form.brand))
this.init()
} else {
this.$emit('close')
}
}
},
......@@ -516,7 +534,8 @@ export default {
prodTitleZh: undefined,
prodType: undefined,
type: undefined,
feeType: undefined
feeType: undefined,
recordMode: undefined
},
form1: {
table: [],
......@@ -533,7 +552,8 @@ export default {
prodTitleZh: undefined,
prodType: undefined,
type: 1,
feeType: undefined
feeType: undefined,
recordMode: undefined
},
brandList: [],
formRules: {
......@@ -556,12 +576,11 @@ export default {
// 入仓修改正在审核中
isEditing: false,
// 审批业务id
formId: ''
}
},
formId: '',
mounted() {
this.init()
// 追加时被保护的行数
protectRowCount: -1
}
},
methods: {
......@@ -595,13 +614,22 @@ export default {
}
})
if (this.isAdd) {
let protectRowCount = -1
this.protectRowCount = this.form.table.map(e => {
if (e.id){
protectRowCount++
}
})
this.protectRowCount = protectRowCount
}
if (!this.edit){
this.handleAdd()
this.handleAdd(1)
}
},
handleClose() {
this.$emit('close')
this.visible = false
},
handleVolume(index, val){
......@@ -676,10 +704,10 @@ export default {
copyUserId: this.selectedUsers
}).then(r => {
if (r.data) {
this.$message.success('入仓修改发起成功')
this.$message.success(r.msg || '入仓修改发起成功')
this.handleClose()
} else {
this.$message.success('入仓修改发起失败')
this.$message.success(r.msg || '入仓修改发起失败')
}
})
} else {
......@@ -757,7 +785,11 @@ export default {
})
},
handleDelete(val) {
(val === 1 ? this.form1 : this.form).table.pop()
if (val === 1) {
this.form1.table.pop()
} else if (this.form.table.length > this.protectRowCount) {
this.form.table.pop()
}
},
handleAdd(val = 0) {
let cartonsNum = ''
......@@ -767,7 +799,6 @@ export default {
hasCartonsNum += e.cartonsNum
})
cartonsNum = this.warehousing.num - hasCartonsNum
}
const form = val === 1 ? this.form1 : this.form
......
......@@ -11,6 +11,7 @@
<h2>{{$t('货物信息')}}</h2>
<el-table
v-if="order.orderItemVOList && order.orderItemVOList.length > 0 && orderItemList && orderItemList.length > 0"
:data="order.orderItemVOList || []"
style="width: 100%">
<el-table-column
......@@ -81,16 +82,38 @@
prop="address"
:label="$t('操作')">
<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>-->
<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">-->
<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="handleWarehousingReturn(row)">{{$t('退仓')}}</el-button>
<!-- </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>-->
</template>
</el-table-column>
......@@ -147,7 +170,7 @@
<image-and-video-upload :fileSize="50" :isShowTip="true" v-model="form.urls" ></image-and-video-upload>
</div>
</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 type="primary" @click="finishVisible = true">{{$t('完成入仓')}}</el-button>
</div>
......@@ -233,7 +256,7 @@ export default {
mounted() {
if(this.$route.query.id){
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)
Promise.all([
......@@ -291,9 +314,13 @@ export default {
},
methods: {
getOrderItemList(){
this.orderItemList = []
return getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data)
},
getList(){
this.getOrder()
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data)
this.getOrderItemList()
},
getWarehousePictureList(){
return warehousePictureList({
......@@ -448,7 +475,7 @@ export default {
message: this.$t('货物退仓成功!')
});
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data)
this.getOrderItemList()
this.getOrder()
})
......@@ -461,7 +488,7 @@ export default {
warehousingVisible(val) {
if (!val){
this.getOrder()
getOrderWarehouseIn(this.orderId).then(r => this.orderItemList = r.data)
this.getOrderItemList()
}
},
orderSpecialNeeds(val){
......
......@@ -206,19 +206,6 @@
<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-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-select v-model="form.you" :placeholder="$t('可参与优惠活动')" clearable>
<el-option v-for="packageItem in packagingList" :key="packageItem.value" :label="packageItem.label" :value="packageItem.value" />
......@@ -229,7 +216,19 @@
<template slot="append">{{$t('立方米')}}</template>
</el-input>
</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>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{$t('确定')}}</el-button>
......@@ -242,19 +241,20 @@
<script>
import {
createProduct,
updateProduct,
deleteProduct,
exportProductExcel,
getProduct,
getProductPage,
exportProductExcel,
product_coupon_newProd
product_coupon_newProd,
updateProduct
} from "@/api/ecw/product";
import { getProductAttrList } from "@/api/ecw/productAttr";
import { getProductTypeList } from "@/api/ecw/productType";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import { CommonStatusEnum, AuditStatusEnum } from '@/utils/constants';
import { uploadFile } from "@/api/infra/file";
import {getProductAttrList} from "@/api/ecw/productAttr";
import {getProductTypeList} from "@/api/ecw/productType";
import {DICT_TYPE, getDictDatas} from '@/utils/dict';
import {AuditStatusEnum, CommonStatusEnum} from '@/utils/constants';
import {uploadFile} from "@/api/infra/file";
import ImageUpload from '@/components/ImageUpload'
export default {
name: "EcwProductIndex",
components: {
......@@ -382,10 +382,6 @@ export default {
this.getAttrList();
this.getTypeList();
this.getList();
product_coupon_newProd().then(r => {
this.preferentialList = r.data
this.reset()
})
},
methods: {
/** 获取产品属性列表 */
......@@ -462,8 +458,6 @@ export default {
needBook: 0,
couponIds:[],
};
let c = this.preferentialList.filter(i => i.isDefault).map(i => i.couponId)
this.form.couponIds = c
this.resetForm("form");
},
/** 搜索按钮操作 */
......@@ -482,6 +476,10 @@ export default {
this.reset();
this.open = true;
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) {
this.form.typeId = this.queryParams.typeId;
}
......@@ -491,7 +489,7 @@ export default {
// this.reset();
const id = row.id;
getProduct(id).then(response => {
this.form = {...response.data};
this.form = {...response.data,couponIds:[]};
let attrArray = this.form.attrId.split(',');
for (let index in attrArray) {
let value = attrArray[index];
......@@ -502,6 +500,11 @@ export default {
})
this.open = true;
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 {
},
selectMoveAbout(val){
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){
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 {
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>
......
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