Commit cc3130cc authored by 我在何方's avatar 我在何方
parents fe3238dc bd296531
...@@ -684,3 +684,38 @@ export function splitCancelApply(data){ ...@@ -684,3 +684,38 @@ export function splitCancelApply(data){
data data
}) })
} }
// 撤销拆单
export function orderSplitRevoke(data){
return request({
url: '/order/split/revoke',
method: 'put',
data
})
}
/*根据订单ID获取撤销拆单详情*/
export function splitRevoke(orderId){
return request({
url: '/order/split/revoke/' + orderId,
method: 'get'
})
}
/*根据审批ID获取撤销拆单详情*/
export function splitRevokeApply(approvalId){
return request({
url: '/order/split/revoke/apply/' + approvalId,
method: 'get'
})
}
/*取消撤销拆单*/
export function cancelSplitRevoke(data){
return request({
url: '/order/split/cancel/revoke',
method: 'put',
data
})
}
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<el-option <el-option
v-for="(item, index) in list" v-for="(item, index) in list"
:key="item.id" :key="item.id"
:label="item['title' + lang]" :label="item['title' + lang] + (item.auditStatus === 2 ? '' : `(${$t('审核中')})`)"
:value="index"> :value="index">
</el-option> </el-option>
</el-select> </el-select>
......
...@@ -386,6 +386,11 @@ export default { ...@@ -386,6 +386,11 @@ export default {
component: ()=>import('@/views/ecw/financial/components/commissionPaymentDetails.vue'), component: ()=>import('@/views/ecw/financial/components/commissionPaymentDetails.vue'),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath
},
/*撤销拆单*/
split_revoke:{
component: () => import("@/views/ecw/order/components/SplitRevokeDetail"),
id: this.processInstance.businessKey
} }
} }
console.log('formCustomViewPath', this.processInstance.processDefinition.formCustomViewPath.trim()) console.log('formCustomViewPath', this.processInstance.processDefinition.formCustomViewPath.trim())
......
<template>
<el-dialog :visible="true" title="撤销拆单" :before-close="close">
<el-form :model="form" label-width="100px">
<!--<el-form-item label="申请理由">
<el-input v-model="form.reason"></el-input>
</el-form-item>-->
<el-form-item label="抄送">
<work-flow v-model="form.ccIds" xmlkey="revoke_split_order"></work-flow>
</el-form-item>
</el-form>
<div slot="footer">
<template v-if="formId" >
<el-button type="primary" @click="toBpmDetail">审核中</el-button>
<el-button type="default" @click="cancelApproval">取消审核</el-button>
</template>
<el-button v-else type="primary" @click="submit" :loading="submitting" :disabled="submitting">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import WorkFlow from "@/components/WorkFlow";
import {cancelSplitRevoke, orderSplitRevoke, splitRevoke} from '@/api/ecw/order'
export default {
name: "SplitRevoke",
components: { WorkFlow},
props:{
orderId: Number
},
data(){
return {
formId: null, // 审批ID
submitting: false,
form: {
ccIds: []
}
}
},
created() {
splitRevoke(this.orderId).then(res =>{
console.log(res)
if(res.data.formId){
this.formId = res.data.formId
}
})
},
methods:{
submit(){
console.log('提交')
if(this.submitting) return
this.submitting = true
orderSplitRevoke({
orderId: this.orderId,
copyUserId: this.form.ccIds
}).then(res => {
this.$message.success(res.msg || '操作成功')
this.close()
}).finally(() =>{
this.submitting = false
})
},
close(){
this.$emit('close')
},
toBpmDetail(){
this.$router.push(`/bpm/process-instance/detail?id=${this.formId}`)
this.close()
},
// 取消审核
cancelApproval(){
this.$prompt(this.$t("请输入取消原因")).then(res => {
return cancelSplitRevoke({orderId: this.orderId, reason: res.value})
}).then(res => {
this.$message.success(res.msg || this.$t('操作成功'))
this.close()
})
}
}
}
</script>
<style scoped>
</style>
<!--拆单审核中的申请信息部分-->
<template>
<div v-if="orders">
<el-table :data="orders">
<el-table-column :label="$t('订单编号')">
<template slot-scope="scope">{{scope.row.orderNo}}</template>
</el-table-column>
<el-table-column :label="$t('唛头')">
<template slot-scope="{row}">{{row.marks}}</template>
</el-table-column>
<el-table-column label="订单状态">
<template slot-scope="{row}">{{row.statusMsg}}</template>
</el-table-column>
<el-table-column :label="$t('填单统计')">
<template slot-scope="{row}">
{{row.costVO.totalNum}}{{$t('')}}<br/>{{row.costVO.totalVolume}}<br/>{{row.costVO.totalWeight}}kg
</template>
</el-table-column>
<el-table-column :label="$t('入仓统计')">
<template slot-scope="{row}">
{{row.sumNum}}{{$t('')}}<br/>{{row.sumVolume}}<br/>{{row.sumWeight}}kg
</template>
</el-table-column>
<el-table-column :label="$t('入仓时间')">
<template slot-scope="{row}">
{{row.rucangTime|parseTime}}
</template>
</el-table-column>
<el-table-column :label="$t('运输方式')">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId" />
</template>
</el-table-column>
<el-table-column :label="$t('出货渠道')">
<template slot-scope="{row}">
{{getChannelName(row.channelId)}}
</template>
</el-table-column>
<el-table-column :label="$t('始发仓')">
<template slot-scope="{row}">{{jsonParse(row.departureVO.departure).titleZh}}</template>
</el-table-column>
<el-table-column :label="$t('目的仓')">
<template slot-scope="{row}">
{{jsonParse(row.objectiveVO.objective).titleZh}}
</template>
</el-table-column>
<el-table-column :label="$t('发货人')">
<template slot-scope="{row}">
{{row.consignorVO.name}}
</template>
</el-table-column>
<el-table-column :label="$t('收货人')">
<template slot-scope="{row}">
{{row.consigneeVO.name}}
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {getApproval, getOrder, splitRevokeApply} from '@/api/ecw/order'
import {getMergeListByMergeId} from '@/api/ecw/orderHandle'
import {getChannelListByIds} from '@/api/ecw/channel'
import {parseTime} from '@/utils/ruoyi'
export default {
name: 'SplitRevokeDetail',
filters: {parseTime},
props:{
id: [String, Number]
},
data(){
return {
orders: null,
channels: []
}
},
watch:{
id(){
this.getData()
}
},
computed:{
jsonParse(){
return d => {
return JSON.parse(d)
}
},
getChannelName(){
return id => {
let channel = this.channels.find(item => item.channelId == id)
return channel ? channel.nameZh : '/'
}
}
},
created(){
if(this.id){
this.getData()
}
},
methods:{
getData(){
splitRevokeApply(this.id).then(res => {
this.orders = res.data.childrenOrderList
this.getChannels()
})
},
getChannels(){
let ids = []
this.orders.forEach(order => {
if(order.channelId){
ids.push(order.channelId)
}
})
if(!ids.length) return false
getChannelListByIds({ids: ids.join(',')}).then(res => {
this.channels = res.data
})
}
}
}
</script>
<style scoped lang="scss">
.title{
padding: 10px 0;
span{
font-size: 14px;
font-weight: bold;
}
}
</style>
...@@ -317,8 +317,8 @@ ...@@ -317,8 +317,8 @@
</template> </template>
<!--撤销拆单,拆单的子订单,预装前显示,预装后变灰不可点击--> <!--撤销拆单,拆单的子订单,预装前显示,预装后变灰不可点击-->
<template v-if="scope.row.parentOrderId"> <template v-if="scope.row.parentOrderId && scope.row.status < 11">
<el-dropdown-item @click.native="cancelSplit(scope.row)" v-hasPermi="['ecw:order:cancel_split']">{{$t('撤销拆单')}}</el-dropdown-item> <el-dropdown-item @click.native="splitRevoke(scope.row)" v-hasPermi="['ecw:order:split_revoke']">{{$t('撤销拆单')}}</el-dropdown-item>
</template> </template>
...@@ -462,6 +462,7 @@ ...@@ -462,6 +462,7 @@
<fee-application :order-id="orderId" :currencys="JSON.stringify(currencyList)" :dialog-visible.sync="feeApplicationBol"></fee-application> <fee-application :order-id="orderId" :currencys="JSON.stringify(currencyList)" :dialog-visible.sync="feeApplicationBol"></fee-application>
<merge-log :order-no="showMergedLogOrderNo" v-if="showMergedLogOrderNo !== null" @close="showMergedLogOrderNo=null" /> <merge-log :order-no="showMergedLogOrderNo" v-if="showMergedLogOrderNo !== null" @close="showMergedLogOrderNo=null" />
<pickup-log v-if="showPickupLogOrderNo" :order-no="showPickupLogOrderNo" @close="showPickupLogOrderNo=null" @delete="getList" /> <pickup-log v-if="showPickupLogOrderNo" :order-no="showPickupLogOrderNo" @close="showPickupLogOrderNo=null" @delete="getList" />
<SplitRevoke v-if="splitRevokeOrderId" :order-id="splitRevokeOrderId" @close="splitRevokeOrderId=null;getList()"></SplitRevoke>
</div> </div>
</template> </template>
...@@ -471,7 +472,6 @@ import ProductSelector from '@/components/ProductSelector' ...@@ -471,7 +472,6 @@ import ProductSelector from '@/components/ProductSelector'
import { getProductAttrList } from '@/api/ecw/productAttr' import { getProductAttrList } from '@/api/ecw/productAttr'
import CustomerSelector from '@/components/CustomerSelector' import CustomerSelector from '@/components/CustomerSelector'
import specialNeeds from '@/views/ecw/order/components/specialNeeds'; import specialNeeds from '@/views/ecw/order/components/specialNeeds';
import { getTradeCityList } from '@/api/ecw/region'
import { import {
createOrder, createOrder,
updateOrder, updateOrder,
...@@ -497,7 +497,7 @@ import { ...@@ -497,7 +497,7 @@ import {
exportCustomsDatas, exportCustomsDatas,
exportShippingDatas, exportShippingDatas,
exportShipFee, exportShipFee,
exportUnload, splitCancelApply exportUnload, splitCancelApply, orderSplitRevoke
} from "@/api/ecw/order"; } from "@/api/ecw/order";
/* import { getDictDatas, DICT_TYPE } from '@/utils/dict'; */ /* import { getDictDatas, DICT_TYPE } from '@/utils/dict'; */
import PrintTag from './components/PrintTag' import PrintTag from './components/PrintTag'
...@@ -512,6 +512,7 @@ import MergeLog from '@/views/ecw/order/components/MergeLog' ...@@ -512,6 +512,7 @@ import MergeLog from '@/views/ecw/order/components/MergeLog'
import PickupLog from './components/PickupLog' import PickupLog from './components/PickupLog'
import {getWarehouseList} from '@/api/ecw/warehouse' import {getWarehouseList} from '@/api/ecw/warehouse'
import { getCurrencyPage } from "@/api/ecw/currency"; import { getCurrencyPage } from "@/api/ecw/currency";
import SplitRevoke from "@/views/ecw/order/components/SplitRevoke";
export default { export default {
name: "EcwOrderIndex", name: "EcwOrderIndex",
components: { components: {
...@@ -520,6 +521,7 @@ export default { ...@@ -520,6 +521,7 @@ export default {
BatchSingleApplication, BatchSingleApplication,
MergeLog, MergeLog,
PickupLog, PickupLog,
SplitRevoke,
CustomerSelector, ProductSelector, Selector,specialNeeds,PrintTag, PrintWarehouseReceipt, PrintLadingBill, BatchPickup,withdrawal CustomerSelector, ProductSelector, Selector,specialNeeds,PrintTag, PrintWarehouseReceipt, PrintLadingBill, BatchPickup,withdrawal
}, },
props: { props: {
...@@ -583,6 +585,8 @@ export default { ...@@ -583,6 +585,8 @@ export default {
}, },
currencyList:[], currencyList:[],
statistics: null ,// 统计数据 statistics: null ,// 统计数据
splitRevokeOrderId: null, // 撤销拆单的订单ID
}; };
}, },
watch:{ watch:{
...@@ -646,7 +650,7 @@ export default { ...@@ -646,7 +650,7 @@ export default {
} }
}, },
activated(){ activated(){
this.handleQuery() this.getList()
}, },
created() { created() {
this.getTransportFromRoute() this.getTransportFromRoute()
...@@ -659,13 +663,8 @@ export default { ...@@ -659,13 +663,8 @@ export default {
}, },
methods: { methods: {
// 取消拆单申请 // 取消拆单申请
cancelSplit(row){ splitRevoke(row){
this.$prompt('请输入撤销理由').then(res =>{ this.splitRevokeOrderId = row.orderId
console.log("res", res)
return splitCancelApply({ orderId: row.orderId, reason: res.value})
}).then(() => {
this.getList()
})
}, },
// 获得导出函数 // 获得导出函数
getExportFunc(){ getExportFunc(){
......
...@@ -154,14 +154,32 @@ ...@@ -154,14 +154,32 @@
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.brandType" /> <dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.brandType" />
</template> </template>
</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">
<span>{{scope.row.volume}}</span> <el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini">
<span slot="append"></span>
</el-input>
</template> </template>
</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">
<span>{{scope.row.weight}}kg</span> <el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini">
<span slot="append"></span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.weight" @change="updateField(scope.row, 'weight')" size="mini">
<span slot="append">kg</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('收费重量')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini">
<span slot="append">kg</span>
</el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('箱数')" align="center"> <el-table-column :label="$t('箱数')" align="center">
...@@ -213,32 +231,42 @@ ...@@ -213,32 +231,42 @@
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="500px" append-to-body> <el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px"> <el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px">
<el-row> <el-form-item :label="$t('中文品名')" v-if="splitData.length>0">
<el-form-item :label="$t('中文品名')+':'" v-if="splitData.length>0">
<el-select v-model="shopForm.pordid" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh" clearable> <el-select v-model="shopForm.pordid" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh" clearable>
<el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleZh" :value="item.id" :key="item.prodTitleZh" ></el-option> <el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleZh" :value="item.id" :key="item.prodTitleZh" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> <el-form-item :label="$t('英文品名')" v-if="splitData.length>0">
<el-row>
<el-form-item :label="$t('英文品名')+':'" v-if="splitData.length>0">
<el-select v-model="shopForm.pordid" :placeholder="$t('请选择英文品名')" @change="changeProdTitleZh" clearable> <el-select v-model="shopForm.pordid" :placeholder="$t('请选择英文品名')" @change="changeProdTitleZh" clearable>
<el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleEn" :value="item.id" :key="item.prodTitleEn" ></el-option> <el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleEn" :value="item.id" :key="item.prodTitleEn" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('剩余箱数')+':'"> <el-form-item :label="$t('剩余箱数')">
{{shopForm.sum||0}} {{shopForm.sum||0}}
</el-form-item> </el-form-item>
<el-form-item :label="$t('放入箱数')+':'"> <el-form-item :label="$t('放入箱数')">
<el-input-number v-model="shopForm.num" @change="numChange" controls-position="right" :min="1" :max="shopForm.sum"></el-input-number> <el-input-number v-model="shopForm.num" @change="numChange" controls-position="right" :min="1" :max="shopForm.sum"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item v-if="quantityshow" :label="$t('放入数量')+'('+$t('个')+')'+':'"> <el-form-item v-if="quantityshow" :label="$t('放入数量')+'('+$t('个')+')'">
<el-input-number v-model="shopForm.quantity" controls-position="right" :min="1" :max="quantitySum"></el-input-number> <el-input-number v-model="shopForm.quantity" controls-position="right" :min="1" :max="quantitySum"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item :label="$t('入仓体积')">
<el-input-number v-model="shopForm.volume" @change="numChange" controls-position="right" :min="1" :max="shopForm.sum"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费体积')">
<el-input-number v-model="shopForm.chargeVolume" @change="numChange" controls-position="right" :min="1" :max="shopForm.sum"></el-input-number>
</el-form-item>
<el-form-item :label="$t('入仓重量')">
<el-input-number v-model="shopForm.weight" @change="numChange" controls-position="right" :min="1" :max="shopForm.sum"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费重量')">
<el-input-number v-model="shopForm.chargeWeight" @change="numChange" controls-position="right" :min="1" :max="shopForm.sum"></el-input-number>
</el-form-item>
<el-form-item :label="$t('备注信息')+':'"> <el-form-item :label="$t('备注信息')+':'">
<el-input v-model="shopForm.remark"></el-input> <el-input v-model="shopForm.remark"></el-input>
</el-form-item> </el-form-item>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shopAdd">{{$t('确定')}}</el-button> <el-button type="primary" @click="shopAdd">{{$t('确定')}}</el-button>
...@@ -270,7 +298,7 @@ import {getWarehouseList} from '@/api/ecw/warehouse' ...@@ -270,7 +298,7 @@ import {getWarehouseList} from '@/api/ecw/warehouse'
import {getChannelList} from '@/api/ecw/channel' import {getChannelList} from '@/api/ecw/channel'
import WorkFlow from '@/components/WorkFlow' import WorkFlow from '@/components/WorkFlow'
import {getOrder} from '@/api/ecw/order' import {getOrder} from '@/api/ecw/order'
import Decimal from 'decimal.js'
export default { export default {
name: "SplitApply", name: "SplitApply",
...@@ -364,6 +392,19 @@ export default { ...@@ -364,6 +392,19 @@ export default {
} }
}, },
methods: { methods: {
/*检查并提交字段(体积,重量)修改*/
updateField(row, field){
let val = parseFloat(row[field])
if(!val || val < 0){
this.$message.error(this.$t('数据无效'))
return this.getList()
}
createSplitItem(row).then(() => {
this.$message.success(this.$t('修改成功'))
}).catch(() => {
this.getList()
})
},
checkCode(data){ checkCode(data){
if(data.indexOf('+')==-1){ if(data.indexOf('+')==-1){
return '+'+data return '+'+data
...@@ -452,6 +493,37 @@ export default { ...@@ -452,6 +493,37 @@ export default {
this.$modal.msgError(this.$t("请先新建拆单")) this.$modal.msgError(this.$t("请先新建拆单"))
return return
} }
// 判断体积和重量,子单和必须等于父单
// 1.将拆单中的商品项数据汇总保存到orderItem
this.splitData.forEach(item => {
item.orderSplitItemBackVOList.forEach(splitItem => {
let orderItem = this.orderData.orderItemVOList.find(orderItem => orderItem.orderItemId == splitItem.orderItemId)
if(!orderItem.splitSum){
orderItem.splitSum = {
volume: new Decimal(splitItem.volume || 0),
weight: new Decimal(splitItem.weight|| 0)
}
}else{
orderItem.splitSum.volume = orderItem.splitSum.volume.plus(splitItem.volume || 0)
orderItem.splitSum.weight = orderItem.splitSum.weight.plus(splitItem.weight || 0)
}
})
})
// 2. 遍历商品项 对比数据是否符合
let prods = [] // 数据不符合要求的商品
this.orderData.orderItemVOList.forEach(item => {
if(!item.splitSum){
prods.push(this.$l(item, 'prodTitle'))
return
}
if(item.splitSum.volume.toNumber() != item.warehouseInInfoVO.volume || item.splitSum.weight.toNumber() != item.warehouseInInfoVO.weight){
prods.push(this.$l(item, 'prodTitle'))
}
})
if(prods.length){
return this.$alert( this.$t("{prods}等商品拆单总数据跟主单不匹配", {prods: prods.join(',')}))
}
// if(this.selectedUsers.length==0){ // if(this.selectedUsers.length==0){
// this.$modal.msgError("请选择抄送人") // this.$modal.msgError("请选择抄送人")
// return // return
...@@ -468,7 +540,6 @@ export default { ...@@ -468,7 +540,6 @@ export default {
addShop(index){ addShop(index){
this.splitItemIndex = index this.splitItemIndex = index
this.shopOpen = true this.shopOpen = true
}, },
addSplit(){ addSplit(){
this.form.transportId = this.orderData.transportId this.form.transportId = this.orderData.transportId
...@@ -552,7 +623,11 @@ export default { ...@@ -552,7 +623,11 @@ export default {
num:this.shopForm.num, num:this.shopForm.num,
orderItemId:this.shopForm.orderItemId, orderItemId:this.shopForm.orderItemId,
orderSplitId:this.splitData[this.splitItemIndex].id, orderSplitId:this.splitData[this.splitItemIndex].id,
remark:this.shopForm.remark remark:this.shopForm.remark,
volume: this.shopForm.volume,
chargeVolume: this.shopForm.chargeVolume,
weight: this.shopForm.weight,
chargeWeight: this.shopForm.chargeWeight
} }
createSplitItem(params).then(res=>{ createSplitItem(params).then(res=>{
this.$message.success(this.$t("放入成功")); this.$message.success(this.$t("放入成功"));
......
...@@ -12,8 +12,11 @@ ...@@ -12,8 +12,11 @@
<el-descriptions border :column="2"> <el-descriptions border :column="2">
<el-descriptions-item> <el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template> <template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template>
<span style="min-width: 200px;margin-right: 15px;display: inline-block">
<product-selector v-if="!order.parentOrderId && !isAdd" 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> <span v-else>{{ warehousing.prodTitleZh }}</span>
</span>
<el-button v-if="!order.parentOrderId && !isAdd" type="text" @click="isShowProduct = true">添加新商品</el-button>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('英文品名') }}</template> <template slot="label"><span style="color: red">*</span>{{ $t('英文品名') }}</template>
...@@ -171,6 +174,19 @@ ...@@ -171,6 +174,19 @@
:is-editing="edit"></warehouse-area-select> :is-editing="edit"></warehouse-area-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-popconfirm
v-if="$index >= protectRowCount"
title="确定要删除该行入仓记录吗?"
@confirm="handleDeleteRow($index)"
>
<template v-slot:reference>
<el-button size="mini" type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table> </el-table>
</el-form> </el-form>
...@@ -185,6 +201,7 @@ ...@@ -185,6 +201,7 @@
<template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template> <template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template>
<el-form-item required label="" prop="prodId" label-width="0"> <el-form-item required label="" prop="prodId" label-width="0">
<product-selector v-model="form1.prodId" @change="onProductChange1"/> <product-selector v-model="form1.prodId" @change="onProductChange1"/>
<el-button type="text" @click="isShowProduct = true" style="margin-left: 15px">添加新商品</el-button>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
...@@ -352,6 +369,18 @@ ...@@ -352,6 +369,18 @@
:is-editing="edit"></warehouse-area-select> :is-editing="edit"></warehouse-area-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-popconfirm
title="确定要删除该行入仓记录吗?"
@confirm="handleDeleteRow($index, 1)"
>
<template v-slot:reference>
<el-button size="mini" type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table> </el-table>
</el-form> </el-form>
</el-card> </el-card>
...@@ -380,6 +409,35 @@ ...@@ -380,6 +409,35 @@
</template> </template>
</span> </span>
</el-dialog> </el-dialog>
<!-- 对话框(添加 / 修改) -->
<el-dialog title="添加商品" :visible.sync="isShowProduct" width="550px" append-to-body>
<el-form ref="productForm" :model="productForm" :rules="productRules" label-width="110px">
<el-form-item :label="$t('商品类型')" prop="typeId">
<el-select v-model="productForm.typeId" :placeholder="$t('选择商品类型')" clearable>
<el-option v-for="types in typeList" :key="types.id" :label="types.titleZh" :value="types.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('中文标题')" prop="titleZh">
<el-input v-model="productForm.titleZh" :placeholder="$t('请输入中文标题')" />
</el-form-item>
<el-form-item :label="$t('英文标题')" prop="titleEn">
<el-input v-model="productForm.titleEn" :placeholder="$t('请输入英文标题')" />
</el-form-item>
<el-form-item :label="$t('商品特性')" prop="attrArray">
<el-select v-model="productForm.attrArray" :placeholder="$t('选择商品特性')" clearable multiple>
<el-option v-for="attr in attrList" :key="attr.id" :label="attr.attrName" :value="attr.id" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="productSubmit">{{$t('确定')}}</el-button>
<el-button @click="productCancel">{{$t('取消')}}</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -391,6 +449,9 @@ import {cancelProcessInstance} from "@/api/bpm/processInstance" ...@@ -391,6 +449,9 @@ import {cancelProcessInstance} from "@/api/bpm/processInstance"
import WorkFlow from "@/components/WorkFlow" import WorkFlow from "@/components/WorkFlow"
import {DICT_TYPE, getDictDataLabel, getDictDatas} from "@/utils/dict" import {DICT_TYPE, getDictDataLabel, getDictDatas} from "@/utils/dict"
import {orderWarehouseIn, orderWarehouseInUpdateApply} from "@/api/ecw/order" import {orderWarehouseIn, orderWarehouseInUpdateApply} from "@/api/ecw/order"
import {getProductAttrList} from "@/api/ecw/productAttr"
import {getProductTypeList} from "@/api/ecw/productType"
import {createProduct} from "@/api/ecw/product"
export default { export default {
name: "Warehouse", name: "Warehouse",
...@@ -441,6 +502,11 @@ export default { ...@@ -441,6 +502,11 @@ export default {
} }
}, },
mounted() {
this.getAttrList()
this.getTypeList()
},
computed: { computed: {
isAdd() { isAdd() {
return this.$route.path === "/order/warehousing-add" return this.$route.path === "/order/warehousing-add"
...@@ -581,7 +647,26 @@ export default { ...@@ -581,7 +647,26 @@ export default {
formId: '', formId: '',
// 追加时被保护的行数 // 追加时被保护的行数
protectRowCount: -1 protectRowCount: -1,
// 添加商品弹窗
isShowProduct: false,
productForm: {
typeId: undefined,
attrArray: [],
titleZh: undefined,
titleEn: undefined
},
productRules: {
typeId: [{ required: true, message: this.$t("商品类型不能为空"), trigger: "change" }],
// attrArray: [{ required: true, message: this.$t("商品特性不能为空"), trigger: "change" }],
titleZh: [{ required: true, message: this.$t("中文标题不能为空"), trigger: "blur" }],
titleEn: [{ required: true, message: this.$t("英文标题不能为空"), trigger: "blur" }],
},
//类型列表
typeList: [],
// 特性列表
attrList: []
} }
}, },
...@@ -797,6 +882,13 @@ export default { ...@@ -797,6 +882,13 @@ export default {
this.form.table.pop() this.form.table.pop()
} }
}, },
handleDeleteRow(index, val) {
if (val === 1) {
this.form1.table.splice(index, 1)
} else if (this.form.table.length > this.protectRowCount) {
this.form.table.splice(index, 1)
}
},
handleAdd(val = 0) { handleAdd(val = 0) {
let cartonsNum = '' let cartonsNum = ''
if (val !== 1) { // 货物入仓 if (val !== 1) { // 货物入仓
...@@ -821,6 +913,46 @@ export default { ...@@ -821,6 +913,46 @@ export default {
specificationType: '1', specificationType: '1',
table: [] table: []
}) })
},
/** 获取产品属性列表 */
getAttrList() {
getProductAttrList().then(response => {
this.attrList = response.data;
})
},
/** 获取产品类型列表 */
getTypeList() {
getProductTypeList().then(response => {
this.typeList = response.data;
})
},
productSubmit(){
this.$refs["productForm"].validate(valid => {
if (!valid) {
return;
}
//商品特性转字符串
this.productForm.attrId = this.productForm.attrArray.join(',')
// 添加的提交
createProduct(this.productForm).then(response => {
this.$modal.msgSuccess(this.$t("新增成功"))
if (this.activeName === 'first') {
this.form.prodId = response.data
} else {
this.form1.prodId = response.data
}
this.productCancel()
})
})
},
productCancel(){
this.isShowProduct = false
this.productForm = {
typeId: undefined,
attrArray: [],
titleZh: undefined,
titleEn: undefined
}
} }
} }
} }
......
...@@ -90,7 +90,6 @@ ...@@ -90,7 +90,6 @@
:title="$t('修改')" :title="$t('修改')"
:order="order" :order="order"
@close="getList"></warehouse> @close="getList"></warehouse>
<!-- <el-button v-if="isEdit" size="mini" type="text" @click="handleWarehousing(row)">{{$t('修改')}}</el-button>-->
<template v-else-if=" <template v-else-if="
wareItem(row.orderItemId) wareItem(row.orderItemId)
&& wareItem(row.orderItemId).orderWarehouseInBackItemDoList && wareItem(row.orderItemId).orderWarehouseInBackItemDoList
...@@ -103,7 +102,6 @@ ...@@ -103,7 +102,6 @@
:title="$t('追加')" :title="$t('追加')"
:order="order" :order="order"
@close="getList"></warehouse> @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> <el-button size="mini" type="text" @click="handleWarehousingReturn(row)">{{$t('退仓')}}</el-button>
<!-- </template>--> <!-- </template>-->
</template> </template>
...@@ -114,7 +112,6 @@ ...@@ -114,7 +112,6 @@
:title="$t('入仓')" :title="$t('入仓')"
:order="order" :order="order"
@close="getList"></warehouse> @close="getList"></warehouse>
<!-- <el-button v-else size="mini" type="text" @click="handleWarehousing(row)">{{$t('入仓')}}</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -179,8 +176,6 @@ ...@@ -179,8 +176,6 @@
<warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList" <warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList"
:order-id="orderId" :warehouse-id="warehouseId" :is-editing="isEdit"></warehouse-area-dialog> :order-id="orderId" :warehouse-id="warehouseId" :is-editing="isEdit"></warehouse-area-dialog>
<edit-dialog :order="order" :title="title" :order-id="order.orderId" :visible.sync="warehousingVisible" :warehousing="warehousing" :edit="isEdit" :is-jiyun="order.type === 1 || order.type === '1'"></edit-dialog>
<!-- 完成入仓 --> <!-- 完成入仓 -->
<el-dialog <el-dialog
:title="$t('确认入仓')" :title="$t('确认入仓')"
...@@ -231,7 +226,6 @@ import { ...@@ -231,7 +226,6 @@ import {
} from '@/api/ecw/order' } from '@/api/ecw/order'
import orderBaseInfo from "@/components/OrderBaseInfo" import orderBaseInfo from "@/components/OrderBaseInfo"
import WarehouseAreaDialog from '@/components/WarehouseAreaDialog' import WarehouseAreaDialog from '@/components/WarehouseAreaDialog'
import editDialog from '@/views/ecw/order/warehousing/components/editDialog'
import {DICT_TYPE} from "@/utils/dict" import {DICT_TYPE} from "@/utils/dict"
import PrintTag from "@/views/ecw/order/components/PrintTag" import PrintTag from "@/views/ecw/order/components/PrintTag"
import PrintWarehouseReceipt from "@/views/ecw/order/components/PrintWarehouseReceipt" import PrintWarehouseReceipt from "@/views/ecw/order/components/PrintWarehouseReceipt"
...@@ -245,7 +239,6 @@ export default { ...@@ -245,7 +239,6 @@ export default {
components: { components: {
orderBaseInfo, orderBaseInfo,
WarehouseAreaDialog, WarehouseAreaDialog,
editDialog,
PrintTag, PrintTag,
PrintWarehouseReceipt, PrintWarehouseReceipt,
imageUpload, imageUpload,
...@@ -477,11 +470,6 @@ export default { ...@@ -477,11 +470,6 @@ export default {
} }
}) })
}, },
handleWarehousing(row) {
let wareItem = this.orderItemList.find(item => item.orderItemId == row.orderItemId) || {}
this.warehousing = {...row, ...wareItem}
this.warehousingVisible = true
},
handleWarehousingReturn(item){ handleWarehousingReturn(item){
this.$confirm(item.prodTitleZh + this.$t('退仓后不可恢复,是否确认退仓?'), this.$t('确定要退仓?'), { this.$confirm(item.prodTitleZh + this.$t('退仓后不可恢复,是否确认退仓?'), this.$t('确定要退仓?'), {
confirmButtonText: this.$t('确定'), confirmButtonText: this.$t('确定'),
...@@ -507,12 +495,6 @@ export default { ...@@ -507,12 +495,6 @@ export default {
}, },
watch: { watch: {
warehousingVisible(val) {
if (!val){
this.getOrder()
this.getOrderItemList()
}
},
orderSpecialNeeds(val){ orderSpecialNeeds(val){
val.forEach(e => { val.forEach(e => {
this.form.orderSpecialNeedReceivableReqVoList.push({ this.form.orderSpecialNeedReceivableReqVoList.push({
......
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