zuozhengqing
2023-11-20 b6ef759f0c74d2b58dd46e986ad3ce4ba73773e7
add:销售明细单选择项目,保存推送给aps
2个文件已修改
61 ■■■■■ 已修改文件
src/api/sales/salesDetails.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/salesDetails/AddSalesDetailsDialog.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sales/salesDetails.js
@@ -62,3 +62,19 @@
    data
  })
}
// 添加销售明细
export function getProjectList(data) {
  return request({
    url: "/api/salesDetails/getApsProjectList",
    method: "get",
    data
  })
}
// 推送销售明细信息到aps项目模块
export function sendSalesDetailsToApsProject(data) {
  return request({
    url: "/api/salesDetails/sendSalesDetailsToApsProject",
    method: "post",
    data
  })
}
src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -252,6 +252,20 @@
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="选择项目" prop="projectId">
                  <el-select
                    v-model="editConfig.infomation.projectId"
                    placeholder="请选择"
                    size="mini"
                    style="width: 100%"
                    :disabled="isView"
                  >
                    <el-option v-for="item in projectList" :key="item.projectId" :label="item.projectName" :value="item.projectId">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <!-- 收货信息 -->
@@ -471,7 +485,7 @@
<script>
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
import { getAllData } from "@/api/client/client"
import { getAddSalesDetails, getUpdateSalesDetails } from "@/api/sales/salesDetails"
import { getAddSalesDetails, getUpdateSalesDetails,getProjectList,sendSalesDetailsToApsProject } from "@/api/sales/salesDetails"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan"
@@ -521,7 +535,8 @@
        signTime: [{ required: true, message: "请选择签约日期", trigger: "change" }],
        memberId: [{ required: true, message: "请选择销售负责人", trigger: "change" }],
        sale_chance_name: [{ required: true, message: "请选择销售机会", trigger: "change" }],
        quotation_number: [{ required: true, message: "请选择销售报价单", trigger: "change" }]
        quotation_number: [{ required: true, message: "请选择销售报价单", trigger: "change" }],
        deliveryDate: [{ required: true, message: "请选择交付日期", trigger: "change" }],
        // approvalOpinion: [{ required: true, message: "请输入", trigger: "blur" }]
      },
      memberOptions: [],
@@ -567,12 +582,14 @@
      isAddQuatation: true,
      // 交付类型
      deliveryTypeList: getDataByType("deliveryType"),
      projectList:[],
      quotationList: [],
      quotationId: this.editCommonConfig.infomation.quotationId,
      tableData: [],
      selProductData: [],
      isView: this.editCommonConfig.title === "查看",
      selectBox: this.editCommonConfig.title !== "查看"
      selectBox: this.editCommonConfig.title !== "查看",
      thatMember:{}
    }
  },
  created() {
@@ -586,6 +603,7 @@
    if (this.editConfig.title === "编辑") {
      this.productTableList.tableData = this.editConfig.infomation.products
    }
    this.getProjectList()
  },
  watch: {
    "editClientManageConfig.visible"(val) {
@@ -640,8 +658,14 @@
            this.$message.error("请选择产品")
          } else {
            const params = this.saveParams()
            console.log(params)
            if (this.editConfig.title === "新建") {
              if(params.projectId!==0){
                sendSalesDetailsToApsProject({...params,member:this.thatMember}).then((res)=>{
                  if(res.code===200){
                    this.$message.success("成功推送至aps系统")
                  }
                })
              }
              getAddSalesDetails(params).then((res) => {
                console.log(res)
                this.editConfig.visible = false
@@ -696,7 +720,8 @@
        logisticNumber: data.logisticNumber || "",
        quotationId: this.quotationId,
        deliverType: data.deliverType || 0,
        status: 1
        status: 1,
        projectId:data.projectId||0
      }
      let params = {}
      if (this.editConfig.title === "新建") {
@@ -806,6 +831,7 @@
    },
    handleSelectClient(value, item) {
      if (value === "client") {
        this.thatMember=item.member
        this.editConfig.infomation.subbill_name = ""
        this.editConfig.infomation.sale_chance_name = ""
        this.clientId = item.id
@@ -931,6 +957,15 @@
    // 选择产品
    getSelectArray(val) {
      this.selProductData = val
    },
    // 获取项目列表
    async getProjectList(){
      await getProjectList({
        page: 1,
        pageSize: 100,
      }).then((res) => {
        this.projectList=res.data
      })
    }
  }
}