Commit bd296531 authored by dragondean@qq.com's avatar dragondean@qq.com

Merge remote-tracking branch 'origin/dev' into dev

parents a8017b08 73fd9bee
......@@ -14,7 +14,7 @@
<el-option
v-for="(item, index) in list"
:key="item.id"
:label="item['title' + lang]"
:label="item['title' + lang] + (item.auditStatus === 2 ? '' : `(${$t('审核中')})`)"
:value="index">
</el-option>
</el-select>
......
......@@ -12,8 +12,11 @@
<el-descriptions border :column="2">
<el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template>
<product-selector v-if="!order.parentOrderId && !isAdd" v-model="form.prodId" @change="onProductChange"/>
<span v-else>{{ warehousing.prodTitleZh }}</span>
<span style="min-width: 200px;margin-right: 15px;display: inline-block">
<product-selector v-if="!order.parentOrderId && !isAdd" v-model="form.prodId" @change="onProductChange"/>
<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>
<template slot="label"><span style="color: red">*</span>{{ $t('英文品名') }}</template>
......@@ -171,6 +174,19 @@
:is-editing="edit"></warehouse-area-select>
</template>
</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-form>
......@@ -185,6 +201,7 @@
<template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template>
<el-form-item required label="" prop="prodId" label-width="0">
<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-descriptions-item>
<el-descriptions-item>
......@@ -352,6 +369,18 @@
:is-editing="edit"></warehouse-area-select>
</template>
</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-form>
</el-card>
......@@ -380,6 +409,35 @@
</template>
</span>
</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>
</template>
......@@ -391,6 +449,9 @@ import {cancelProcessInstance} from "@/api/bpm/processInstance"
import WorkFlow from "@/components/WorkFlow"
import {DICT_TYPE, getDictDataLabel, getDictDatas} from "@/utils/dict"
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 {
name: "Warehouse",
......@@ -441,6 +502,11 @@ export default {
}
},
mounted() {
this.getAttrList()
this.getTypeList()
},
computed: {
isAdd() {
return this.$route.path === "/order/warehousing-add"
......@@ -581,7 +647,26 @@ export default {
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 {
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) {
let cartonsNum = ''
if (val !== 1) { // 货物入仓
......@@ -821,6 +913,46 @@ export default {
specificationType: '1',
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 @@
: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
......@@ -103,7 +102,6 @@
: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>
......@@ -114,7 +112,6 @@
: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>
</el-table>
......@@ -179,8 +176,6 @@
<warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList"
: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
:title="$t('确认入仓')"
......@@ -231,7 +226,6 @@ import {
} from '@/api/ecw/order'
import orderBaseInfo from "@/components/OrderBaseInfo"
import WarehouseAreaDialog from '@/components/WarehouseAreaDialog'
import editDialog from '@/views/ecw/order/warehousing/components/editDialog'
import {DICT_TYPE} from "@/utils/dict"
import PrintTag from "@/views/ecw/order/components/PrintTag"
import PrintWarehouseReceipt from "@/views/ecw/order/components/PrintWarehouseReceipt"
......@@ -245,7 +239,6 @@ export default {
components: {
orderBaseInfo,
WarehouseAreaDialog,
editDialog,
PrintTag,
PrintWarehouseReceipt,
imageUpload,
......@@ -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){
this.$confirm(item.prodTitleZh + this.$t('退仓后不可恢复,是否确认退仓?'), this.$t('确定要退仓?'), {
confirmButtonText: this.$t('确定'),
......@@ -507,12 +495,6 @@ export default {
},
watch: {
warehousingVisible(val) {
if (!val){
this.getOrder()
this.getOrderItemList()
}
},
orderSpecialNeeds(val){
val.forEach(e => {
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