Kaynağa Gözat

修改信息发布

YY 1 yıl önce
ebeveyn
işleme
717284d000
2 değiştirilmiş dosya ile 7 ekleme ve 12 silme
  1. 5 10
      src/views/product/detail.vue
  2. 2 2
      src/views/product/index.vue

+ 5 - 10
src/views/product/detail.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
         <el-col :span="24" class="one">
-          <cSearch :is_back="true" @toBack="toBack"></cSearch>
+          <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
         </el-col>
         <el-col :span="24" class="two">
           <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="onSubmit" @dataChange="dataChange" :disabled="disabled" :isSave="!disabled">
@@ -28,9 +28,6 @@
             <template #type>
               <el-option v-for="(i, index) in product_typeList" :key="index" :label="i.label" :value="i.value"></el-option>
             </template>
-            <template #status>
-              <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
-            </template>
             <template #roadshow="{ item }">
               <cUpload :model="item.model" :limit="1" url="/files/zkzx/product/upload" :list="form[item.model]" @change="onUpload"></cUpload>
             </template>
@@ -112,8 +109,7 @@ let formFields: Ref<any[]> = ref([
   { label: '联系人', model: 'contact' },
   { label: '手机号', model: 'phone' },
   { label: '电子邮箱', model: 'email' },
-  { label: 'qq&微信', model: 'qqwx' },
-  { label: '状态', model: 'status', type: 'select' }
+  { label: 'qq&微信', model: 'qqwx' }
 ]);
 const rules = reactive<FormRules>({
   type: [{ required: true, message: '请选择类型' }]
@@ -145,7 +141,8 @@ const search = async () => {
       else if (form.value.type == '1') valueTwo(); // 技术成果
       else if (form.value.type == '2') valueThr(); // 商务服务
     }
-  } else form.value = { status: '0', user_id: user.value._id };
+  } else
+    form.value = { user_id: user.value._id, patent: [], company: user.value.name, contact: user.value.name, phone: user.value.phone, email: user.value.email };
 };
 const dataChange = (e: { model: string; value: any }) => {
   const { model, value } = e;
@@ -182,7 +179,6 @@ const valueOne = () => {
     { label: '需求现状', model: 'present' },
     { label: '合作条件及要求', model: 'condition' },
     { label: '产品图片(6)', model: 'file', custom: true }
-    // { label: '状态', model: 'status', type: 'select' }
   ];
 };
 // 技术成果
@@ -209,7 +205,6 @@ const valueTwo = () => {
     { label: '商业预期', model: 'expect' },
     { label: '合作条件及要求', model: 'condition' },
     { label: '产品图片(6)', model: 'file', custom: true }
-    // { label: '状态', model: 'status', type: 'select' }
   ];
 };
 // 商务服务
@@ -228,7 +223,6 @@ const valueThr = () => {
     { label: '核心要素', model: 'coreelements' },
     { label: '价格信息', model: 'priceinfo' },
     { label: '商业预期', model: 'expect' }
-    // { label: '状态', model: 'status', type: 'select' }
   ];
 };
 const onUpload = (e: { model: string; value: Array<[]> }) => {
@@ -237,6 +231,7 @@ const onUpload = (e: { model: string; value: Array<[]> }) => {
 };
 // 提交
 const onSubmit = async (data) => {
+  data.status = '0';
   let res: IQueryResult;
   if (data._id) res = await product.update(data);
   else res = await product.create(data);

+ 2 - 2
src/views/product/index.vue

@@ -64,8 +64,8 @@ let fields: Ref<any[]> = ref([
 let opera: Ref<any[]> = ref([
   { label: '查看', method: 'view', type: 'success' },
   { label: '发布', method: 'exam', confirm: true, type: 'warning', display: (i) => i.status == '0' },
-  { label: '修改', method: 'edit', display: (i) => i.status == '0' },
-  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+  { label: '修改', method: 'edit', display: (i) => i.status == '0' || i.status == '3' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger', display: (i) => i.status == '0' || i.status == '2' || i.status == '3' }
 ]);
 // 查询数据
 let searchForm: Ref<any> = ref({});