Commit ded8fcd7 by LJM

寄售申请

parent f275e5bc
...@@ -27,13 +27,20 @@ ...@@ -27,13 +27,20 @@
<!--操作区--> <!--操作区-->
<div class="operation-area row verCenter bothSide"> <div class="operation-area row verCenter bothSide">
<div class="operation-button row verCenter"> <div class="operation-button row verCenter">
<el-button type="primary">提交审核</el-button> <el-button type="primary" @click="popupEvent(1)">提交审核</el-button>
<el-button type="primary">作废</el-button> <el-button type="primary" @click="popupEvent(2)">作废</el-button>
<el-button type="primary">关单</el-button> <el-button type="primary" @click="popupEvent(3)">关单</el-button>
<el-tooltip placement="top" effect="dark">
<div slot="content">
作废:待提审状态、进行中但未发货未入库时可作废<br>
关单:进行中,未全部入库且未入库的商品不再寄售时可关单,关单后单据将变为完成状态
</div>
<i class="el-icon-question" style="font-size: 16px;color: #ff9000;margin-left: 10px;cursor: pointer;"></i>
</el-tooltip>
</div> </div>
<div class="text-tip row verCenter"> <div class="text-tip row verCenter">
<i class="el-icon-warning"></i> <i class="el-icon-warning"></i>
<span>可选择“待审核”状态的数据提交寄售申请,每次最多可提交200条</span> <span>可选择"待审核"状态的数据提交寄售申请,每次最多可提交200条</span>
</div> </div>
</div> </div>
<!--列表区--> <!--列表区-->
...@@ -60,6 +67,41 @@ ...@@ -60,6 +67,41 @@
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
</div> </div>
<!--提交审核-->
<el-dialog title="提交审核" :close-on-click-modal="false" :visible.sync="dialogVisible_1" width="500px">
<p style="margin-bottom: 15px;margin-left: 80px;">确定将选择的商品提交寄售审核?</p>
<el-form ref="form" label-width="80px">
<el-form-item label="附加说明">
<el-input type="textarea" v-model="remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible_1 = false">取 消</el-button>
<el-button type="primary" @click="verifyConsignment">确 定</el-button>
</div>
</el-dialog>
<!--作废-->
<el-dialog title="作废" :close-on-click-modal="false" :visible.sync="dialogVisible_2" width="500px">
<p style="margin-bottom: 15px;margin-left: 80px;">确定将选择的寄售申请单作废?</p>
<el-form ref="form" label-width="80px">
<el-form-item label="原因说明">
<el-input type="textarea" v-model="remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible_2 = false">取 消</el-button>
<el-button type="primary" @click="cancelConsignment">确 定</el-button>
</div>
</el-dialog>
<!--关单-->
<el-dialog title="关单" :close-on-click-modal="false" :visible.sync="dialogVisible_3" width="500px">
<p style="margin-bottom: 15px;">确定将选择的寄售申请单关单?</p>
<p style="margin-bottom: 10px;color: #ff9000">关单后,寄售申请单将变为【完成】状态,所有明细不可再进行入库操作</p>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible_3 = false">取 消</el-button>
<el-button type="primary" @click="closeConsignment">确 定</el-button>
</div>
</el-dialog>
<Menu></Menu> <Menu></Menu>
</div> </div>
</template> </template>
...@@ -81,6 +123,11 @@ export default { ...@@ -81,6 +123,11 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
list: [], list: [],
dialogVisible_1: false,
dialogVisible_2: false,
dialogVisible_3: false,
remark: '',
consignment_ids: '',
formParam: { formParam: {
consignment_sn: '', consignment_sn: '',
goods_name: '', goods_name: '',
...@@ -165,6 +212,111 @@ export default { ...@@ -165,6 +212,111 @@ export default {
*/ */
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
},
/**
* 弹窗事件
*/
popupEvent(type) {
if (!this.multipleSelection.length) {
this.$message.warning('请选择数据');
return;
}
switch (type) {
case 1:
// 提交审核:校验待提审状态
const invalidVerify = this.multipleSelection.filter(item => item.consignment_status !== '0');
if (invalidVerify.length) {
this.$message.warning('只能选择待提审状态的数据');
return;
}
if (this.multipleSelection.length > 200) {
this.$message.warning('每次最多可提交200条数据');
return;
}
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(',');
this.dialogVisible_1 = true;
break;
case 2:
// 作废:校验待提审或进行中(未发货未入库)状态
const invalidCancel = this.multipleSelection.filter(item => !(['0', '2'].includes(item.consignment_status) && item.deliver_status === '0' && item.stock_in_status === '0'));
if (invalidCancel.length) {
this.$message.warning('只能作废待提审或进行中(未发货未入库)的数据');
return;
}
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(',');
this.dialogVisible_2 = true;
break;
case 3:
// 关单:校验进行中且部分发货/全部发货,部分入库状态
const invalidClose = this.multipleSelection.filter(item => !(item.consignment_status === '2' && ['1', '2'].includes(item.deliver_status) && item.stock_in_status === '1'));
if (invalidClose.length) {
this.$message.warning('只能关闭进行中且已部分/全部发货、部分入库的数据');
return;
}
this.consignment_ids = this.multipleSelection.map(item => item.consignment_id).join(',');
this.dialogVisible_3 = true;
break;
}
},
/**
* 提交审核
*/
verifyConsignment() {
this.$http('POST', "/api/consignment/verifyConsignment", {consignment_ids: this.consignment_ids, remark: this.remark}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_1 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
},
/**
* 作废
*/
cancelConsignment() {
this.$http('POST', "/api/consignment/cancelConsignment", {consignment_ids: this.consignment_ids, cancel_remark: this.remark}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_2 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
},
/**
* 关单
*/
closeConsignment() {
this.$http('POST', "/api/consignment/closeConsignment", {consignment_ids: this.consignment_ids}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose: () => {
this.dialogVisible_3 = false;
this.remark = '';
this.getData();
}
});
} else {
this.$message.error(res.msg || '操作失败');
}
})
} }
}, },
components: { components: {
......
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 sign in to comment