Ver código fonte

feature:项目 创建 升级 降级 模块字段更新

liuzhenlin 1 ano atrás
pai
commit
5d75198ea5

+ 134 - 0
components/SelectBid.vue

@@ -0,0 +1,134 @@
+<!--
+ * @Author: liuzhenlin 461480418@qq.ocm
+ * @Date: 2023-02-15 10:34:49
+ * @LastEditors: liuzhenlin
+ * @LastEditTime: 2023-02-23 10:57:44
+ * @Description: file content
+ * @FilePath: \oms\components\SelectCustomer.vue
+-->
+<template>
+  <view>
+    <u-popup :show="selectVisible" @close="close">
+      <view class="select-header">
+        <view class="tit">选择历史招标信息</view>
+        <view class="save-btn" @click="close()">保存</view>
+      </view>
+      <view class="search-container">
+        <view class="search-input">
+          <u-input
+            clearable
+            placeholderStyle="font-size:26rpx"
+            :customStyle="{ height: '66rpx' }"
+            v-model="queryForm.searchText"
+            prefixIcon="search"
+            prefixIconStyle="font-size: 22px;color: #909399"
+            placeholder="请输入招标产品名称/招标信息标题/中标单位"
+            shape="circle"
+            @input="getList()"
+            border="surround"></u-input>
+        </view>
+      </view>
+      <u-empty mode="list" v-if="bidList.length == 0"></u-empty>
+      <view class="concat-list" v-else>
+        <u-radio-group v-model="userValue" placement="column">
+          <view class="radio-item" v-for="item in bidList" :key="item.id">
+            <u-radio :label="item.label" :name="item.id" @change="radioChange"></u-radio>
+          </view>
+        </u-radio-group>
+      </view>
+    </u-popup>
+  </view>
+</template>
+
+<script>
+  import bidApi from '@/api/bid'
+  import to from 'await-to-js'
+  export default {
+    name: 'OmsCustomerContact',
+    props: {
+      queryParams: {
+        type: Object,
+        default() {
+          return {}
+        },
+      },
+    },
+    data() {
+      return {
+        selectVisible: false,
+        bidList: [],
+        queryForm: {
+          searchText: '',
+          pageNum: 1,
+          pageSize: 999,
+        },
+        // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
+        userValue: null,
+        selected: null,
+      }
+    },
+
+    methods: {
+      async getList() {
+        let params = Object.assign(this.queryForm, this.queryParams)
+        const [err, res] = await to(bidApi.list(params))
+        if (err) return
+        if (res.code == 200) {
+          if (res.data.list && res.data.list.length > 0) {
+            this.bidList = res.data.list.map((item) => ({
+              id: item.id,
+              label: `${item.productName}/${item.title}/${item.bidder}`,
+              name: item.searchText,
+            }))
+          } else {
+            this.bidList = []
+          }
+        }
+      },
+      open() {
+        this.selectVisible = true
+        this.getList()
+      },
+      close() {
+        this.selectVisible = false
+        this.$emit('close', this.selected)
+      },
+      radioChange(n) {
+        this.selected = this.bidList.find((item) => item.id == n)
+      },
+    },
+  }
+</script>
+
+<style lang="scss" scoped>
+  .search-container {
+    padding: 30rpx 30rpx 0 30rpx;
+    display: flex;
+    align-items: center;
+    .search-input {
+      flex: 1;
+    }
+    .search-btn {
+      text-align: center;
+      line-height: 60rpx;
+      border-radius: 12rpx;
+      width: 100rpx;
+      height: 60rpx;
+      font-size: 26rpx;
+      margin: 0 0 0 12rpx;
+      background: $u-primary;
+      color: #ffffff;
+    }
+  }
+  .concat-list {
+    padding: 0 0 20rpx 0;
+    width: 100%;
+    height: 900rpx;
+    overflow: auto;
+    margin-top: 20rpx;
+    .radio-item {
+      padding: 20rpx 30rpx;
+      border-bottom: 1px solid #ccc;
+    }
+  }
+</style>

+ 1 - 0
components/SelectProduct.vue

@@ -69,6 +69,7 @@
           prodName: '',
           pageNum: 1,
           pageSize: 999,
+          stateType: '启用',
           type: '全部客户',
         },
         // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中

+ 224 - 454
pages/project/create.vue

@@ -19,379 +19,173 @@
       </view>
     </view>
     <view class="main">
-      <view class="step1" v-if="step == 1">
-        <u-form :model="addForm" :rules="rules" ref="addForm" label-width="0">
-          <u-form-item prop="custName" borderBottom customStyle="padding:40rpx 0 30rpx" @click="$refs.cust.open()">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              选择客户
-            </view>
-            <u-input
-              v-model="addForm.custName"
-              disabled
-              disabledColor="#ffffff"
-              placeholder="请选择关联客户"
-              border="none"></u-input>
-            <u-icon slot="right" name="arrow-right"></u-icon>
-          </u-form-item>
-          <u-form-item prop="productLineVal" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showLine = true">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              产品线
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择产品线"
-              v-model="addForm.productLineVal"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item prop="nboName" borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              项目名称
-            </view>
-            <u-input
-              placeholder="输入项目名称"
-              v-model="addForm.nboName"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item
-            prop="nboSourceVal"
-            borderBottom
-            customStyle="padding:40rpx 0 30rpx"
-            @click="showNboSource = true">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              项目来源
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择项目来源"
-              v-model="addForm.nboSourceVal"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item prop="contactName" borderBottom customStyle="padding:40rpx 0 30rpx" @click="openContactUser()">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              主要联系人
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择主要联系人"
-              v-model="addForm.contactName"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">职位</view>
-            <u-input
-              placeholder="请输入职位"
-              v-model="addForm.contactPostion"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">联系电话</view>
-            <u-input
-              placeholder="请输入联系电话"
-              v-model="addForm.contactTelephone"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <!-- <u-form-item prop="saleName" borderBottom customStyle="padding:40rpx 0 30rpx" @click="$refs.user.open()">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              销售工程师
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择销售工程师"
-              v-model="addForm.saleName"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item> -->
-          <u-form-item prop="salesVal" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showModel = true">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              销售模式
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择销售模式"
-              v-model="addForm.salesVal"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item
-            borderBottom
-            customStyle="padding:40rpx 0 30rpx"
-            @click="$refs.dealer.open()"
-            v-if="addForm.salesModel > 10">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              经销商
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择经销商"
-              v-model="addForm.distributorName"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showSource = true">
-            <view class="form-label flex_l">项目预算</view>
-            <u-input
-              type="number"
-              placeholder="输入项目预算"
-              v-model="addForm.nboBudget"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item prop="isBigVal" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showLarge = true">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              是否大项目
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择是否大项目"
-              v-model="addForm.isBigVal"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showEstTransDate = true">
-            <view class="form-label flex_l">预计成交时间</view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择预计成交时间"
-              v-model="addForm.estTransTime"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showPlanDate = true">
-            <view class="form-label flex_l">计划采购时间</view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择计划采购时间"
-              v-model="addForm.planPurchaseTime"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showDate = true">
-            <view class="form-label flex_l">风险情况</view>
-            <u-input
-              placeholder="输入风险情况"
-              v-model="addForm.riskProfile"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showDate = true">
-            <view class="form-label flex_l">困难点</view>
-            <u-input
-              placeholder="输入困难点"
-              v-model="addForm.difficulty"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showDate = true">
-            <view class="form-label flex_l">竞争公司</view>
-            <u-input
-              placeholder="输入竞争公司"
-              v-model="addForm.competitor"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showDate = true">
-            <view class="form-label flex_l">介入情况</view>
-            <u-input
-              placeholder="输入介入情况"
-              v-model="addForm.intervention"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">
-              <!-- <view class="label-tag"></view> -->
-              备注
-            </view>
-            <u-input
-              placeholder="输入备注"
-              v-model="addForm.remark"
-              border="none"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-        </u-form>
-      </view>
-      <view class="step2" v-else-if="step == 2">
-        <view class="step-tit center">
-          <text class="margin20">添加产品</text>
-          <view class="add-btn" @click="$refs.product.open()">+</view>
-        </view>
-        <view class="product-wrap">
-          <view class="product-item" v-for="(v, i) in productList" :key="v.id">
-            <u-text type="primary" text="删除" customStyle="margin-left:20rpx" @click="removeProductItem(i)"></u-text>
-            <view class="product-label flex_l">
-              产品编码:
-              <view class="product-val">{{ v.prodCode }}</view>
-            </view>
-            <view class="product-label flex_l">
-              产品名称:
-              <view class="product-val">{{ v.prodName }}</view>
-            </view>
-            <view class="product-label flex_l">
-              产品类别:
-              <view class="product-val">{{ v.prodClass }}</view>
-            </view>
-            <view class="product-label flex_l">
-              产品单价:
-              <view class="product-val">
-                <u-input v-model.number="productList[i].guidPrice" clearable></u-input>
-              </view>
-            </view>
-            <view class="product-label flex_l">
-              产品数量:
-              <view class="product-val">
-                <u-input v-model="productList[i].prodNum" clearable></u-input>
-              </view>
-            </view>
+      <u-form :model="addForm" :rules="rules" ref="addForm" label-width="0">
+        <u-form-item prop="custName" borderBottom customStyle="padding:40rpx 0 30rpx">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            关联客户
           </view>
-        </view>
-      </view>
-      <!-- <view class="step3" v-else-if="step == 3">
-        <u-form :model="addForm" :rules="rules" ref="addForm" label-width="0">
-          <u-form-item
-            prop="followTime"
-            borderBottom
-            customStyle="padding:40rpx 0 30rpx"
-            @click="showFollowDate = true">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              跟进时间
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择跟进时间"
-              v-model="addForm.followTime"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item
-            prop="followUserName"
-            borderBottom
-            customStyle="padding:40rpx 0 30rpx"
-            @click="$refs.allUser.open()">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              负责人员
-            </view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择负责人员"
-              v-model="addForm.followUserName"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item prop="followContent" borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              跟进内容
-            </view>
-            <u-input
-              placeholder="请输入跟进内容"
-              v-model="addForm.followContent"
-              border="none"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-        </u-form>
-      </view> -->
+          <u-input
+            v-model="addForm.custName"
+            disabled
+            disabledColor="#ffffff"
+            placeholder="请选择关联客户"
+            border="none"></u-input>
+        </u-form-item>
+        <u-form-item prop="productLineVal" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showLine = true">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            产品线
+          </view>
+          <u-input
+            :readonly="true"
+            placeholder="请选择产品线"
+            v-model="addForm.productLineVal"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+        <u-form-item prop="nboName" borderBottom customStyle="padding:40rpx 0 30rpx">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            项目名称
+          </view>
+          <u-input
+            placeholder="输入项目名称"
+            v-model="addForm.nboName"
+            border="none"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+        <u-form-item prop="nboSourceVal" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showNboSource = true">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            项目来源
+          </view>
+          <u-input
+            :readonly="true"
+            placeholder="请选择项目来源"
+            v-model="addForm.nboSourceVal"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+        <u-form-item
+          prop="bidInfo"
+          borderBottom
+          customStyle="padding:40rpx 0 30rpx"
+          v-if="addForm.nboSource == 80"
+          @click="$refs.bidRef.open()">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            招标信息
+          </view>
+          <u-input
+            v-model="addForm.bidInfo"
+            disabled
+            disabledColor="#ffffff"
+            placeholder="招标信息"
+            border="none"></u-input>
+          <u-icon slot="right" name="arrow-right"></u-icon>
+        </u-form-item>
+        <u-form-item prop="saleName" borderBottom customStyle="padding:40rpx 0 30rpx" @click="$refs.user.open()">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            销售工程师
+          </view>
+          <u-input
+            :readonly="true"
+            placeholder="请选择销售工程师"
+            v-model="addForm.saleName"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+        <u-form-item prop="salesVal" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showModel = true">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            销售模式
+          </view>
+          <u-input
+            :readonly="true"
+            placeholder="请选择销售模式"
+            v-model="addForm.salesVal"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+        <u-form-item
+          borderBottom
+          customStyle="padding:40rpx 0 30rpx"
+          @click="$refs.dealer.open()"
+          v-if="addForm.salesModel > 10">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            经销商
+          </view>
+          <u-input
+            :readonly="true"
+            placeholder="请选择经销商"
+            v-model="addForm.distributorName"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+        <u-form-item prop="isBigVal" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showLarge = true">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            是否大项目
+          </view>
+          <u-input
+            :readonly="true"
+            placeholder="请选择是否大项目"
+            v-model="addForm.isBigVal"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+        <u-form-item prop="nboTypeVal" borderBottom customStyle="padding:40rpx 0 30rpx" @click="showNboType = true">
+          <view class="form-label flex_l">
+            <view class="label-tag"></view>
+            项目类别
+          </view>
+          <u-input
+            :readonly="true"
+            placeholder="请选择项目类别"
+            v-model="addForm.nboTypeVal"
+            border="none"
+            suffixIcon="arrow-down"
+            suffixIconStyle="color:#CDCDCD"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+        <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
+          <view class="form-label flex_l">备注</view>
+          <u-input
+            placeholder="输入备注"
+            v-model="addForm.remark"
+            border="none"
+            clearable
+            customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+        </u-form-item>
+      </u-form>
       <view class="center">
-        <view class="handle-btn" v-if="step > 1" @click="previousStep">上一步</view>
-        <view class="handle-btn" v-if="step < 2" @click="nextStep">下一步</view>
-        <view class="handle-btn" v-if="step == 2" @click="handleAdd" :class="!flag ? 'disabledBtn' : ''">保存</view>
+        <view class="handle-btn" @click="handleAdd">保存</view>
       </view>
     </view>
-    <!-- 选择下次时间 -->
-    <u-datetime-picker
-      v-if="showEstTransDate"
-      :show="showEstTransDate"
-      mode="date"
-      v-model="addForm.estTransTime"
-      @cancel="showEstTransDate = false"
-      @confirm="pickEstTransDate"></u-datetime-picker>
-    <!-- 计划采购时间 -->
-    <u-datetime-picker
-      v-if="showPlanDate"
-      :show="showPlanDate"
-      mode="date"
-      v-model="addForm.planPurchaseTime"
-      @cancel="showPlanDate = false"
-      @confirm="pickPlanDate"></u-datetime-picker>
-    <!-- 跟进时间 -->
-    <u-datetime-picker
-      v-if="showFollowDate"
-      :show="showFollowDate"
-      mode="date"
-      v-model="addForm.followTime"
-      @cancel="showFollowDate = false"
-      @confirm="pickFollowDate"></u-datetime-picker>
-    <!-- 选择客户 -->
-    <select-customer ref="cust" @close="closeCust($event)"></select-customer>
-    <!-- 选择客户联系人 -->
-    <customer-contact ref="contact" @close="closeContact($event)"></customer-contact>
     <!-- 选择销售 -->
     <select-user
       ref="user"
@@ -399,10 +193,8 @@
       @close="closeUser($event)"></select-user>
     <!-- 选择经销商 -->
     <select-dealer ref="dealer" @close="closeDealer($event)"></select-dealer>
-    <!-- 选择用户 -->
-    <select-user ref="allUser" @close="closeAllUser($event)"></select-user>
-    <!-- 选择产品 -->
-    <select-product ref="product" :selectedRows="productList" @close="closeProduct($event)"></select-product>
+    <!-- 选择招标信息 -->
+    <select-bid ref="bidRef" :query-params="{ custId: addForm.custId }" @close="closeBid($event)"></select-bid>
     <!-- 项目来源 -->
     <u-picker
       :show="showNboSource"
@@ -431,24 +223,28 @@
       keyName="value"
       @cancel="showLarge = false"
       @confirm="pickLarge"></u-picker>
+    <!-- 项目类别 -->
+    <u-picker
+      :show="showNboType"
+      :columns="nboTypeColumns"
+      keyName="value"
+      @cancel="showNboType = false"
+      @confirm="pickNboType"></u-picker>
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
   </view>
 </template>
 <script>
   import { mapGetters } from 'vuex'
-
   import projectApi from 'api/project'
   import customerApi from '../../api/customer'
   import to from 'await-to-js'
-  import SelectCustomer from 'components/SelectCustomer'
-  import CustomerContact from 'components/CustomerContact'
   import SelectUser from 'components/SelectUser'
   import SelectDealer from 'components/SelectDealer'
-  import SelectProduct from 'components/SelectProduct'
+  import SelectBid from 'components/SelectBid'
   export default {
     name: 'omsIndex',
-    components: { SelectCustomer, CustomerContact, SelectUser, SelectDealer, SelectProduct },
+    components: { SelectUser, SelectDealer, SelectBid },
     data() {
       return {
         flag: true,
@@ -459,23 +255,23 @@
         showModel: false, //销售模式选择
         showLine: false, //产品线选择
         showLarge: false, //是否是大项目选择
+        showNboType: false, //项目类别
         nboSourceColumns: [], //项目来源
         salesModelColumns: [], //销售模式
         productLineColumns: [], //产品线
         yesOrNoColumns: [], //是否是大项目
-        showEstTransDate: false, //选择预计成交时间
-        showPlanDate: false, //计划采购时间
-        showFollowDate: false, //计划采购时间
+        nboTypeColumns: [
+          [
+            { key: '30', value: 'C类' },
+            { key: '50', value: '储备' },
+          ],
+        ],
         addForm: {
           nboName: '', //项目名称
           custId: '', //关联客户id
           custName: '', //关联客户
           nboSource: '', //项目来源
           nboSourceVal: '', //项目来源文字
-          contactId: '', //联系人id
-          contactName: '', //联系人姓名
-          contactPostion: '', //联系人职位
-          contactTelephone: '', //联系人电话
           saleName: '', //销售工程师
           saleId: '', //销售工程师id
           salesModel: '', //销售模式(10直销20经销30代理)
@@ -484,31 +280,24 @@
           distributorName: '', //经销商/代理商名称
           productLine: '', //产品线来源
           productLineVal: '', //产品线文字
-          nboBudget: '', //项目预算
           isBig: '', //是否是大项目
           isBigVal: '', //是否是大项目文字
-          estTransTime: this.parseTime(new Date(), '{y}-{m}-{d}'), //预计成交时间
-          planPurchaseTime: this.parseTime(new Date(), '{y}-{m}-{d}'), //计划采购时间
-          riskProfile: '', //风险情况
-          difficulty: '', //困难点
-          competitor: '', //竞争公司
-          intervention: '', //介入情况
           remark: '', //备注
-          // followTime: this.parseTime(new Date(), '{y}-{m}-{d}'), //跟进时间
-          // followUserId: '', //跟进用户id
-          // followUserName: '', //跟进用户id
-          // followContent: '', //跟进内容
+          nboTypeVal: '', //项目类别
+          nboType: '', //项目类别
+          bidInfo: '', //招标标题
+          bidId: null,
         },
         rules: {
           nboName: [{ required: true, trigger: ['blur', 'change'], message: '请输入项目名称' }],
           custName: [{ required: true, trigger: ['blur', 'change'], message: '请选择关联客户' }],
           nboSourceVal: [{ required: true, trigger: ['blur', 'change'], message: '请选择项目来源' }],
-          contactName: [{ required: true, trigger: ['blur', 'change'], message: '请选择主要联系人' }],
-          // saleName: [{ required: true, trigger: ['blur', 'change'], message: '请选择销售工程师' }],
+          saleName: [{ required: true, trigger: ['blur', 'change'], message: '请选择销售工程师' }],
           salesModelVal: [{ required: true, trigger: ['blur', 'change'], message: '请选择销售模式' }],
           distributorName: [{ required: true, trigger: ['blur', 'change'], message: '请选择经销商/代理商' }],
           isBigVal: [{ required: true, trigger: ['blur', 'change'], message: '请选择是否大项目' }],
           productLineVal: [{ required: true, trigger: ['blur', 'change'], message: '请选择产品线' }],
+          nboTypeVal: [{ required: true, trigger: ['blur', 'change'], message: '请选择项目类别' }],
           // 跟进
           // followTime: [{ required: true, trigger: ['blur', 'change'], message: '请输入跟进时间' }],
           // followContent: [{ required: true, trigger: ['blur', 'change'], message: '请输入跟进内容' }],
@@ -552,7 +341,6 @@
         if (err) return
         if (res && res.code == 200) {
           this.addForm.custName = res.data.list[0].custName
-          this.addForm.nboName = this.addForm.custName
         }
       },
       // 打开主要联系人
@@ -583,15 +371,6 @@
           this.addForm.distributorName = dealer.name
         }
       },
-      // 关闭选择客户联系人
-      closeContact(user) {
-        if (user) {
-          this.addForm.contactId = user.id
-          this.addForm.contactName = user.label
-          this.addForm.contactPostion = user.postion
-          this.addForm.contactTelephone = user.telephone
-        }
-      },
       // 关闭选择销售
       closeUser(user) {
         if (user) {
@@ -609,6 +388,12 @@
       closeProduct(product) {
         this.productList = [...product]
       },
+      // 关闭选择招标信息的回调
+      closeBid(bid) {
+        console.log('bid', bid)
+        this.addForm.bidInfo = bid.title
+        this.addForm.bidId = bid.id
+      },
       removeProductItem(idx) {
         this.productList.splice(idx, 1)
       },
@@ -641,26 +426,11 @@
         this.addForm.isBigVal = e.value[0].value
         this.showLarge = false
       },
-      // 选择预计成交时间
-      async pickEstTransDate(e) {
-        this.showEstTransDate = false
-        const timeFormat = uni.$u.timeFormat
-        let timeValue = await timeFormat(e.value, 'yyyy-mm-dd')
-        this.addForm.estTransTime = timeValue
-      },
-      // 计划采购时间
-      async pickPlanDate(e) {
-        this.showPlanDate = false
-        const timeFormat = uni.$u.timeFormat
-        let timeValue = await timeFormat(e.value, 'yyyy-mm-dd')
-        this.addForm.planPurchaseTime = timeValue
-      },
-      // 跟进时间
-      async pickFollowDate(e) {
-        this.showFollowDate = false
-        const timeFormat = uni.$u.timeFormat
-        let timeValue = await timeFormat(e.value, 'yyyy-mm-dd')
-        this.addForm.followTime = timeValue
+      // 项目类别
+      pickNboType(e) {
+        this.addForm.nboType = e.value[0].key
+        this.addForm.nboTypeVal = e.value[0].value
+        this.showNboType = false
       },
       nextStep() {
         if (this.step == 1) {
@@ -696,36 +466,36 @@
         }
       },
       handleAdd() {
-        if (!this.flag) return
         this.$refs.addForm
           .validate()
           .then(async () => {
-            this.flag = false
-            let params = this.addForm
-            params.nboBudget = Number(params.nboBudget)
-            params.saleName = this.nickName
-            params.saleId = this.userId
-            let products = this.productList.map((item) => ({
-              ProdId: item.id,
-              ProdName: item.prodName,
-              ProdCode: item.prodCode,
-              ProdClass: item.prodClass,
-              ProdNum: Number(item.prodNum),
-              ProdPrice: Number(item.guidPrice),
-            }))
-            params.products = products
-            const [err, res] = await to(projectApi.create(params))
-            this.flag = true
-            if (err) return
-            if (res && res.code == 200) {
-              this.$refs.uToast.show({
-                type: 'success',
-                message: '创建成功',
-                complete: () => {
-                  this.goBack()
-                },
+            if (!this.flag) return
+            this.$refs.addForm
+              .validate()
+              .then(async () => {
+                this.flag = false
+                let params = this.addForm
+                const [err, res] = await to(projectApi.create(params))
+                this.flag = true
+                if (err) return
+                if (res && res.code == 200) {
+                  this.$refs.uToast.show({
+                    type: 'success',
+                    message: '创建成功',
+                    complete: () => {
+                      this.goBack()
+                    },
+                  })
+                }
+              })
+              .catch((err) => {
+                this.$refs.uNotify.show({
+                  top: this.height + this.paddingTop + 10,
+                  type: 'warning',
+                  message: err[0].message,
+                  duration: 1000 * 3,
+                })
               })
-            }
           })
           .catch((err) => {
             this.$refs.uNotify.show({

+ 18 - 3
pages/project/details.vue

@@ -111,9 +111,24 @@
     <!-- 新增按钮 -->
     <view class="fixed-btn-group" :style="{ width: openBtnWidth ? '480rpx' : '90rpx' }">
       <view class="flex1" v-if="openBtnWidth">
-        <view class="btn center" @click="linkToLevel(1)">升</view>
-        <view class="red btn center" @click="linkToLevel(0)">降</view>
-        <view class="btn center" @click="$refs.reserve.open(projectId)">储</view>
+        <view
+          class="btn center"
+          v-if="['20', '30', '50'].includes(projectData.nboType) && projectData.approStatus != '20'"
+          @click="linkToLevel(1)">
+          升
+        </view>
+        <view
+          class="red btn center"
+          v-if="['10', '20'].includes(projectData.nboType) && projectData.approStatus != '20'"
+          @click="linkToLevel(0)">
+          降
+        </view>
+        <view
+          class="btn center"
+          v-if="projectData.nboType != '40' || projectData.nboType != '50' || projectData.approStatus != '20'"
+          @click="$refs.reserve.open(projectId)">
+          储
+        </view>
         <view class="btn center" @click="linkToTransfer()">转</view>
         <!-- <view class="btn center" @click="createProject()">增</view> -->
         <view class="btn center" @click="openFollow()">跟</view>

+ 14 - 14
pages/project/downgrade.vue

@@ -37,10 +37,10 @@
               label="B"
               name="20"></u-radio>
             <u-radio customStyle="margin-right:40rpx" label="C" name="30"></u-radio>
-            <u-radio v-if="projectDetails.nboType === '10'" label="储备" name="50"></u-radio>
+            <!-- <u-radio v-if="projectDetails.nboType === '10'" label="储备" name="50"></u-radio> -->
           </u-radio-group>
         </u-form-item>
-        <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
+        <!-- <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
           <view class="form-label flex_l">技术支持人员</view>
           <u-input
             placeholder="输入技术支持人员"
@@ -62,8 +62,8 @@
             suffixIconStyle="color:#CDCDCD"
             clearable
             customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-        </u-form-item>
-        <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showSupportDate = true">
+        </u-form-item> -->
+        <!-- <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showSupportDate = true">
           <view class="form-label flex_l">技术支持时间</view>
           <u-input
             :readonly="true"
@@ -74,16 +74,16 @@
             suffixIconStyle="color:#CDCDCD"
             clearable
             customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-        </u-form-item>
+        </u-form-item> -->
         <u-form-item prop="remark" customStyle="padding:40rpx 0 30rpx">
           <view class="form-label flex_l">
             <view class="label-tag"></view>
-            备注原因
+            降级原因
           </view>
           <u-textarea
             fontSize="26rpx"
             v-model="addForm.remark"
-            placeholder="请输入备注原因"
+            placeholder="请输入降级原因"
             height="180"
             :count="true"
             maxlength="300"></u-textarea>
@@ -91,14 +91,14 @@
       </u-form>
       <view class="save" @click="handleDowngrade">提交</view>
     </view>
-    <!-- 技术支持时间 -->
+    <!-- 技术支持时间
     <u-datetime-picker
       v-if="showSupportDate"
       :show="showSupportDate"
       mode="date"
       v-model="addForm.technicalSupportTime"
       @cancel="showSupportDate = false"
-      @confirm="pickSupportDate"></u-datetime-picker>
+      @confirm="pickSupportDate"></u-datetime-picker> -->
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
     <u-modal
@@ -120,12 +120,12 @@
         flag: true,
         height: '',
         paddingTop: '',
-        showSupportDate: false, //技术支持时间
+        // showSupportDate: false, //技术支持时间
         addForm: {
           nboType: '', //项目及别
-          technicalSupportName: '', //技术支持人员
-          technicalSupportContent: null, //技术支持内容
-          technicalSupportTime: '', //技术支持时间
+          // technicalSupportName: '', //技术支持人员
+          // technicalSupportContent: null, //技术支持内容
+          // technicalSupportTime: '', //技术支持时间
           remark: '', //备注
           id: 0, //项目id
         },
@@ -147,7 +147,7 @@
           remark: {
             type: 'string',
             required: true,
-            message: '请输入备注内容',
+            message: '请输入降级原因',
             trigger: ['blur'],
           },
         },

+ 5 - 4
pages/project/index.vue

@@ -132,10 +132,11 @@
             status: 0,
             nboType: null,
           },
+
           {
-            name: 'C类项目',
+            name: 'A类项目',
             status: 1,
-            nboType: '30',
+            nboType: '10',
           },
           {
             name: 'B类项目',
@@ -143,9 +144,9 @@
             nboType: '20',
           },
           {
-            name: 'A类项目',
+            name: 'C类项目',
             status: 3,
-            nboType: '10',
+            nboType: '30',
           },
           {
             name: '成交项目',

+ 313 - 290
pages/project/upgrade.vue

@@ -42,10 +42,9 @@
               customStyle="margin-right:40rpx"
               label="C"
               name="30"></u-radio>
-            <!-- <u-radio v-if="projectDetails.nboType === '10'" label="储备" name="50"></u-radio> -->
           </u-radio-group>
         </u-form-item>
-        <!-- A/B -->
+        <!-- C - B 必填项:项目类别、项目预算、渠道销售人员、渠道销售电话、微信、预计出货金额(不填)、添加产品、上传报价单  -->
         <view v-if="addForm.nboType !== '30'">
           <u-form-item prop="nboBudget" borderBottom customStyle="padding:40rpx 0 30rpx">
             <view class="form-label flex_l">
@@ -61,102 +60,40 @@
               clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
-          <u-form-item
-            prop="distributorName"
-            borderBottom
-            customStyle="padding:40rpx 0 30rpx"
-            @click="$refs.dealer.open()">
-            <view class="form-label flex_l">经销商/代理商</view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择经销商/代理商"
-              v-model="addForm.distributorName"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item prop="parentReceiver" borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">总部对接人</view>
-            <u-input
-              placeholder="输入总部对接人"
-              v-model="addForm.parentReceiver"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item prop="technicalSupportName" borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              技术支持人员
-            </view>
-            <u-input
-              placeholder="输入技术支持人员"
-              v-model="addForm.technicalSupportName"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item prop="technicalSupportContent" borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">
-              <view class="label-tag"></view>
-              技术支持内容
-            </view>
-            <u-input
-              placeholder="输入技术支持内容"
-              v-model="addForm.technicalSupportContent"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showSupportDate = true">
-            <view class="form-label flex_l">技术支持时间</view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择技术支持时间"
-              v-model="addForm.technicalSupportTime"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showBudgetDate = true">
-            <view class="form-label flex_l">项目预算期限</view>
-            <u-input
-              :readonly="true"
-              placeholder="请选择项目预算期限"
-              v-model="addForm.nboBudgetTime"
-              border="none"
-              suffixIcon="arrow-down"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">资金来源</view>
-            <u-input
-              placeholder="输入资金来源"
-              v-model="addForm.capitalSource"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">产品/方案满足情况</view>
-            <u-input
-              placeholder="输入产品/方案满足情况"
-              v-model="addForm.productSatisfaction"
-              border="none"
-              suffixIconStyle="color:#CDCDCD"
-              clearable
-              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
-          </u-form-item>
+          <!-- v-if="projectDetails.salesModel !== '10'" -->
+          <view v-if="projectDetails.salesModel !== '10'">
+            <u-form-item
+              prop="dealerSalesName"
+              borderBottom
+              customStyle="padding:40rpx 0 30rpx"
+              @click="$refs.distrConcat.open()">
+              <view class="form-label flex_l">
+                <view class="label-tag"></view>
+                渠道销售人员
+              </view>
+              <u-input
+                :readonly="true"
+                placeholder="请选择渠道销售人员"
+                v-model="addForm.dealerSalesName"
+                border="none"
+                suffixIcon="arrow-down"
+                suffixIconStyle="color:#CDCDCD"
+                clearable
+                customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+            </u-form-item>
+            <u-form-item prop="dealerSalesContact" borderBottom customStyle="padding:40rpx 0 30rpx">
+              <view class="form-label flex_l">
+                <view class="label-tag"></view>
+                渠道销售电话/微信
+              </view>
+              <u-input
+                placeholder="请选择渠道销售人员"
+                v-model="addForm.dealerSalesContact"
+                border="none"
+                clearable
+                customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+            </u-form-item>
+          </view>
           <!-- 上传报价单文件 -->
           <u-form-item prop="quotationFile" borderBottom customStyle="padding:40rpx 0 30rpx">
             <view class="form-label flex_l">
@@ -175,9 +112,48 @@
               </view>
             </uni-file-picker>
           </u-form-item>
+          <view>
+            <view class="step-tit center">
+              <text class="margin20">添加产品</text>
+              <view class="add-btn" @click="$refs.product.open()">+</view>
+            </view>
+            <view class="product-wrap">
+              <view class="product-item" v-for="(v, i) in productList" :key="v.id">
+                <u-text
+                  type="primary"
+                  text="删除"
+                  customStyle="margin-left:20rpx"
+                  @click="removeProductItem(i)"></u-text>
+                <view class="product-label flex_l">
+                  产品编码:
+                  <view class="product-val">{{ v.prodCode }}</view>
+                </view>
+                <view class="product-label flex_l">
+                  产品名称:
+                  <view class="product-val">{{ v.prodName }}</view>
+                </view>
+                <view class="product-label flex_l">
+                  产品类别:
+                  <view class="product-val">{{ v.prodClass }}</view>
+                </view>
+                <view class="product-label flex_l">
+                  产品单价:
+                  <view class="product-val">
+                    <u-input v-model.number="productList[i].guidPrice" clearable></u-input>
+                  </view>
+                </view>
+                <view class="product-label flex_l">
+                  产品数量:
+                  <view class="product-val">
+                    <u-input v-model="productList[i].prodNum" clearable></u-input>
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
         </view>
-        <!-- A -->
-        <view v-if="addForm.nboType === '10'">
+        <!--    B-A    必填项:采购方式、资金来源、计划 计划采购时间、客户联系人、客户决策部分、客户联系人姓名、客户联系人电话/微信、是否采纳我司技术参数(是/否)、竞争公司、客户倾向厂家  -->
+        <view v-if="addForm.nboType == '10'">
           <u-form-item
             prop="purchasingWayVal"
             borderBottom
@@ -197,74 +173,109 @@
               clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
+          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              资金来源
+            </view>
+            <u-input
+              placeholder="输入资金来源"
+              v-model="addForm.capitalSource"
+              border="none"
+              suffixIconStyle="color:#CDCDCD"
+              clearable
+              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+          </u-form-item>
           <u-form-item
-            prop="purchasingTime"
+            prop="planPurchaseTime"
             borderBottom
             customStyle="padding:40rpx 0 30rpx"
             @click="showPurchasingDate = true">
             <view class="form-label flex_l">
               <view class="label-tag"></view>
-              采购时间
+              计划采购时间
             </view>
             <u-input
               :readonly="true"
-              placeholder="请选择采购时间"
-              v-model="addForm.purchasingTime"
+              placeholder="请选择 计划采购时间"
+              v-model="addForm.planPurchaseTime"
               border="none"
               suffixIcon="arrow-down"
               suffixIconStyle="color:#CDCDCD"
               clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="selectContact()">
-            <view class="form-label flex_l">决策人员</view>
+          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" prop="makerName">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              客户决策人
+            </view>
             <u-input
-              :readonly="true"
-              placeholder="输入决策人员"
+              placeholder="输入客户联系人"
               v-model="addForm.makerName"
               border="none"
-              suffixIconStyle="color:#CDCDCD"
               clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">决策部门</view>
+          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" prop="makerDept">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              客户决策部门
+            </view>
             <u-input
-              :readonly="true"
-              placeholder="输入决策部门"
+              placeholder="输入客户决策部门"
               v-model="addForm.makerDept"
               border="none"
-              suffixIconStyle="color:#CDCDCD"
               clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">经销商与客户历史成交信息</view>
+          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="selectContact()">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              客户联系人
+            </view>
             <u-input
-              placeholder="输入经销商与客户历史成交信息"
-              v-model="addForm.historicalTransactionInfo"
+              :readonly="true"
+              placeholder="输入客户联系人"
+              v-model="addForm.contactName"
               border="none"
               suffixIconStyle="color:#CDCDCD"
               clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">经销商销售人员</view>
+          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" prop="contactTelephone">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              客户联系人电话/微信
+            </view>
             <u-input
-              placeholder="输入经销商销售人员"
-              v-model="addForm.dealerSalesName"
+              placeholder="输入客户联系人电话/微信"
+              v-model="addForm.contactTelephone"
               border="none"
-              suffixIconStyle="color:#CDCDCD"
               clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
-          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
-            <view class="form-label flex_l">维护部门及人员</view>
+          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" prop="competitor">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              竞争公司
+            </view>
             <u-input
-              placeholder="输入维护部门及人员"
-              v-model="addForm.accendant"
+              placeholder="输入竞争公司"
+              v-model="addForm.competitor"
+              border="none"
+              clearable
+              customStyle="padding: 0 30rpx 0 12rpx"></u-input>
+          </u-form-item>
+          <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" prop="customerIntentionFactory">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              客户倾向厂家
+            </view>
+            <u-input
+              placeholder="输入客户倾向厂家"
+              v-model="addForm.customerIntentionFactory"
               border="none"
-              suffixIconStyle="color:#CDCDCD"
               clearable
               customStyle="padding: 0 30rpx 0 12rpx"></u-input>
           </u-form-item>
@@ -301,57 +312,48 @@
             </uni-file-picker>
           </u-form-item>
         </view>
-        <u-form-item
-          prop="projConversionReason"
-          customStyle="padding:40rpx 0 30rpx"
-          v-if="addForm.isAdoptDashoo != '30'">
-          <view class="form-label flex_l">升级原因</view>
-          <u-textarea
-            fontSize="26rpx"
-            v-model="addForm.projConversionReason"
-            placeholder="请输入升级原因"
-            height="180"
-            :count="true"
-            maxlength="300"></u-textarea>
-        </u-form-item>
-        <u-form-item prop="remark" customStyle="padding:40rpx 0 30rpx" v-else>
-          <view class="form-label flex_l">
-            <view class="label-tag"></view>
-            转化原因
-          </view>
-          <u-textarea
-            fontSize="26rpx"
-            v-model="addForm.remark"
-            placeholder="请输入转化原因"
-            height="180"
-            :count="true"
-            maxlength="300"></u-textarea>
-        </u-form-item>
+        <view v-if="addForm.nboType === '30'">
+          <u-form-item
+            prop="projConversionReason"
+            customStyle="padding:40rpx 0 30rpx"
+            v-if="addForm.isAdoptDashoo != '30'">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              转化原因
+            </view>
+            <u-textarea
+              fontSize="26rpx"
+              v-model="addForm.projConversionReason"
+              placeholder="请输入转化原因"
+              height="180"
+              :count="true"
+              maxlength="300"></u-textarea>
+          </u-form-item>
+        </view>
+        <view v-else>
+          <u-form-item prop="remark" customStyle="padding:40rpx 0 30rpx" v-if="addForm.isAdoptDashoo != '30'">
+            <view class="form-label flex_l">
+              <view class="label-tag"></view>
+              升级原因
+            </view>
+            <u-textarea
+              fontSize="26rpx"
+              v-model="addForm.remark"
+              placeholder="请输入升级原因"
+              height="180"
+              :count="true"
+              maxlength="300"></u-textarea>
+          </u-form-item>
+        </view>
       </u-form>
       <view class="save" @click="handleUpgrade">提交</view>
     </view>
-    <!-- 技术支持时间 -->
-    <u-datetime-picker
-      v-if="showSupportDate"
-      :show="showSupportDate"
-      mode="date"
-      v-model="addForm.technicalSupportTime"
-      @cancel="showSupportDate = false"
-      @confirm="pickSupportDate"></u-datetime-picker>
-    <!-- 项目预算期限 -->
-    <u-datetime-picker
-      v-if="showBudgetDate"
-      :show="showBudgetDate"
-      mode="date"
-      v-model="addForm.nboBudgetTime"
-      @cancel="showBudgetDate = false"
-      @confirm="pickBudgetDate"></u-datetime-picker>
-    <!-- 采购时间 -->
+    <!--  计划采购时间 -->
     <u-datetime-picker
       v-if="showPurchasingDate"
       :show="showPurchasingDate"
       mode="date"
-      v-model="addForm.purchasingTime"
+      v-model="addForm.planPurchaseTime"
       @cancel="showPurchasingDate = false"
       @confirm="pickPurchasingDate"></u-datetime-picker>
     <!-- 采购方式 -->
@@ -361,10 +363,12 @@
       keyName="value"
       @cancel="showChasingWay = false"
       @confirm="pickModel"></u-picker>
-    <!-- 选择经销商 -->
-    <select-dealer ref="dealer" @close="closeDealer($event)"></select-dealer>
+    <!-- 经销商代理商联系人 -->
+    <distr-contact ref="distrConcat" @close="closeConcat" :distrType="targetType"></distr-contact>
     <!-- 客户联系人 -->
     <customer-contact ref="contact" @close="closeContact($event)"></customer-contact>
+    <!-- 选择产品 -->
+    <select-product ref="product" :selectedRows="productList" @close="closeProduct($event)"></select-product>
     <u-notify ref="uNotify"></u-notify>
     <u-toast ref="uToast"></u-toast>
     <u-modal
@@ -380,16 +384,16 @@
   import {
     multipartUpload as upload,
     uploadTask as task, //上传任务对象,同requestTask js_sdk\xp-multipart\xp-multipart\xp-multipart.js
-
-    // D:\work\oms\js_sdk\xp-multipart\xp-multipart\xp-multipart.js
   } from '@/js_sdk/xp-multipart/xp-multipart/xp-multipart'
   import projectApi from '../../api/project'
   import to from 'await-to-js'
-  import SelectDealer from 'components/SelectDealer'
   import CustomerContact from '../../components/CustomerContact'
+  import DistrContact from '@/components/DistrContact'
+  import SelectProduct from 'components/SelectProduct'
+
   export default {
     name: 'omsIndex',
-    components: { SelectDealer, CustomerContact },
+    components: { CustomerContact, DistrContact, SelectProduct },
     data() {
       return {
         flag: true,
@@ -397,33 +401,28 @@
         paddingTop: '',
         showSupportDate: false, //技术支持时间
         showBudgetDate: false, //项目预算时间
-        showPurchasingDate: false, //采购时间
+        showPurchasingDate: false, // 计划采购时间
         showChasingWay: false,
         purchasingWayOptions: [],
         addForm: {
           nboType: '', //项目及别
           nboBudget: 0, //项目预算
-          distributorName: '', //经销商
-          distributorId: '', //经销商ID
-          parentReceiver: '', //项目对接人
-          technicalSupportName: '', //技术支持人员
-          technicalSupportContent: null, //技术支持内容
-          technicalSupportTime: '', //技术支持时间
-          nboBudgetTime: this.parseTime(new Date(), '{y}-{m}-{d}'), //项目预算时间
+          dealerSalesName: '', //经销商销售人员
+          dealerSalesId: '', //经销商销售人员
           capitalSource: '', //资金来源
-          productSatisfaction: '', //产品方案满足情况
           purchasingWay: '', //采购方式id
           purchasingWayVal: '', //采购方式
-          purchasingTime: this.parseTime(new Date(), '{y}-{m}-{d}'), //采购时间
-          makerId: '', //决策人
-          makerName: '', //决策人
-          makerDept: '', //决策部门
-          historicalTransactionInfo: '', //输入经销商与客户历史成交信息
-          dealerSalesName: '', //经销商销售人员
-          accendant: '', //维护部门及人员
+          planPurchaseTime: this.parseTime(new Date(), '{y}-{m}-{d}'), // 计划采购时间
+          makerName: '', //客户决策人
+          contactName: '', //客户联系人
+          contactId: '', //客户联系人
+          contactTelephone: '', //客户联系人电话
+          competitor: '', //竞争公司
+          customerIntentionFactory: '', //客户倾向厂家
+          makerDept: '', //客户决策部门
           isAdoptDashoo: '', //是否采纳大数技术参数
           remark: '', //转化原因
-          projConversionReason: '', //升级原因
+          projConversionReason: '', //转化原因
           id: 0, //项目id
           dashooParamFile: '',
           dashooParamFilePaths: '',
@@ -433,48 +432,22 @@
         showModal: false,
         projectDetails: {},
         rules: {
-          nboType: {
-            type: 'string',
-            required: true,
-            message: '请选择项目级别',
-            trigger: ['blur'],
-          },
-          technicalSupportName: {
-            type: 'string',
-            required: true,
-            message: '请输入技术支持人员',
-            trigger: ['blur'],
-          },
-          technicalSupportContent: {
-            type: 'string',
-            required: true,
-            message: '请输入技术支持内容',
-            trigger: ['blur'],
-          },
-          nboBudget: {
-            type: 'number',
-            required: true,
-            message: '请输入项目预算',
-            trigger: ['blur'],
-          },
-          purchasingWayVal: {
-            type: 'string',
-            required: true,
-            message: '请输入采购方式',
-            trigger: ['blur'],
-          },
-          technicalSupportTime: {
-            type: 'string',
-            required: true,
-            message: '请输入采购时间',
-            trigger: ['blur'],
-          },
-          isAdoptDashoo: {
-            type: 'string',
-            required: true,
-            message: '请选择是否采纳大数技术参数',
-            trigger: ['blur'],
-          },
+          nboType: [{ required: true, trigger: ['blur', 'change'], message: '请选择项目类别' }],
+          // C => B
+          nboBudget: [
+            { required: true, trigger: ['blur', 'change'], message: '请输入项目预算' },
+            {
+              validator: (rule, value, callback) => {
+                return parseInt(value) <= 0
+              },
+              trigger: ['blur', 'change'],
+              message: '项目预算应大于0',
+            },
+          ],
+          dealerSalesId: [{ required: true, trigger: ['blur', 'change'], message: '请选择渠道销售' }],
+          dealerSalesName: [{ required: true, trigger: ['blur', 'change'], message: '请选择项渠道销售人员' }],
+          dealerSalesContact: [{ required: true, trigger: ['blur', 'change'], message: '请输入渠道销售电话/微信' }],
+          estTransPrice: [{ required: true, trigger: ['blur', 'change'], message: '请选择预计出货金额' }],
           dashooParamFile: {
             type: 'object',
             required: true,
@@ -487,13 +460,24 @@
             message: '请上传报价单',
             trigger: ['change'],
           },
-          remark: {
-            type: 'string',
-            required: true,
-            message: '请输入转化',
-            trigger: ['blur'],
-          },
+          products: [{ required: true, trigger: ['blur', 'change'], message: '请选择产品' }],
+          // B => A
+          purchasingWay: [{ required: true, trigger: ['blur', 'change'], message: '请选择采购方式' }],
+          capitalSource: [{ required: true, trigger: ['blur', 'change'], message: '请输入资金来源' }],
+          planPurchaseTime: [{ required: true, trigger: ['blur', 'change'], message: '请选择计划采购时间' }],
+          contactId: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户联系人' }],
+          contactName: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户联系人姓名' }],
+          contactTelephone: [{ required: true, trigger: ['blur', 'change'], message: '请输入客户联系人电话/微信' }],
+          makerId: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策人' }],
+          makerName: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策人姓名' }],
+          makerDept: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策部门' }],
+          customerIntentionFactory: [{ required: true, trigger: ['blur', 'change'], message: '请输入客户倾向厂家' }],
+          competitor: [{ required: true, trigger: ['blur', 'change'], message: '请输入竞争公司' }],
+          isAdoptDashoo: [{ required: true, trigger: ['blur', 'change'], message: '请选择是或否' }],
+          projConversionReason: [{ required: true, trigger: ['blur', 'change'], message: '请输入转化原因' }],
+          remark: [{ required: true, trigger: ['blur', 'change'], message: '请输入原因' }],
         },
+        productList: [],
       }
     },
     created() {
@@ -524,14 +508,32 @@
           this.projectDetails = res.data
           this.addForm = Object.assign(this.addForm, this.projectDetails)
           this.addForm.nboType = ''
-          this.addForm.technicalSupportName = ''
-          this.addForm.technicalSupportContent = ''
-          this.addForm.technicalSupportTime = this.parseTime(new Date(), '{y}-{m}-{d}')
-          this.addForm.nboBudgetTime = this.parseTime(new Date(), '{y}-{m}-{d}')
           this.addForm.projConversionReason = ''
           this.addForm.remark = ''
+          this.productList = res.data.products.map((item) => ({
+            id: item.prodId,
+            prodCode: item.prodCode,
+            prodName: item.prodName,
+            prodClass: item.prodClass,
+            guidPrice: item.guidPrice,
+            prodPrice: item.marketPrice,
+            prodNum: 1,
+          }))
+          console.log(this.productList)
+        }
+      },
+      closeProduct(product) {
+        if (product.length > 0) {
+          const combinedArray = [...this.productList, ...product]
+          this.productList = Array.from(new Set(combinedArray.map((item) => item.id))).map((id) => {
+            return combinedArray.find((item) => item.id === id)
+          })
+          console.log(this.productList)
         }
       },
+      removeProductItem(idx) {
+        this.productList.splice(idx, 1)
+      },
       changeLevel(e) {
         if (e == '20') {
           this.addForm.dashooParamFile = ''
@@ -549,11 +551,18 @@
         this.addForm.purchasingWayVal = e.value[0].value
         this.showChasingWay = false
       },
-      // 经销商
-      closeDealer(dealer) {
-        if (dealer) {
-          this.addForm.distributorId = dealer.id
-          this.addForm.distributorName = dealer.name
+      // 经销商代理商联系人
+      closeConcat(user) {
+        this.addForm.dealerSalesId = user.id
+        this.addForm.dealerSalesName = user.name
+        if (user.phone !== '' && user.wechat !== '') {
+          this.addForm.dealerSalesContact = user.phone + '/' + user.wechat
+        }
+        if (user.phone !== '') {
+          this.addForm.dealerSalesContact = user.phone
+        }
+        if (user.wechat !== '') {
+          this.addForm.dealerSalesContact = user.wechat
         }
       },
       selectContact() {
@@ -571,33 +580,16 @@
       // 关闭选择客户联系人
       closeContact(user) {
         if (user) {
-          this.addForm.makerId = user.id
-          this.addForm.makerName = user.cuctName
-          this.addForm.makerDept = user.dept
-          // this.addForm.makerPost = user.postion
-          // this.addForm.makerTelephone = user.telephone
+          this.addForm.contactId = user.id
+          this.addForm.contactName = user.cuctName
         }
       },
-      // 技术支持时间
-      async pickSupportDate(e) {
-        this.showSupportDate = false
-        const timeFormat = uni.$u.timeFormat
-        let timeValue = await timeFormat(e.value, 'yyyy-mm-dd hh:MM')
-        this.addForm.technicalSupportTime = timeValue
-      },
-      // 项目预算时间
-      async pickBudgetDate(e) {
-        this.showBudgetDate = false
-        const timeFormat = uni.$u.timeFormat
-        let timeValue = await timeFormat(e.value, 'yyyy-mm-dd hh:MM')
-        this.addForm.nboBudgetTime = timeValue
-      },
-      // 采购时间
+      //  计划采购时间
       async pickPurchasingDate(e) {
         this.showPurchasingDate = false
         const timeFormat = uni.$u.timeFormat
         let timeValue = await timeFormat(e.value, 'yyyy-mm-dd hh:MM')
-        this.addForm.purchasingTime = timeValue
+        this.addForm.planPurchaseTime = timeValue
       },
       // 选择是否采用大数参数
       chooseRadio(e) {
@@ -691,23 +683,20 @@
         if (!this.flag) return
         let params = this.addForm
         params.nboBudget = Number(params.nboBudget)
+        params.products = this.productList
         this.flag = false
-        if (this.addForm.nboType === '10' || this.addForm.nboType === '20') {
-          this.upgradeAorB(params)
-        } else {
-          const [err, res] = await to(projectApi.upgrade(params))
-          this.flag = true
-          this.showModal = false
-          if (err) return
-          if (res && res.code == 200) {
-            this.$refs.uToast.show({
-              type: 'success',
-              message: '提交成功',
-              complete: () => {
-                this.goBack()
-              },
-            })
-          }
+        const [err, res] = await to(projectApi.upgrade(params))
+        this.flag = true
+        this.showModal = false
+        if (err) return
+        if (res && res.code == 200) {
+          this.$refs.uToast.show({
+            type: 'success',
+            message: '提交成功',
+            complete: () => {
+              this.goBack()
+            },
+          })
         }
       },
       goBack() {
@@ -727,7 +716,41 @@
 <style lang="scss" scoped>
   .home {
     padding-top: 188rpx;
-
+    .step-tit {
+      margin-top: 40rpx;
+      text-align: center;
+      line-height: 60rpx;
+      font-size: 26rpx;
+      color: #000;
+    }
+    .product-wrap {
+      width: 100%;
+      margin-top: 30rpx;
+      height: calc(100% - 150rpx);
+      overflow: auto;
+      padding: 0 10rpx;
+      .product-item {
+        margin: 30rpx 0;
+        padding: 20rpx;
+        border-radius: 10px;
+        box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
+        .product-label {
+          padding: 20rpx 0 20rpx 20rpx;
+        }
+      }
+    }
+    .add-btn {
+      color: #fff;
+      width: 120rpx;
+      height: 60rpx;
+      padding: 0rpx 8rpx;
+      font-size: 12rpx;
+      background: #3c9cff;
+      border-radius: 3px;
+      text-align: center;
+      line-height: 58rpx;
+      font-size: 44rpx;
+    }
     .nav {
       position: absolute;
       left: 0;