Quellcode durchsuchen

修改7/3号剔除的修改问题

gongwencan vor 4 Monaten
Ursprung
Commit
6fabb61b49

+ 3 - 3
src/components/DialogAddTagPurchase.vue

@@ -1,7 +1,7 @@
 <template>
     <el-dialog
       :visible.sync="visible"
-      title="新增标签"
+      title="添加采购"
       append-to-body
       width="750px"
     >
@@ -21,11 +21,11 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="标签数量" prop="number" :rules="[{
+                <el-form-item label="采购数量" prop="number" :rules="[{
                   required: true,
                   message: '请输入标签数量'
                 }]">
-                  <integer-input v-model="number" placeholder="输入标签数量"></integer-input>
+                  <integer-input v-model="number" placeholder="输入采购数量"></integer-input>
                 </el-form-item>
               </el-col>
             </el-row>

+ 23 - 15
src/components/DialogTagApplyDetail.vue

@@ -1,12 +1,12 @@
 <template>
     <el-dialog
       :visible.sync="visible"
-      :title="`订单详情 ${oData && oData.orderNo ? oData.orderNo : ''}`"
+      :title="formattedTitle"
       append-to-body
       width="1200px"
     >
       <div class="flex column" style="padding-bottom:20px;height:580px">
-        <div class="flex valign-center">
+        <div v-if="oData && oData.tagApplyStateId === '0'" class="flex valign-center">
         <el-button
           plain
           icon="el-icon-delete"
@@ -14,11 +14,13 @@
           size="small"
           class="custom-plain-button"
           @click="onBatchDeleteBtnClick"
-          :disabled="selectedList.length === 0 || (oData.tagApplyStateId !='0' && oData.tagApplyStateId != '1')"
+          :disabled="selectedList.length === 0 || oData.tagApplyStateId !='0'"
         >批量删除</el-button>
       </div>
         <div class="flex-1 fit-size" style="padding-top:20px;">
+          <!-- el-table 绑定 visible 是因为 第一列的checkbox 没有按条件隐藏 -->
           <el-table
+            v-if="visible"
             ref="table"
             :data="list"
             stripe
@@ -30,10 +32,10 @@
             @row-click="onRowClick"
           >
           <el-table-column
+            v-if="oData && oData.tagApplyStateId === '0'"
             type="selection"
             width="55"
             align="center"
-             :selectable="tagSelectAble"
             fixed
           ></el-table-column>
             <el-table-column
@@ -44,17 +46,17 @@
               fixed
             ></el-table-column>
             <el-table-column
-              label="商品编码"
-              prop="goodsCode"
+              label="商品名称"
+              min-width="200"
+              prop="goodsName"
               header-align="center"
-              min-width="100"
               align="center"
             ></el-table-column>
             <el-table-column
-              label="商品名称"
-              min-width="200"
-              prop="goodsName"
+              label="商品编码"
+              prop="goodsCode"
               header-align="center"
+              min-width="100"
               align="center"
             ></el-table-column>
             <el-table-column
@@ -86,7 +88,7 @@
               align="center"
             >
                 <template slot-scope="scope">
-                    <el-input v-model="scope.row.number" :class="{ 'input-error': scope.row.number === '' }" @input="handleInput" :disabled="oData.tagApplyStateId !='0' && oData.tagApplyStateId != '1'"></el-input>
+                    <el-input v-model="scope.row.number" :class="{ 'input-error': scope.row.number === '' }" @input="handleInput" :disabled="oData.tagApplyStateId !='0'"></el-input>
                 </template>
             </el-table-column>
             <el-table-column
@@ -111,6 +113,7 @@
                 header-align="left"
               ></el-table-column>
               <el-table-column
+                v-if="oData && oData.tagApplyStateId === '0'"
                 label="操作栏"
                 min-width="80"
                 header-align="center"
@@ -118,14 +121,14 @@
               >
                 <template v-slot="{ row }">
                   <div class="flex center layout-gap">
-                    <edit-button :data="row" :on-click="onDeleteBtnClick" icon="el-icon-delete" :disabled="oData.tagApplyStateId !='0' && oData.tagApplyStateId != '1'">删除</edit-button>
+                    <edit-button :data="row" :on-click="onDeleteBtnClick" icon="el-icon-delete" :disabled="oData.tagApplyStateId !='0'">删除</edit-button>
                   </div>
                 </template>
               </el-table-column>
           </el-table>
         </div>
       </div>
-      <template #footer v-if="oData && (oData.tagApplyStateId === '0'||oData.tagApplyStateId === '1')">
+      <template #footer v-if="oData && oData.tagApplyStateId === '0'">
         <div class="flex center dialog-footer">
           <el-button
             @click="onCloseBtnClick"
@@ -134,7 +137,7 @@
             v-if="oData && oData.tagApplyStateId === '0'"
             type="primary"
             @click="onConfirmOrderBtnClick"
-          >确认订单</el-button>
+          >生成申领订单</el-button>
 
           <el-button
             v-else
@@ -163,6 +166,11 @@ export default {
     visible: false,
     oData: null
   }),
+  computed: {
+    formattedTitle () {
+      return `《${this.oData && this.oData.providerName ? this.oData.providerName : ''}》标签申领详情`
+    }
+  },
   methods: {
     open (data) {
       this.oData = data
@@ -175,7 +183,7 @@ export default {
       this.list = Object.freeze([])
     },
     tagSelectAble () {
-      return this.oData.tagApplyStateId === '0' || this.oData.tagApplyStateId === '1'
+      return this.oData.tagApplyStateId === '0'
     },
     onBatchDeleteBtnClick () {
       const { selectedList } = this

+ 19 - 10
src/components/DialogTagPurchase.vue

@@ -39,16 +39,17 @@
                 :key="index"
                 :gutter="$$Constant.LAYOUT_GAP"
               >
-                <el-col :span="12">
-                  <el-form-item label="标签类型">
-                    <el-input v-model="info.tagTypeName" readonly />
-                  </el-form-item>
+                <el-col :span="12" style="text-align: right; margin-top: 10px;">
+                  <!-- <el-form-item label="">
+                    <el-text v-model="info.tagTypeName" readonly />
+                  </el-form-item> -->
+                  <span>{{ info.tagTypeName }}</span>
                 </el-col>
                 <el-col :span="12">
                   <el-form-item label="标签数量" :prop="`infos[${index}].number`" :rules="[{
                     validator: tagNumberValidator
                   }]">
-                    <integer-input v-model="info.number" placeholder="输入标签数量"></integer-input>
+                    <integer-input v-model="info.number" placeholder="输入标签数量" class="text-right-input"></integer-input>
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -85,14 +86,13 @@ export default {
   methods: {
     tagNumberValidator (rule, value, callback) {
       value = parseFloat(value)
-      if (value <= 0) {
-        return callback(new Error('标签数量不能<=0'))
+      if (value < 0) {
+        return callback(new Error('标签数量不能<0'))
       }
 
-      if (this.data.infos.every(info => !Number.isFinite(parseInt(info.number)))) {
+      if (this.data.infos.every(info => !Number.isFinite(parseInt(info.number) || parseInt(info.number) <= 0))) {
         return callback(new Error('请至少输入一种标签类型的数量'))
       }
-
       return callback()
     },
     onSavePurchaseBtnClick () {
@@ -102,6 +102,11 @@ export default {
         details: this.data.infos.filter(item => item.number > 0).map(item => ({tagTypeId: item.tagTypeId, number: item.number}))
       }
       if (saveData.details.length <= 0) {
+        this.$notify.error({
+          title: '采购失败',
+          message: '请至少输入一种标签类型的数量',
+          position: 'bottom-right'
+        })
         return
       }
       this.$$request(this.api, saveData).then(() => {
@@ -113,4 +118,8 @@ export default {
 }
 </script>
 
-<style lang="scss"></style>
+<style lang="scss">
+.text-right-input .el-input__inner {
+  text-align: right;
+}
+</style>

+ 14 - 11
src/components/DialogTagPurchaseDetail.vue

@@ -1,12 +1,12 @@
 <template>
     <el-dialog
       :visible.sync="visible"
-      :title="`订单详情 ${oData && oData.orderNo ? oData.orderNo : ''}`"
+      :title="`订单详情-编号:${oData && oData.orderNo ? oData.orderNo : ''}`"
       append-to-body
       width="900px"
     >
       <div class="flex column" style="padding-bottom:20px;height:580px">
-        <div class="flex valign-center">
+        <div v-if="oData && oData.tagPurchaseStateId === '0'" class="flex valign-center" >
         <el-button
           plain
           icon="el-icon-plus"
@@ -15,7 +15,7 @@
           class="custom-plain-button"
           @click="onAddTagBtnClick"
           :disabled="oData && oData.tagPurchaseStateId !='0'"
-        >新增标签</el-button>
+        >添加采购</el-button>
         <el-button
           plain
           icon="el-icon-delete"
@@ -24,10 +24,12 @@
           class="custom-plain-button"
           @click="onBatchDeleteBtnClick"
           :disabled="selectedList.length === 0 || oData.tagPurchaseStateId !='0'"
-        >批量删除</el-button>
+        >删除</el-button>
       </div>
         <div class="flex-1 fit-size" style="padding-top:20px;">
+            <!-- el-table 绑定 visible 是因为 第一列的checkbox 没有按条件隐藏 -->
           <el-table
+            v-if="visible"
             ref="table"
             :data="list"
             stripe
@@ -38,13 +40,13 @@
             @selection-change="onSelectionChange"
             @row-click="onRowClick"
           >
-          <el-table-column
-            type="selection"
-            width="55"
-            align="center"
-             :selectable="tagSelectAble"
-            fixed
-          ></el-table-column>
+            <el-table-column
+              v-if="oData && oData.tagPurchaseStateId === '0'"
+              type="selection"
+              width="55"
+              align="center"
+              fixed
+            ></el-table-column>
             <el-table-column
               type="index"
               label="序号"
@@ -85,6 +87,7 @@
                 header-align="right"
               ></el-table-column>
               <el-table-column
+                v-if="oData && oData.tagPurchaseStateId === '0'"
                 label="操作栏"
                 min-width="80"
                 header-align="center"

+ 1 - 1
src/entries/MaterialDetail.js

@@ -31,7 +31,7 @@ export default class MaterialDetail extends BaseCurdEntry {
   }
 
   static $$getQuery = () => ({
-    name: '',
+    materielDescribe: '',
     materielCode: '',
     bigCategoryId: '',
     middleCategoryId: '',

+ 8 - 2
src/entries/TagPurchase.js

@@ -6,10 +6,16 @@ import TagProvider from './TagProvider'
 
 import tagPurchaseApi from '@@/api/TagPurchaseApi'
 
+function getDatePlusOneWeek () {
+  const currentDate = new Date()
+  currentDate.setDate(currentDate.getDate() + 7)
+  return currentDate
+}
+
 export default class TagPurchase extends BaseCurdEntry {
   id
 
-  dataTime = new Date().format('YYYY/MM/DD')
+  dataTime = getDatePlusOneWeek().format('YYYY/MM/DD')
   get formatDataTime () {
     return new Date(this.dataTime).format('YYYY-MM-DD')
   }
@@ -72,7 +78,7 @@ export default class TagPurchase extends BaseCurdEntry {
     this.infos = tagTypeConfig.list.map(tagType => ({
       tagTypeId: tagType[tagTypeTarget.$$idProp],
       tagTypeName: tagType[tagTypeTarget.$$nameProp],
-      number: null
+      number: 0
     }))
   }
 

+ 11 - 11
src/views/MaterialDetail.vue

@@ -1,11 +1,11 @@
 <template>
     <div class="wrapper flex column layout-gap">
       <el-card shadow="hover" class="filter-card">
-        <el-form label-width="100px">
+        <el-form label-width="100px" @submit.native.prevent>
           <el-row :gutter="$$Constant.LAYOUT_GAP">
             <el-col :span="8">
-              <el-form-item label="物料名称">
-               <el-input v-model="query.name" placeholder="输入物料名称" @keyup.enter.native="onSearchBtnClick"></el-input>
+              <el-form-item label="物料描述">
+               <el-input v-model="query.materielDescribe" placeholder="输入物料描述" @keyup.enter.native="onSearchBtnClick"></el-input>
               </el-form-item>
             </el-col>
 
@@ -92,6 +92,14 @@
                 align="center"
                 fixed
               ></el-table-column>
+              <el-table-column
+                label="商品名称"
+                prop="goodsName"
+                min-width="150"
+                header-align="left"
+                align="left"
+                fixed
+              ></el-table-column>
               <el-table-column
                 label="商品编码"
                 prop="goodsCode"
@@ -100,14 +108,6 @@
                 header-align="center"
                 fixed
               ></el-table-column>
-              <el-table-column
-                label="商品名称"
-                prop="name"
-                min-width="150"
-                header-align="left"
-                align="left"
-                fixed
-              ></el-table-column>
               <el-table-column
                 label="物料编码"
                 prop="materielCode"

+ 1 - 1
src/views/ProviderDetail.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="wrapper flex column layout-gap">
       <el-card shadow="hover" class="filter-card">
-        <el-form label-width="80px">
+        <el-form label-width="80px" @submit.native.prevent>
           <el-row :gutter="$$Constant.LAYOUT_GAP">
             <el-col :span="8">
               <el-form-item label="供应商">

+ 1 - 1
src/views/TagApply.vue

@@ -187,7 +187,7 @@
                 <template v-slot="{ row }">
                   <div class="flex center layout-gap">
                     <edit-button :data="row" :on-click="onOpenDetailEditorBtnClick" icon="el-icon-tickets">详情</edit-button>
-                    <edit-button :data="row" :on-click="onDeleteBtnClick" :disabled="row.tagApplyStateId!=='0'&& row.tagApplyStateId!=='1'" icon="el-icon-delete">删除</edit-button>
+                    <edit-button v-if="row.tagApplyStateId==='0'|| row.tagApplyStateId==='1'" :data="row" :on-click="onDeleteBtnClick" icon="el-icon-delete">删除</edit-button>
                   </div>
                 </template>
               </el-table-column>

+ 1 - 1
src/views/TagProviderDetail.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="wrapper flex column layout-gap">
       <el-card shadow="hover" class="filter-card">
-        <el-form label-width="80px">
+        <el-form label-width="80px" @submit.native.prevent>
           <el-row :gutter="$$Constant.LAYOUT_GAP">
             <el-col :span="8">
               <el-form-item label="供应商">