新增合约类型
This commit is contained in:
parent
7314b545ea
commit
359df015f1
|
|
@ -77,6 +77,9 @@ public class ProduceOrderSaveReqVO {
|
|||
@Schema(description = "交货数量")
|
||||
private Long deliveryQty;
|
||||
|
||||
@Schema(description = "合约类型")
|
||||
private String contractType;
|
||||
|
||||
@Schema(description = "详情")
|
||||
private String details;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
|
|
@ -59,7 +60,11 @@ public class ProduceOrderServiceImpl implements ProduceOrderService {
|
|||
if(FuncUtil.isNotEmpty(code)){
|
||||
checkCode(produceOrder.getId(),code);
|
||||
}else {
|
||||
produceOrder.setBillno(getNewCode());
|
||||
String newCode = getNewCode();
|
||||
if(StringUtils.isNotBlank(createReqVO.getContractType())){
|
||||
newCode = newCode.replace("XSHY-",createReqVO.getContractType()+"-");
|
||||
}
|
||||
produceOrder.setBillno(newCode);
|
||||
}
|
||||
produceOrderMapper.insert(produceOrder);
|
||||
// 返回
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ export interface SaleOrderVO {
|
|||
address: string // 地址
|
||||
currency: string // 货币
|
||||
invoiceRemarks: string // 发票备注
|
||||
contractType: string // 合约类型
|
||||
currencyType: string // 结算币种
|
||||
}
|
||||
|
||||
// 销售订单 API
|
||||
|
|
|
|||
|
|
@ -221,5 +221,6 @@ export enum DICT_TYPE {
|
|||
OMS_ORDER_STATUS = 'oms_order_status',// 订单状态
|
||||
OMS_PRODUCT_CARE_ITEM_TYPE = 'oms_product_care_item_type', //产品保养项目类型 1.成分说明 2.洗涤说明 3.使用说明 4.尺码
|
||||
OMS_PRODUCT_CARE_PROCESS_TYPE = 'oms_product_care_process_type', //产品护理过程类型 1洗涤 2漂白 3烘干 4自然干燥 5熨烫 6专业纺织品护理工艺
|
||||
OMS_CONTRACT_TYPE = 'oms_contract_type', //合约类型
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,16 +21,46 @@
|
|||
@click="remark">备注</el-button>
|
||||
<!-- 订单信息 -->
|
||||
<el-descriptions title="订单信息">
|
||||
<el-descriptions-item label="订单号: ">{{ formData.billno }}</el-descriptions-item>
|
||||
<el-descriptions-item label="业务日期: ">{{ formatDate(formData.bizdate,'YYYY-MM-DD') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="确认日期: ">{{ formatDate(formData.confirmdate,'YYYY-MM-DD') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计划日期: ">{{ formatDate(formData.plansenddate,'YYYY-MM-DD') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="订单号: " width="1000px">{{ formData.billno }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合约类型: " width="1000px">
|
||||
<el-select
|
||||
v-model="formData.contractType"
|
||||
placeholder="请选择合约类型"
|
||||
clearable
|
||||
class="!w-300px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.OMS_CONTRACT_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="业务日期: " width="500px">{{ formatDate(formData.bizdate,'YYYY-MM-DD') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="确认日期: " >{{ formatDate(formData.confirmdate,'YYYY-MM-DD') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计划日期: " >{{ formatDate(formData.plansenddate,'YYYY-MM-DD') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机: ">{{ formData.phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="传真: ">{{ formData.fax }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱: ">{{ formData.emails }}</el-descriptions-item>
|
||||
<el-descriptions-item label="客户编号: ">{{ formData?.customer?.number }}</el-descriptions-item>
|
||||
<el-descriptions-item label="客户名称: ">{{ formData?.customer?.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="客户公司: ">{{ formData?.customer?.company }}</el-descriptions-item>
|
||||
<el-descriptions-item label="结算币种: ">
|
||||
<el-select
|
||||
v-model="formData.currencyType"
|
||||
placeholder="请选择结算币种"
|
||||
clearable
|
||||
class="!w-300px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.CURRENCY_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label+'('+dict.value+')'"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="订单备注: ">{{ formData.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
|
|
@ -149,19 +179,19 @@
|
|||
|
||||
<!-- 订单信息 -->
|
||||
<el-descriptions title="发票信息">
|
||||
<el-descriptions-item label="发票抬头: ">{{ formData.invoiceCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票名称: ">{{ formData.invoiceName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="货币: ">{{ formData.currency }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票备注: ">{{ formData.invoiceRemarks }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票抬头: " width="1000px">{{ formData.invoiceCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票名称: " width="1000px">{{ formData.invoiceName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票地址: " width="500px">{{ formData.address }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票备注: " width="500px">{{ formData.invoiceRemarks }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
|
||||
<!-- 订单信息 -->
|
||||
<el-descriptions title="制单信息">
|
||||
<el-descriptions-item label="创建时间: ">{{ formatDate(formData.createTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="修改人: ">{{ formData.updaterName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="修改时间: ">{{ formatDate(formData.updateTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间: " width="1000px">{{ formatDate(formData.createTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="修改人: " width="1000px">{{ formData.updaterName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="修改时间: " width="500px">{{ formatDate(formData.updateTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核人: ">{{ formData.auditorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间: ">{{ formatDate(formData.auditorTime) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
|
@ -172,8 +202,8 @@
|
|||
<OrderUpdateAddressForm ref="updateAddressFormRef" @success="getDetail" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { fenToYuan } from '@/utils'
|
||||
import { DICT_TYPE, getDictLabel, getDictObj } from '@/utils/dict'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import OrderUpdateRemarkForm from '@/views/oms/saleorder/form/OrderUpdateRemarkForm.vue'
|
||||
import OrderUpdateAddressForm from '@/views/oms/saleorder/form/OrderUpdateAddressForm.vue'
|
||||
|
|
@ -187,16 +217,22 @@ const message = useMessage() // 消息弹窗
|
|||
|
||||
|
||||
|
||||
// 订单详情
|
||||
const formData = ref<SaleOrderVO>({
|
||||
logs: []
|
||||
})
|
||||
const itemFormRules = reactive({
|
||||
contractType: [{ required: true, message: '合约类型不能为空', trigger: 'blur' }],
|
||||
})
|
||||
|
||||
|
||||
const itemFormEntrysRef = ref() // 表单 Ref
|
||||
|
||||
const itemFormEntrysRules = reactive({
|
||||
price: [{ required: true, message: '单价不能为空', trigger: 'blur' }],
|
||||
})
|
||||
|
||||
// 订单详情
|
||||
const formData = ref<SaleOrderVO>({
|
||||
logs: []
|
||||
})
|
||||
|
||||
|
||||
/** 各种操作 */
|
||||
const updateRemarkForm = ref() // 订单备注表单 Ref
|
||||
|
|
@ -220,10 +256,19 @@ const changeRow = async (row,key:string) => {
|
|||
}
|
||||
const handleSave = async () => {
|
||||
try {
|
||||
if(!formData.value.contractType){
|
||||
message.alertError("合约类型不能为空")
|
||||
return
|
||||
}
|
||||
if(!formData.value.currencyType){
|
||||
message.alertError("结算币种不能为空")
|
||||
return
|
||||
}
|
||||
// 校验表单
|
||||
await itemFormEntrysRef.value.validate()
|
||||
// 提交
|
||||
await SaleOrderApi.updateOrderEntrys(formData.value)
|
||||
await SaleOrderApi.updateSaleOrder(formData.value)
|
||||
//await SaleOrderApi.updateOrderEntrys(formData.value)
|
||||
message.success('保存成功')
|
||||
// 刷新列表
|
||||
await getDetail()
|
||||
|
|
@ -233,6 +278,14 @@ const handleSave = async () => {
|
|||
/** 审核 */
|
||||
const handleAudit = async () => {
|
||||
try {
|
||||
if(!formData.value.contractType){
|
||||
message.alertError("合约类型不能为空")
|
||||
return
|
||||
}
|
||||
if(!formData.value.currencyType){
|
||||
message.alertError("结算币种不能为空")
|
||||
return
|
||||
}
|
||||
// 校验表单
|
||||
await itemFormEntrysRef.value.validate()
|
||||
// 二次确认
|
||||
|
|
|
|||
Loading…
Reference in New Issue