|
@@ -132,6 +132,7 @@ const transferValue = ref('')
|
|
|
const transferOptions = ref<personnelInterface[]>([])
|
|
|
const generateFormValue = ref({})
|
|
|
const generateForm = ref<typeof GenerateForm>() // 自定义表单dom
|
|
|
+const productTableListValue = ref<any[]>([])
|
|
|
const contactsId = ref('')
|
|
|
const contactsList = ref<optionType[]>([])
|
|
|
const allVisible = reactive({
|
|
@@ -196,17 +197,16 @@ function transferBusiness() {
|
|
|
|
|
|
function claimBusiness() {
|
|
|
confirmAction(`确定认领【${information.value.name}】商机吗?`).then(() => {
|
|
|
- console.log('执行认领')
|
|
|
+ transferBusiness()
|
|
|
})
|
|
|
}
|
|
|
|
|
|
function editBusiness() {
|
|
|
- console.log('点击了保存')
|
|
|
- return
|
|
|
generateForm.value?.getData().then((res: any) => {
|
|
|
let formVal = {
|
|
|
...res,
|
|
|
expectedTransactionDate: res.expectedTransactionDate ? formatDateTime(new Date(res.expectedTransactionDate)) : '',
|
|
|
+ businessItemProductList: JSON.stringify(productTableListValue.value)
|
|
|
}
|
|
|
allLoading.businessSaveLading = true
|
|
|
post(UPDATEINSET, { ...formVal }).then((_res) => {
|
|
@@ -222,10 +222,23 @@ function editBusiness() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+function editProductShow() {
|
|
|
+ const productList = information.value.businessItemProducts || []
|
|
|
+ const list = productList.map((item: any) => {
|
|
|
+ const { id, productName, productId, productCode, unit, unitName, typeName, type, price, inventory, orderProductDetail, num, discount, sealPrice, totalPrice, quantity } = item
|
|
|
+ return {
|
|
|
+ id, productId: productId, productName, productCode, unit, unitName, typeName, type, price, inventory,
|
|
|
+ num, discount, sealPrice, totalPrice, quantity
|
|
|
+ }
|
|
|
+ })
|
|
|
+ productTableListValue.value = list
|
|
|
+}
|
|
|
+
|
|
|
function showVisible(type: keyof typeof allVisible) {
|
|
|
if (type == 'editBusinessVisible') {
|
|
|
const { name, customerId, contactsId, amountOfMoney, expectedTransactionDate, stageId, inchargerId, remark } = information.value
|
|
|
generateFormValue.value = { name, customerId, contactsId, amountOfMoney, expectedTransactionDate, stageId, inchargerId, remark }
|
|
|
+ editProductShow()
|
|
|
}
|
|
|
allVisible[type] = true
|
|
|
}
|