Преглед изворни кода

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

黄梓星 пре 2 година
родитељ
комит
336f49abd3

+ 3 - 0
src/components/DictTag/index.vue

@@ -45,6 +45,9 @@ export default {
       }
     },
   },
+  created(){
+    console.log(this.$props.options,'options');
+  }
 };
 </script>
 <style scoped>

+ 18 - 3
src/components/popover-select/index.vue

@@ -97,9 +97,18 @@ export default {
     };
   },
   computed: {
-    innerValue() {
-      const { value, multiple } = this.$props;
-      return multiple ? "" : value;
+    // innerValue() {
+    //   const { value, multiple } = this.$props;
+    //   return multiple ? "" : value;
+    // },
+    innerValue:{
+      get(){
+        const { value, multiple } = this.$props;
+        return multiple ? "" : value;
+      },
+      set(val){
+        this.$emit("input", val);
+      }
     },
     TableColumnTemp() {
       const { type } = this.$props;
@@ -222,6 +231,11 @@ export default {
         this.selectData = prop;
       }
     },
+    handleClear(){
+      if(!this.$props.multiple){
+        this.innerValue = '';
+      }
+    }
   },
   created() {},
   mounted() {},
@@ -237,6 +251,7 @@ export default {
       :readonly="readonly"
       :clearable="clearable"
       :placeholder="placeholder"
+      @clear="handleClear"
     >
       <el-button
         :disabled="disabled"

+ 5 - 4
src/components/popover-tree-select/index.vue

@@ -97,6 +97,7 @@ export default {
   watch: {
     "$props.value": {
       handler: function (newProp) {
+        console.log("newProp", newProp);
         if (!newProp) this.lastSelectData = [];
       },
       immediate: true,
@@ -310,7 +311,7 @@ export default {
         overflow: hidden;
       "
     >
-      <div v-if="multiple && selectData.length">
+      <div v-if="multiple && lastSelectData.length">
         <el-popover
           :offset="-10"
           :width="width"
@@ -321,10 +322,10 @@ export default {
           placement="bottom-start"
         >
           <el-tag slot="reference" :size="size" style="margin-right: 10px">
-            + {{ selectData.length }}
+            + {{ lastSelectData.length }}
           </el-tag>
           <el-tag
-            v-for="(tag, index) in selectData"
+            v-for="(tag, index) in lastSelectData"
             :size="size"
             hit
             closable
@@ -332,7 +333,7 @@ export default {
               display: 'flex',
               justifyContent: 'space-between',
               alignItems: 'center',
-              margin: selectData.length - 1 === index ? '0' : '0 0 5px 0',
+              margin: lastSelectData.length - 1 === index ? '0' : '0 0 5px 0',
             }"
             @close="useDelete(index)"
           >

+ 1 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -939,7 +939,7 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].contacts = null
       this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = null
       this.basicForm.puDemandItemList[this.tableIndex].address = null
-      this.basicForm.puDemandItemList[this.tableIndex].priceType = null
+      this.basicForm.puDemandItemList[this.tableIndex].priceType = 'order'
       this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = null
       this.basicForm.puDemandItemList[this.tableIndex].lastWarehouse = null
       this.basicForm.puDemandItemList[this.tableIndex].lastAllocation = null

+ 21 - 26
src/views/purchase/purchase-order/add/index.vue

@@ -215,12 +215,12 @@ export default {
     },
     // 取消
     handleCancel() {
-      this.setVisible(false);
       this.params = {
         ...initParams(this.columns),
         puOrderItemList: [],
         puOrderExecuteList: [],
       };
+      this.setVisible(false);
     },
     // 判断保存条件
     judgeSaveCondition(cb){
@@ -269,33 +269,28 @@ export default {
     },
     // 保存并新增
     async handleSubmit() {
-      this.$refs["orderAddForm"].validate(async (valid) => {
-        if (valid) {
-          try {
-            const createById = this.params.buyer;
-            const createByName = this.params.buyerName;
-            const updateById = this.$store.state.user.id;
-            const updateByName = this.$store.state.user.name;
-            const { code, msg } = await orderApi.create({
-              createById,
-              createByName,
-              updateById,
-              updateByName,
-              ...this.params,
-            });
-            if (code === 200) {
-              this.setVisible(false);
-            }
-          } catch (err) {
-            this.$notify.error({ title: "error", message: err });
-          } finally {
-            // this.setVisible(false);
+      this.judgeSaveCondition(async()=>{
+        try {
+          const createById = this.params.buyer;
+          const createByName = this.params.buyerName;
+          const updateById = this.$store.state.user.id;
+          const updateByName = this.$store.state.user.name;
+          const { code, msg } = await orderApi.create({
+            createById,
+            createByName,
+            updateById,
+            updateByName,
+            ...this.params,
+          });
+          if (code === 200) {
+            this.setVisible(false);
           }
-        } else {
-          console.log("error submit!!");
-          return false;
+        } catch (err) {
+          this.$notify.error({ title: "error", message: err });
+        } finally {
+          // this.setVisible(false);
         }
-      });
+      })
     },
     // 子表参照改变之后
     handleReferChange(val, source, type) {

+ 1 - 1
src/views/purchase/purchase-order/edit/index.vue

@@ -152,12 +152,12 @@ export default {
     },
     // 取消
     handleCancel() {
-      this.setVisible(false);
       this.params = {
         ...initParams(this.columns),
         puOrderItemList: [],
         puOrderExecuteList: [],
       }
+      this.setVisible(false);
     },
     // 判断保存条件
     judgeSaveCondition(cb){

+ 6 - 1
src/views/purchase/purchase-order/index.vue

@@ -199,7 +199,6 @@ export default {
         }
 
       } catch (error) {
-
       } finally {
       }
     },
@@ -347,6 +346,7 @@ export default {
                 <el-input v-if="column.inputType === 'Input'" 
                   v-model="params[column.key]" 
                   :placeholder="column.placeholder"
+                  @keyup.enter.native="fetchList(params, page)"
                 ></el-input>
                 <dr-popover-select v-if="column.inputType === 'PopoverSelect'"
                   v-model="params[column.key]"
@@ -359,6 +359,8 @@ export default {
                   :placeholder="column.placeholder"
                   :data-mapping="column.dataMapping"
                   :query-params="column.queryParams"
+                  :clearable="column.clearable"
+                  @keyup.enter.native="fetchList(params, page)"
                 ></dr-popover-select>
                 <!-- @keyup.enter.native="useQuery(params, page)" -->
 
@@ -370,6 +372,7 @@ export default {
                 :multiple="column.multiple"
                 :collapse-tags="column.tags"
                 style="width: 100%"
+                @keyup.enter.native="fetchList(params, page)"
                 >
                 <el-option 
                   v-for="item in dict.type[column.referName]" 
@@ -385,6 +388,7 @@ export default {
                 :clearable="column.clearable" 
                 :placeholder="column.placeholder" 
                 style="width: 100%"
+                @keyup.enter.native="fetchList(params, page)"
                 >
                 <el-option key="N" label="否" value="N"></el-option>
                 <el-option key="Y" label="是" value="Y"></el-option>
@@ -402,6 +406,7 @@ export default {
                 :start-placeholder="column.startPlaceholder"
                 :clearable="column.clearable"
                 style="width: 100%"
+                @keyup.enter.native="fetchList(params, page)"
               >
               </el-date-picker>
               </el-form-item>

+ 7 - 1
src/views/purchase/purchase-order/see/index.vue

@@ -45,11 +45,17 @@ export default {
   computed: {},
   watch: {},
   methods: {
+    
     setVisible(prop) {
+
       this.visible = prop;
+
       if(!this.visible){
+
         this.$refs['orderSeeForm'].clearValidate();
+
       }
+
     },
 
     //查询详情
@@ -68,8 +74,8 @@ export default {
     },
     // 取 消
     handleCancel() {
-      this.setVisible(false);
       this.params = initParams(Columns);
+      this.setVisible(false);
     },
     handleRefresh(){
       let {id} = this.params;

+ 1 - 1
src/views/purchase/task/first-direct/index.vue

@@ -58,7 +58,7 @@ export default {
         if (code === 200) {
           this.hide();
           this.$emit("success");
-          this.$notify.success({ title: msg });
+          this.$notify.success({ title: msg, duration: 0 });
         } else {
           this.$notify.warning({ title: msg });
         }

+ 16 - 13
src/views/purchase/task/index.vue

@@ -47,8 +47,6 @@ export default {
         if (code === 200) {
           this.tableData = rows;
           this.page.total = total;
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         // catch
@@ -58,17 +56,23 @@ export default {
       }
     },
     // 查 询
-    useQuery(prop, page) {
+    async useQuery(prop, page) {
       const { pageNum, pageSize } = page;
-      const { date, documentsCodes } = prop;
-      prop.endDate = date[1];
-      prop.startDate = date[0];
-      prop.documentsCodes = documentsCodes
-        ? documentsCodes.split(",")
-        : undefined;
-      this.fetchList(
-        { ...prop, date: undefined },
-        { pageNum, pageSize, isAsc: "desc", orderByColumn: "createTime" }
+      const {
+        date: [startDate, endDate],
+        documentsCodes,
+      } = prop;
+      await this.fetchList(
+        {
+          ...prop,
+          endDate,
+          startDate,
+          date: undefined,
+          documentsCodes: documentsCodes
+            ? documentsCodes.replace(/\s*/g, "").replaceAll(",", ",")
+            : undefined,
+        },
+        { pageNum, pageSize, isAsc: "desc", orderByColumn: "updateTime" }
       );
     },
     // 重 置
@@ -157,7 +161,6 @@ export default {
               :clearable="column.clearable"
               :placeholder="column.placeholder"
               style="width: 100%"
-              @change="useQuery(params, page)"
               @keyup.enter.native="useQuery(params, page)"
             ></el-input>
             <el-select