|
@@ -7,9 +7,10 @@ import RemoteSelect from "/@/components/RemoteSelect";
|
|
|
import InvoiceTitle from "./InvoiceTitle.vue";
|
|
|
import { rules } from "./rules"
|
|
|
|
|
|
-import { NumberInput } from "/@/components/Input"
|
|
|
+import { UnitInput } from "/@/components/Input"
|
|
|
+
|
|
|
+import { convertInvoiceTitle, convertInvoiceTitleData, convertPurchaseInvoiceTitleData, createInitalData } from "./shared"
|
|
|
|
|
|
-import { convertInvoiceTitle, convertInvoiceTitleData, createInitalData } from "./shared"
|
|
|
import { useTask } from "/@/hooks/core"
|
|
|
import { useRouter } from "vue-router"
|
|
|
|
|
@@ -20,6 +21,7 @@ import ChildGoodEditModal from "./ChildGoodEditModal.vue";
|
|
|
import { httpInvoiceList } from "/@/api/InvoiceSales/invoiceApply";
|
|
|
import { httpAdd, httpCatist } from "/@/api/invoiceInOut/productManager";
|
|
|
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
|
|
+import QueryCategory from "./query-category.vue";
|
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
@@ -63,9 +65,10 @@ async function submit(){
|
|
|
}
|
|
|
|
|
|
function handleInvoiceTitle(_isSeller: boolean, invoiceTitle: Record<string, string> ) {
|
|
|
- if (_isSeller) {
|
|
|
- invoiceTitle = state.companies.find(item => item.company_license === formData.value.seller_code)
|
|
|
- formData.value.seller_name = invoiceTitle.company_name
|
|
|
+ if (!_isSeller) {
|
|
|
+ invoiceTitle = state.companies.find(item => item.company_license === formData.value.buyer_code)
|
|
|
+ formData.value.buyer_name = invoiceTitle.company_name
|
|
|
+ // formData.value.seller_code = invoiceTitle.company_name
|
|
|
//支持的开票方式
|
|
|
// const { invoiceType, denomination: _denomination } = invoiceTitle;
|
|
|
// const chunks = invoiceType.split(",");
|
|
@@ -73,7 +76,7 @@ function handleInvoiceTitle(_isSeller: boolean, invoiceTitle: Record<string, str
|
|
|
// invoiceTypes.value = xs_inv_type_list.filter(({ value }) => chunks.includes(value));
|
|
|
// formData.value.seller_name =
|
|
|
} else{
|
|
|
- formData.value.buyer_name = invoiceTitle.invoice_title
|
|
|
+ formData.value.seller_name = invoiceTitle.name
|
|
|
}
|
|
|
|
|
|
if (!invoiceTitle) {
|
|
@@ -83,7 +86,7 @@ function handleInvoiceTitle(_isSeller: boolean, invoiceTitle: Record<string, str
|
|
|
|
|
|
_isSeller
|
|
|
? (sellerInvoiceTitle.value = convertInvoiceTitleData(convertInvoiceTitle(invoiceTitle)))
|
|
|
- : (purchaserInvoiceTitle.value = convertInvoiceTitleData(invoiceTitle));
|
|
|
+ : (purchaserInvoiceTitle.value = convertPurchaseInvoiceTitleData(invoiceTitle));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -129,11 +132,29 @@ function handleChildGoodEdit(index: number){
|
|
|
<ElRow :gutter="10">
|
|
|
<ElCol :span="12">
|
|
|
<ElFormItem label="销售方公司" prop="seller_code">
|
|
|
+ <RemoteSelect
|
|
|
+ style="width: 100%"
|
|
|
+ request-prop="name"
|
|
|
+ :api="httpInvoiceList"
|
|
|
+ response-val-prop="registercode"
|
|
|
+ placeholder="销售方公司抬头"
|
|
|
+ v-model:value="formData.seller_code"
|
|
|
+ response-label-prop="name"
|
|
|
+ @item-change="setSellerInvoiceTitle"
|
|
|
+ />
|
|
|
+ </ElFormItem>
|
|
|
+
|
|
|
+ <InvoiceTitle :detail="sellerInvoiceTitle" />
|
|
|
+ </ElCol>
|
|
|
+
|
|
|
+
|
|
|
+ <ElCol :span="12">
|
|
|
+ <ElFormItem label="购买方公司" prop="buyer_code">
|
|
|
<ElSelect
|
|
|
style="width: 100%"
|
|
|
- placeholder="销售方公司"
|
|
|
- v-model="formData.seller_code"
|
|
|
- @change="setSellerInvoiceTitle"
|
|
|
+ placeholder="购买方公司"
|
|
|
+ v-model="formData.buyer_code"
|
|
|
+ @change="setPurchaserInvoiceTitle"
|
|
|
>
|
|
|
<ElOption
|
|
|
v-for="item in state.companies"
|
|
@@ -142,28 +163,11 @@ function handleChildGoodEdit(index: number){
|
|
|
/>
|
|
|
</ElSelect>
|
|
|
</ElFormItem>
|
|
|
- <InvoiceTitle :detail="sellerInvoiceTitle" />
|
|
|
- </ElCol>
|
|
|
|
|
|
- <ElCol :span="12">
|
|
|
- <ElFormItem label="购买方公司" prop="buyer_code">
|
|
|
- <RemoteSelect
|
|
|
- is-root
|
|
|
- style="width: 100%"
|
|
|
- request-prop="name"
|
|
|
- :api="httpInvoiceList"
|
|
|
- response-val-prop="invoice_code"
|
|
|
- placeholder="购买方公司抬头"
|
|
|
- v-model:value="formData.buyer_code"
|
|
|
- response-label-prop="invoice_title"
|
|
|
- @item-change="setPurchaserInvoiceTitle"
|
|
|
- />
|
|
|
- </ElFormItem>
|
|
|
<InvoiceTitle :detail="purchaserInvoiceTitle" />
|
|
|
</ElCol>
|
|
|
|
|
|
-
|
|
|
- <ElCol :span="8">
|
|
|
+ <ElCol :span="6">
|
|
|
<ElFormItem label="商品来源" prop="good_source">
|
|
|
<ElSelect
|
|
|
@change="formData.good_code = ''"
|
|
@@ -177,13 +181,17 @@ function handleChildGoodEdit(index: number){
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
- <ElFormItem label="商品编号" prop="skuCode">
|
|
|
- <ElInput v-model="formData.skuCode" placeholder="商品编号" />
|
|
|
+ <ElCol :span="6">
|
|
|
+ <ElFormItem label="组合类型" prop="is_combind">
|
|
|
+ <ElSelect style="width: 100%" v-model="formData.is_combind">
|
|
|
+ <ElOption label="非组合商品" value="0" />
|
|
|
+ <ElOption label="组合商品" value="1" />
|
|
|
+ </ElSelect>
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
+
|
|
|
+ <ElCol :span="6">
|
|
|
<ElFormItem label="订单商品类型" prop="good_type">
|
|
|
<ElSelect
|
|
|
v-model="formData.good_type"
|
|
@@ -199,77 +207,69 @@ function handleChildGoodEdit(index: number){
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
- <ElFormItem label="组合类型" prop="is_combind">
|
|
|
- <ElSelect style="width: 100%" v-model="formData.is_combind">
|
|
|
- <ElOption label="非组合商品" value="0" />
|
|
|
- <ElOption label="组合商品" value="1" />
|
|
|
+
|
|
|
+ <ElCol :span="6">
|
|
|
+ <ElFormItem label="进项成本状态" prop="basic_status">
|
|
|
+ <ElSelect
|
|
|
+ v-model="formData.basic_status"
|
|
|
+ placeholder="进项成本状态"
|
|
|
+ >
|
|
|
+ <ElOption label="真实成本信息" value="1" />
|
|
|
+ <ElOption label="预估成本信息" value="2" />
|
|
|
</ElSelect>
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
- <ElFormItem label="订单商品名称" prop="goodName">
|
|
|
- <ElInput v-model="formData.goodName" placeholder="订单商品名称" />
|
|
|
- </ElFormItem>
|
|
|
- </ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
+
|
|
|
+
|
|
|
+ <ElCol :span="12">
|
|
|
<ElFormItem label="发票商品名称" prop="inv_good_name">
|
|
|
<ElInput v-model="formData.inv_good_name" placeholder="发票商品名称" />
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
- <ElFormItem label="规格" prop="spec">
|
|
|
- <ElInput v-model="formData.spec" placeholder="规格" />
|
|
|
- </ElFormItem>
|
|
|
- </ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
- <ElFormItem label="商品代码" prop="good_code">
|
|
|
- <ElInput v-model="formData.good_code" placeholder="商品代码" />
|
|
|
+ <ElCol :span="12">
|
|
|
+ <ElFormItem label="订单商品名称" prop="goodName">
|
|
|
+ <ElInput v-model="formData.goodName" placeholder="订单商品名称" />
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
- <ElFormItem label="成本税前单价" prop="unit_price">
|
|
|
- <NumberInput v-model="formData.unit_price" placeholder="成本税前单价" />
|
|
|
+
|
|
|
+ <ElCol :span="6">
|
|
|
+ <ElFormItem label="商品编号" prop="skuCode">
|
|
|
+ <ElInput v-model="formData.skuCode" placeholder="商品编号" />
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
+
|
|
|
+ <ElCol :span="6">
|
|
|
<ElFormItem label="单位" prop="unit">
|
|
|
<ElInput v-model="formData.unit" placeholder="单位" />
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
- <ElFormItem label="重量" prop="unit_weight">
|
|
|
- <ElInput v-model="formData.unit_weight" placeholder="重量" />
|
|
|
- </ElFormItem>
|
|
|
- </ElCol>
|
|
|
|
|
|
- <ElCol :span="8">
|
|
|
- <ElFormItem label="成本税后单价" prop="subunit_price">
|
|
|
- <NumberInput
|
|
|
- v-model="formData.subunit_price"
|
|
|
- placeholder="成本税后单价"
|
|
|
- />
|
|
|
+ <ElCol :span="6">
|
|
|
+ <ElFormItem label="规格" prop="spec">
|
|
|
+ <ElInput v-model="formData.spec" placeholder="规格" />
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
- <ElCol :span="6">
|
|
|
- <ElFormItem label="分光" prop="spectral">
|
|
|
- <ElInput
|
|
|
- v-model="formData.spectral"
|
|
|
- placeholder="分光"
|
|
|
- style="width: 100%"
|
|
|
- />
|
|
|
+ <ElCol :span="6">
|
|
|
+ <ElFormItem label="重量" prop="unit_weight">
|
|
|
+ <ElInput v-model="formData.unit_weight" placeholder="重量" />
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
+
|
|
|
|
|
|
- <ElCol :span="6">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <ElCol :span="6">
|
|
|
<ElFormItem label="发票类型" prop="inv_type">
|
|
|
<ElSelect
|
|
|
v-model="formData.inv_type"
|
|
@@ -285,17 +285,34 @@ function handleChildGoodEdit(index: number){
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
|
|
|
+ <ElCol :span="6">
|
|
|
+ <ElFormItem label="成本税前单价" prop="unit_price">
|
|
|
+ <UnitInput unit="元" v-model="formData.unit_price" placeholder="成本税前单价" />
|
|
|
+ </ElFormItem>
|
|
|
+ </ElCol>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <ElCol :span="6">
|
|
|
+ <ElFormItem label="成本税后单价" prop="subunit_price">
|
|
|
+ <UnitInput
|
|
|
+ unit="元"
|
|
|
+ v-model="formData.subunit_price"
|
|
|
+ placeholder="成本税后单价"
|
|
|
+ />
|
|
|
+ </ElFormItem>
|
|
|
+ </ElCol>
|
|
|
+
|
|
|
+
|
|
|
<ElCol :span="6">
|
|
|
+ <ElFormItem label="商品代码" prop="good_code">
|
|
|
+ <ElInput v-model="formData.good_code" placeholder="商品代码" />
|
|
|
+ </ElFormItem>
|
|
|
+ </ElCol>
|
|
|
+
|
|
|
+ <ElCol :span="12">
|
|
|
<ElFormItem label="进项税目" prop="cat_code">
|
|
|
- <RemoteSelect
|
|
|
- :api="httpCatist"
|
|
|
- style="width: 100%"
|
|
|
- request-prop="cat_name"
|
|
|
- placeholder="进项税目"
|
|
|
- response-val-prop="cat_code"
|
|
|
- response-label-prop="cat_name"
|
|
|
- v-model:value="formData.cat_code"
|
|
|
- />
|
|
|
+ <QueryCategory v-model="formData.cat_code" />
|
|
|
<!-- <ElInput v-model="formData.cat_code" placeholder="进项税目" /> -->
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
@@ -309,14 +326,12 @@ function handleChildGoodEdit(index: number){
|
|
|
</ElCol>
|
|
|
|
|
|
<ElCol :span="6">
|
|
|
- <ElFormItem label="进项成本状态" prop="basic_status">
|
|
|
- <ElSelect
|
|
|
- v-model="formData.basic_status"
|
|
|
- placeholder="进项成本状态"
|
|
|
- >
|
|
|
- <ElOption label="真实成本信息" value="1" />
|
|
|
- <ElOption label="预估成本信息" value="2" />
|
|
|
- </ElSelect>
|
|
|
+ <ElFormItem label="分光" prop="spectral">
|
|
|
+ <ElInput
|
|
|
+ v-model="formData.spectral"
|
|
|
+ placeholder="分光"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
</ElFormItem>
|
|
|
</ElCol>
|
|
|
</ElRow>
|