|
@@ -186,18 +186,14 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
- <a-form-item
|
|
|
|
- label="汇率(exchange rate)"
|
|
|
|
- v-bind="validateInfos.exchangeRate"
|
|
|
|
- id="PurchaseOrderFormModal-exchangeRate"
|
|
|
|
- name="exchangeRate"
|
|
|
|
- >
|
|
|
|
- <a-input v-model:value="formData.exchangeRate" placeholder="请输入" allow-clear AutoComplete="off" disabled />
|
|
|
|
|
|
+
|
|
|
|
+ <a-form-item label="采购员(purchasesman)" v-bind="validateInfos.purchaseman" id="PurchaseOrderFormModal-purchaseman" name="purchaseman">
|
|
|
|
+ <a-input v-model:value="formData.purchasemanName" placeholder="请输入采购员(salesman)" allow-clear disabled />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
<a-form-item label="币种(currency)" v-bind="validateInfos.currency" id="PurchaseOrderFormModal-currency" name="currency">
|
|
<a-form-item label="币种(currency)" v-bind="validateInfos.currency" id="PurchaseOrderFormModal-currency" name="currency">
|
|
- <JDictSelectTag :disabled="!hasPermission('purCode:pur_order:editBz')" v-model:value="formData.currency" placeholder="请选择" dictCode="currency" @change="handleChangeCurrency" />
|
|
|
|
|
|
+ <JDictSelectTag :disabled="!hasPermission('purCode:pur_order:editBZ')" :showChooseOption='false' v-model:value="formData.currency" dictCode="currency" @change="handleChangeCurrency" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
@@ -211,9 +207,14 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
- <a-form-item label="采购员(purchasesman)" v-bind="validateInfos.purchaseman" id="PurchaseOrderFormModal-purchaseman" name="purchaseman">
|
|
|
|
- <a-input v-model:value="formData.purchasemanName" placeholder="请输入采购员(salesman)" allow-clear disabled />
|
|
|
|
- </a-form-item>
|
|
|
|
|
|
+ <a-form-item
|
|
|
|
+ label="汇率(exchange rate)"
|
|
|
|
+ v-bind="validateInfos.exchangeRate"
|
|
|
|
+ id="PurchaseOrderFormModal-exchangeRate"
|
|
|
|
+ name="exchangeRate"
|
|
|
|
+ >
|
|
|
|
+ <a-input v-model:value="formData.exchangeRate" placeholder="请输入" allow-clear AutoComplete="off" disabled />
|
|
|
|
+ </a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
<a-form-item
|
|
<a-form-item
|
|
@@ -304,6 +305,11 @@
|
|
:disabled="disabled || formData.sourceCode2 !== ''"
|
|
:disabled="disabled || formData.sourceCode2 !== ''"
|
|
>选择供应商报价选定(select supplier quotation selection)</a-button
|
|
>选择供应商报价选定(select supplier quotation selection)</a-button
|
|
>
|
|
>
|
|
|
|
+ <a-button @click="showModal"
|
|
|
|
+ type="primary" danger
|
|
|
|
+ style="margin-right: 1%; margin-bottom: 1%"
|
|
|
|
+ >变更报价(Change quotation)</a-button
|
|
|
|
+ >
|
|
<j-vxe-table
|
|
<j-vxe-table
|
|
:keep-source="true"
|
|
:keep-source="true"
|
|
resizable
|
|
resizable
|
|
@@ -348,6 +354,11 @@
|
|
<SelectSaleOrderModal ref="SelectSaleOrderModalRef" @select-sale-order="addFormSaleOrder" />
|
|
<SelectSaleOrderModal ref="SelectSaleOrderModalRef" @select-sale-order="addFormSaleOrder" />
|
|
<SelectSupplierQuotation ref="SelectSupplierQuotationRef" @select-supplier-quatation-confirm="addFromQuotation" />
|
|
<SelectSupplierQuotation ref="SelectSupplierQuotationRef" @select-supplier-quatation-confirm="addFromQuotation" />
|
|
</a-spin>
|
|
</a-spin>
|
|
|
|
+ <a-modal v-model:visible="modalVisible" title="请输入报价选定单号(注:该操作无法撤回)" @ok="chooseQuote" :confirm-loading="confirmLoading"
|
|
|
|
+ :mask-closable="false"
|
|
|
|
+ :keyboard="false">
|
|
|
|
+ <a-input v-model:value="inputValue" placeholder="请输入报价选定单号"/>
|
|
|
|
+ </a-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
@@ -419,6 +430,58 @@
|
|
const SelectSupplierQuotationRef = ref();
|
|
const SelectSupplierQuotationRef = ref();
|
|
const BaseShipArchiveAccessoriesModalRef = ref();
|
|
const BaseShipArchiveAccessoriesModalRef = ref();
|
|
const SelectSaleOrderModalRef = ref();
|
|
const SelectSaleOrderModalRef = ref();
|
|
|
|
+
|
|
|
|
+ const modalVisible = ref(false);
|
|
|
|
+ const confirmLoading = ref(false);
|
|
|
|
+ const inputValue = ref('');
|
|
|
|
+
|
|
|
|
+ const showModal = () => {
|
|
|
|
+ modalVisible.value = true;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const chooseQuote = () => {
|
|
|
|
+
|
|
|
|
+ if(inputValue.value == '' || inputValue.value == null){
|
|
|
|
+ message.error('请输入新的报价选定单号');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ confirmLoading.value = true; // 启用加载状态
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ let params = { id: formData.id,code: inputValue.value,project:formData.project };
|
|
|
|
+ let url = '/purCode/purQuotationSelection/purQuotationSelectionProductBy';
|
|
|
|
+
|
|
|
|
+ defHttp.get({ url: url, params }, { isTransformResponse: false }).then((res) => {
|
|
|
|
+ console.log(res.success)
|
|
|
|
+ if (res.success) {
|
|
|
|
+
|
|
|
|
+ const row = res.result;
|
|
|
|
+
|
|
|
|
+ resetFields();
|
|
|
|
+ const tmpData = {};
|
|
|
|
+ Object.keys(formData).forEach((key) => {
|
|
|
|
+ if (row.hasOwnProperty(key)) {
|
|
|
|
+ tmpData[key] = row[key];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //赋值
|
|
|
|
+ Object.assign(formData, tmpData);
|
|
|
|
+ purOrderFormShipFormProductTable.dataSource = res.result.purOrderProductList;
|
|
|
|
+ }else{
|
|
|
|
+
|
|
|
|
+ message.error(res.message);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ } finally {
|
|
|
|
+ inputValue.value = '';
|
|
|
|
+ confirmLoading.value = false; // 无论成功失败都关闭加载
|
|
|
|
+ modalVisible.value = false;
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
const PurOrderFormShipFormShipTable = reactive<Record<string, any>>({
|
|
const PurOrderFormShipFormShipTable = reactive<Record<string, any>>({
|
|
loading: false,
|
|
loading: false,
|
|
columns: purchaseOrderShipColumns,
|
|
columns: purchaseOrderShipColumns,
|
|
@@ -438,6 +501,7 @@
|
|
delFlag: undefined,
|
|
delFlag: undefined,
|
|
sourceCode: '',
|
|
sourceCode: '',
|
|
sourceCode2: '',
|
|
sourceCode2: '',
|
|
|
|
+ changeSourceCode: '',
|
|
submit: undefined,
|
|
submit: undefined,
|
|
organize: '',
|
|
organize: '',
|
|
billCode: '',
|
|
billCode: '',
|
|
@@ -478,6 +542,8 @@
|
|
//表单验证
|
|
//表单验证
|
|
const validatorRules = reactive({
|
|
const validatorRules = reactive({
|
|
projectName: [{ required: true, message: '请选择报价项目(select project)' }],
|
|
projectName: [{ required: true, message: '请选择报价项目(select project)' }],
|
|
|
|
+ currency: [{ required: true, message: '请选择币种(select currency)' }],
|
|
|
|
+ exchangeRate: [{ required: true, message: '请维护本月税率' }],
|
|
organize: [{ required: true, message: '请选择组织(select organize)' }],
|
|
organize: [{ required: true, message: '请选择组织(select organize)' }],
|
|
// currency:[
|
|
// currency:[
|
|
// { required: true, message: '请选择币种(currency)' }
|
|
// { required: true, message: '请选择币种(currency)' }
|
|
@@ -523,6 +589,7 @@
|
|
formData.submit = undefined;
|
|
formData.submit = undefined;
|
|
formData.sourceCode = '';
|
|
formData.sourceCode = '';
|
|
formData.sourceCode2 = '';
|
|
formData.sourceCode2 = '';
|
|
|
|
+ formData.changeSourceCode = '';
|
|
formData.project = '';
|
|
formData.project = '';
|
|
formData.projectName = '';
|
|
formData.projectName = '';
|
|
//子表数据
|
|
//子表数据
|
|
@@ -892,7 +959,8 @@
|
|
// 监听币种变化,获取汇率
|
|
// 监听币种变化,获取汇率
|
|
watch(() => formData.currency,
|
|
watch(() => formData.currency,
|
|
async (newVal, oldVal) => {
|
|
async (newVal, oldVal) => {
|
|
- if (newVal && newVal !== oldVal) {
|
|
|
|
|
|
+
|
|
|
|
+ if (newVal && newVal !== oldVal && oldVal!=null && oldVal!='') {
|
|
// setExchangeRate();
|
|
// setExchangeRate();
|
|
await handleChangeCurrency(newVal, oldVal);
|
|
await handleChangeCurrency(newVal, oldVal);
|
|
}
|
|
}
|
|
@@ -905,13 +973,19 @@
|
|
const currentCurrency = formData.currency;
|
|
const currentCurrency = formData.currency;
|
|
if (currentCurrency && newDate !== oldDate) {
|
|
if (currentCurrency && newDate !== oldDate) {
|
|
// 保留当前币种不变,但重新获取汇率并刷新子表
|
|
// 保留当前币种不变,但重新获取汇率并刷新子表
|
|
|
|
+
|
|
await handleChangeCurrency(currentCurrency, currentCurrency);
|
|
await handleChangeCurrency(currentCurrency, currentCurrency);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{ immediate: false }
|
|
{ immediate: false }
|
|
);
|
|
);
|
|
async function handleChangeCurrency (newCurrency?: string, oldCurrency?: string) {
|
|
async function handleChangeCurrency (newCurrency?: string, oldCurrency?: string) {
|
|
- if (!newCurrency || !oldCurrency) return;
|
|
|
|
|
|
+ if (!newCurrency || !oldCurrency){
|
|
|
|
+
|
|
|
|
+ console.log(33333333333)
|
|
|
|
+ formData.exchangeRate = '';
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
|
|
const date = moment(formData.billDate);
|
|
const date = moment(formData.billDate);
|
|
const year = date.format('YYYY');
|
|
const year = date.format('YYYY');
|
|
@@ -920,9 +994,18 @@
|
|
try {
|
|
try {
|
|
// 获取旧币种汇率(原币种)与 新币种汇率(新币种),并展示新币种汇率
|
|
// 获取旧币种汇率(原币种)与 新币种汇率(新币种),并展示新币种汇率
|
|
const oldRateRes = await getExchangeRate({ year, month, currency: oldCurrency });
|
|
const oldRateRes = await getExchangeRate({ year, month, currency: oldCurrency });
|
|
- const oldExchangeRate = parseFloat(oldRateRes || '1');
|
|
|
|
|
|
+ const oldExchangeRate = parseFloat(oldRateRes || '0');
|
|
|
|
+ if(oldExchangeRate == 0){
|
|
|
|
+ formData.exchangeRate = '';
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const newRateRes = await getExchangeRate({ year, month, currency: newCurrency });
|
|
const newRateRes = await getExchangeRate({ year, month, currency: newCurrency });
|
|
- const newExchangeRate = parseFloat(newRateRes || '1');
|
|
|
|
|
|
+ const newExchangeRate = parseFloat(newRateRes || '0');
|
|
|
|
+ if(newExchangeRate == 0){
|
|
|
|
+ formData.exchangeRate = '';
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
formData.exchangeRate = isNaN(newExchangeRate) ? '' : newExchangeRate;
|
|
formData.exchangeRate = isNaN(newExchangeRate) ? '' : newExchangeRate;
|
|
purOrderFormShipFormProductTable.dataSource = purOrderFormShipFormProductTable.dataSource.map(item => {
|
|
purOrderFormShipFormProductTable.dataSource = purOrderFormShipFormProductTable.dataSource.map(item => {
|
|
const originalTaxPriceOriginal = item.taxPriceOriginal;
|
|
const originalTaxPriceOriginal = item.taxPriceOriginal;
|
|
@@ -994,6 +1077,11 @@
|
|
SelectSupplierQuotationList,
|
|
SelectSupplierQuotationList,
|
|
addFromQuotation,
|
|
addFromQuotation,
|
|
handleChangeCurrency,
|
|
handleChangeCurrency,
|
|
|
|
+ showModal,
|
|
|
|
+ modalVisible,
|
|
|
|
+ inputValue,
|
|
|
|
+ chooseQuote,
|
|
|
|
+ confirmLoading,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
});
|
|
});
|