gaoluyang
6 天以前 c7f171da70f6e7362eaa69ddcf0a65828bb7fa1b
src/views/salesOutbound/components/formDia.vue
@@ -22,9 +22,9 @@
              <el-select v-model="form.customerId" placeholder="请选择客户">
                <el-option
                    v-for="item in customerOptions"
                    :key="item.id"
                    :label="item.customerName"
                    :value="item.id"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                />
              </el-select>
            </el-form-item>
@@ -36,9 +36,9 @@
              <el-select v-model="form.coalId" placeholder="请选择煤种" @change="setInfo">
                <el-option
                    v-for="item in coalOptions"
                    :key="item.id"
                    :label="item.coal"
                    :value="item.id"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                />
              </el-select>
            </el-form-item>
@@ -124,6 +124,7 @@
import {reactive, ref} from "vue";
import {addOrEditSalesRecord, customerList, officialList} from "../../../api/salesOutbound/index.js";
import useUserStore from '@/store/modules/user'
import {getCoalInfoList, getSupplyList} from "@/api/procureMent/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits()
@@ -160,12 +161,20 @@
const openDialog = async (type, row) => {
  dialogVisitable.value = true
  form.value.saleDate = proxy.getCurrentDate()
  customerList().then((res) => {
    customerOptions.value = res.data
  })
  officialList().then((res) => {
    coalOptions.value = res.data
  })
  const [supplyRes, coalRes] = await Promise.all([
    customerList(),
    getCoalInfoList(),
  ]);
  let supplyData = supplyRes.data;
  let coalData = coalRes.data;
  customerOptions.value = supplyData.map((item) => ({
    value: item.id,
    label: item.customerName,
  }));
  coalOptions.value = coalData.map((item) => ({
    value: item.id,
    label: item.coal,
  }))
  let res = await userStore.getInfo()
  form.value.registrantId = res.user.userId
  form.value.taxCoal = 13