Compare commits
5 Commits
d5b05b6d79
...
a131e441c0
| Author | SHA1 | Date |
|---|---|---|
|
|
a131e441c0 | |
|
|
af39aca752 | |
|
|
90e9d7bbc5 | |
|
|
359df015f1 | |
|
|
7314b545ea |
|
|
@ -11,4 +11,8 @@ public interface DictTypeConstants {
|
|||
String BILL_STATUS = "oms_bill_status"; // 单据状态
|
||||
|
||||
String ORDER_STATUS = "oms_order_status"; // 订单状态
|
||||
|
||||
String OMS_CONTRACT_TYPE = "oms_contract_type"; // 合约类型
|
||||
|
||||
String OMS_CURRENCY_TYPE = "currency_type"; // 结算币种
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package cn.hangtag.module.oms.controller.admin.app;
|
|||
|
||||
|
||||
import cn.hangtag.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.hangtag.framework.common.exception.ErrorCode;
|
||||
import cn.hangtag.framework.common.pojo.CommonResult;
|
||||
import cn.hangtag.framework.common.pojo.PageParam;
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
|
|
@ -36,6 +37,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import static cn.hangtag.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.hangtag.framework.common.pojo.CommonResult.error;
|
||||
import static cn.hangtag.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "APP - 销售订单")
|
||||
|
|
@ -97,9 +99,12 @@ public class AppSaleOrderController{
|
|||
public CommonResult<PageResult<SaleOrderRespVO>> getSaleOrderPage(@Valid SaleOrderPageReqVO pageReqVO) {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
CustomerDO customer = customerService.getCustomerByUserId(loginUser.getId());
|
||||
pageReqVO.setCustomerId(customer.getId());
|
||||
PageResult<SaleOrderDO> pageResult = saleOrderService.getSaleOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SaleOrderRespVO.class));
|
||||
if(customer!=null){
|
||||
pageReqVO.setCustomerId(customer.getId());
|
||||
PageResult<SaleOrderDO> pageResult = saleOrderService.getSaleOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SaleOrderRespVO.class));
|
||||
}
|
||||
return error(new ErrorCode(99999,"该用户未绑定客户资料,请联系管理员维护数据!"));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ public class ProduceOrderSaveReqVO {
|
|||
@Schema(description = "交货数量")
|
||||
private Long deliveryQty;
|
||||
|
||||
@Schema(description = "合约类型")
|
||||
private String contractType;
|
||||
|
||||
@Schema(description = "详情")
|
||||
private String details;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,16 @@ public class SaleOrderRespVO {
|
|||
@DictFormat(DictTypeConstants.ORDER_STATUS)
|
||||
private Integer orderStatus;
|
||||
|
||||
@Schema(description = "合约类型", example = "2")
|
||||
@ExcelProperty(value = "合约类型", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.OMS_CONTRACT_TYPE)
|
||||
private String contractType;
|
||||
|
||||
@Schema(description = "结算币种", example = "2")
|
||||
@ExcelProperty(value = "结算币种", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.OMS_CURRENCY_TYPE)
|
||||
private String currencyType;
|
||||
|
||||
@Schema(description = "业务日期")
|
||||
@ExcelProperty("业务日期")
|
||||
private LocalDateTime bizdate;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,12 @@ public class SaleOrderSaveReqVO {
|
|||
@Schema(description = "单据状态", example = "2")
|
||||
private String billStatus;
|
||||
|
||||
@Schema(description = "合约类型", example = "2")
|
||||
private String contractType;
|
||||
|
||||
@Schema(description = "结算币种", example = "2")
|
||||
private String currencyType;
|
||||
|
||||
@Schema(description = "订单状态", example = "2")
|
||||
private Integer orderStatus;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ public interface SaleOrderConvert {
|
|||
@Mapping(source = "invoiceCode", target = "invoiceCode"),
|
||||
@Mapping(source = "invoiceName", target = "invoiceName"),
|
||||
@Mapping(source = "address", target = "address"),
|
||||
@Mapping(source = "emails", target = "emails")
|
||||
@Mapping(source = "emails", target = "emails"),
|
||||
@Mapping(source = "contractType", target = "contractType"),
|
||||
@Mapping(source = "currencyType", target = "currencyType")
|
||||
})
|
||||
SaleOrderRespVO convert(SaleOrderDO bean);
|
||||
|
||||
|
|
|
|||
|
|
@ -164,6 +164,16 @@ public class SaleOrderDO extends BaseDO {
|
|||
*/
|
||||
private String orderFollowerUser;
|
||||
|
||||
/**
|
||||
* 合约类型
|
||||
*/
|
||||
private String contractType;
|
||||
|
||||
/**
|
||||
* 结算币种
|
||||
*/
|
||||
private String currencyType;
|
||||
|
||||
public SaleOrderDO(CreateSaleOrderDTO dto) {
|
||||
BeanUtil.copyProperties(dto, this,"bizdate","plansenddate");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
// 返回
|
||||
|
|
@ -76,10 +81,12 @@ public class ProduceOrderServiceImpl implements ProduceOrderService {
|
|||
Double specSizeWidth = productInfo.getSpecSizeWidth();
|
||||
Double specSizeHeight = productInfo.getSpecSizeHeight();
|
||||
String specMaterial = productInfo.getSpecMaterial();
|
||||
String productionInfo = productInfo.getProductionInfo();
|
||||
StringBuffer str = new StringBuffer();
|
||||
str.append(String.format("货名:%s\r\n",productInfo.getName()));
|
||||
/* str.append(String.format("货名:%s\r\n",productInfo.getName()));
|
||||
str.append(String.format("规格:%s × %s \r\n",specSizeWidth,specSizeHeight));
|
||||
str.append(String.format("纸质:%s \r\n",specMaterial));
|
||||
str.append(String.format("纸质:%s \r\n",specMaterial));*/;
|
||||
str.append(String.format("%s ",productionInfo));
|
||||
updateObj.setDetails(str.toString());
|
||||
|
||||
produceOrderMapper.updateById(updateObj);
|
||||
|
|
|
|||
|
|
@ -160,6 +160,12 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
// 插入
|
||||
SaleOrderDO saleOrder = BeanUtils.toBean(createReqVO, SaleOrderDO.class);
|
||||
saleOrder.setOrderStatus(SaleOrderStatusEnum.YXD.getValue());
|
||||
List<SaleOrderEntryDO> entrys = createReqVO.getEntrys();
|
||||
String currency = null;
|
||||
if(entrys!=null&&entrys.size()>0){
|
||||
currency = entrys.get(0).getCurrency();
|
||||
}
|
||||
saleOrder.setCurrency(currency);
|
||||
saleOrderMapper.insert(saleOrder);
|
||||
// 插入子表
|
||||
createSaleOrderEntryList(saleOrder.getId(), createReqVO.getEntrys());
|
||||
|
|
@ -322,8 +328,15 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
case "audit": //审核
|
||||
for (SaleOrderDO saleOrder : saleOrders) {
|
||||
if (BillStatusEnum.SUBMIT.getValue().equals(saleOrder.getBillStatus())) {
|
||||
|
||||
List<SaleOrderEntryDO> entrys = getSaleOrderEntryListByParentId(saleOrder.getId());
|
||||
String contractType = saleOrder.getContractType();
|
||||
String currencyType = saleOrder.getCurrencyType();
|
||||
if(StringUtils.isBlank(contractType)){
|
||||
throw new ServiceException(001, "合约类型不允许为空!");
|
||||
}
|
||||
if(StringUtils.isBlank(currencyType)){
|
||||
throw new ServiceException(001, "结算币种不允许为空!");
|
||||
}
|
||||
if (entrys == null || entrys.isEmpty()) {
|
||||
throw new ServiceException(001, "产品明细为空");
|
||||
}
|
||||
|
|
@ -439,7 +452,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
ProductInfoDO productInfo = productInfoService.getProductInfo(entry.getMaterialId());
|
||||
ProduceOrderSaveReqVO saveReqVO = new ProduceOrderSaveReqVO();
|
||||
saveReqVO.setOrderNo(saleOrder.getBillno());
|
||||
saveReqVO.setSaleContractNo(saleOrder.getBillno());
|
||||
saveReqVO.setSaleContractNo(saleOrder.getContractCode());
|
||||
saveReqVO.setCustomerId(customer.getId());
|
||||
saveReqVO.setCustomerCode(customer.getNumber());
|
||||
saveReqVO.setProductId(entry.getMaterialId());
|
||||
|
|
@ -978,6 +991,10 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
if (FuncUtil.isEmpty(billno)) {
|
||||
billno = getNewContractCode2();
|
||||
}
|
||||
String contractType = saleOrder.getContractType();
|
||||
if(StringUtils.isNotBlank(contractType)){
|
||||
billno = billno.replace("XSHY-",contractType+"-");
|
||||
}
|
||||
saveReqVO.setBillno(billno);
|
||||
saveReqVO.setCustomerId(saleOrder.getCustomerId());
|
||||
saveReqVO.setCustomerName(customer.getName());
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@
|
|||
<th style="width: 5%;text-align: center;">数量</th>
|
||||
<th style="width: 8%;text-align: center;">单位订价RMB</th>
|
||||
<th style="width: 5%;text-align: center;">折扣%</th>
|
||||
<th style="width: 7%;text-align: center;">金额RMB</th>
|
||||
<th style="width: 7%;text-align: center;">金额<span th:text="${currencyType}"></span></th>
|
||||
<th style="width: 7%;text-align: center;">交货日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -252,7 +252,7 @@
|
|||
<span
|
||||
style="font-weight: bold;font-size: 16px; padding: 8px 0px 8px 0px;border-top: 1px solid #dddddd;border-bottom: 2px solid #dddddd;">
|
||||
|
||||
<span style="margin-right: 80px;">RMB</span>
|
||||
<span style="margin-right: 80px;" th:text="${currencyType}">RMB</span>
|
||||
<span th:text="${totalAmount}">XXXXXXXxXX</span>
|
||||
</span>
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package cn.hangtag.module.system.controller.admin.auth.vo;
|
||||
|
||||
import cn.hangtag.framework.common.validation.Email;
|
||||
import cn.hangtag.framework.common.validation.Mobile;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -9,6 +8,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 邮箱验证码的重置密码 Request VO")
|
||||
@Data
|
||||
|
|
@ -35,7 +35,7 @@ public class AuthMailModifyPwdReqVO {
|
|||
private String code;
|
||||
|
||||
@Schema(description = "账户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotEmpty(message = "账户类型不能为空")
|
||||
@NotNull(message = "账户类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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', //合约类型
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ import startPreview from "./components/preview.vue"
|
|||
import {dateUtil} from "@/utils/dateUtil";
|
||||
import {dateFormatter, formatDate} from '@/utils/formatTime'
|
||||
import ProductInfoListDialog from "@/components/Dialog/src/ProductInfoListDialog/index.vue";
|
||||
import {ProductInfoApi} from "@/api/oms/productinfo";
|
||||
|
||||
|
||||
/** 生产制单 表单 */
|
||||
|
|
@ -306,6 +307,7 @@ const downpdf = async () => {
|
|||
if (id) {
|
||||
formData.value = await ProduceOrderApi.getProduceOrder(id)
|
||||
}
|
||||
|
||||
//日期转换
|
||||
formData.value.contractDateStr = formatDate(formData.value.contractDate,'YYYY-MM-DD')
|
||||
formData.value.reportDateStr = formatDate(formData.value.reportDate,'YYYY-MM-DD')
|
||||
|
|
@ -315,6 +317,17 @@ const downpdf = async () => {
|
|||
formData.value.deliverydateStr = formatDate(formData.value.deliverydate,'YYYY-MM-DD')
|
||||
//formData.value.saleContractNo = formData.value.orderNo
|
||||
|
||||
if(formData.value.productId){
|
||||
const material = await ProductInfoApi.getProductInfo(formData.value.productId)
|
||||
formData.value.productCode = material.code
|
||||
formData.value.productName = material.name
|
||||
formData.value.details = material.productionInfo
|
||||
}else {
|
||||
formData.value.productCode = ''
|
||||
formData.value.productName = ''
|
||||
formData.value.details = ''
|
||||
}
|
||||
|
||||
let printData = JSON.stringify(formData.value)
|
||||
printData = JSON.parse(printData)
|
||||
let hiprintTemplate = new hiprint.PrintTemplate({template: template1});
|
||||
|
|
@ -345,6 +358,19 @@ const preview = async () => {
|
|||
formData.value.deliverydateStr = formatDate(formData.value.deliverydate,'YYYY-MM-DD')
|
||||
//formData.value.saleContractNo = formData.value.orderNo
|
||||
|
||||
if(formData.value.productId){
|
||||
const material = await ProductInfoApi.getProductInfo(formData.value.productId)
|
||||
formData.value.productCode = material.code
|
||||
formData.value.productName = material.name
|
||||
formData.value.details = material.productionInfo
|
||||
}else {
|
||||
formData.value.productCode = ''
|
||||
formData.value.productName = ''
|
||||
formData.value.details = ''
|
||||
}
|
||||
|
||||
|
||||
|
||||
let printData = JSON.stringify(formData.value)
|
||||
printData = JSON.parse(printData)
|
||||
let hiprintTemplate = new hiprint.PrintTemplate({template: template1});
|
||||
|
|
|
|||
|
|
@ -408,14 +408,14 @@ export default {
|
|||
{
|
||||
"options": {
|
||||
"left": 474,
|
||||
"top": 177,
|
||||
"top": 187.5,
|
||||
"height": 9.75,
|
||||
"width": 120,
|
||||
"title": "数量",
|
||||
"right": 574.5,
|
||||
"bottom": 131.25,
|
||||
"vCenter": 514.5,
|
||||
"hCenter": 126.375,
|
||||
"right": 593.9926071166992,
|
||||
"bottom": 186.7401351928711,
|
||||
"vCenter": 533.9926071166992,
|
||||
"hCenter": 181.8651351928711,
|
||||
"field": "deliveryQty",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
|
|
|
|||
|
|
@ -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