Browse Source

销售管理

zxz 3 năm trước cách đây
mục cha
commit
5ab2e75036

+ 3 - 3
src/views/salesManagement/salesPlanAdd.vue

@@ -318,7 +318,7 @@ export default {
       this.$router.go(-1)
     },
     returnsales() {
-      this.$router.push({ path: 'procurementPlanList' })
+      this.$router.push({ path: 'salesPlanList' })
     },
     // 获取当前年月日
     getdate() {
@@ -392,7 +392,7 @@ export default {
             .toPromise()
             .then(response => {
               this.$message.success('添加成功')
-              this.$router.push({ path: 'tranManagementWarehouseInOutTask' })
+              this.$router.push({ path: 'salesPlanList' })
             })
         } else {
           EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
@@ -402,7 +402,7 @@ export default {
     },
     //关闭
     close() {
-      this.$router.push({ path: 'procurementPlanList' })
+      this.$router.push({ path: 'salesPlanList' })
     },
     //提交按钮
     // submit() {

+ 1 - 1
src/views/salesManagement/salesPlanEdit.vue

@@ -323,7 +323,7 @@ export default {
       this.$router.go(-1)
     },
     returnsales() {
-      this.$router.push({ path: 'procurementPlanList' })
+      this.$router.push({ path: 'salesPlanList' })
     },
     // 获取当前年月日
     getdate() {

+ 339 - 112
src/views/salesManagement/salesPlanList.vue

@@ -1,27 +1,11 @@
 //销售计划
 <template>
   <div class="container">
-    <el-row>
-      <el-col :span="12">
-        <h2 class="bg-left title"></h2>
-      </el-col>
-      <el-col :span="12" class="bg-right">
-        <el-button class="bg-bottom" type="primary" size="small" @click="revert()">
-          <img
-            width="6"
-            height="10"
-            style="vertical-align: bottom; margin-right: 3px"
-            src="../../../public/img/lujing.png"
-            alt
-          />返回
-        </el-button>
-      </el-col>
-    </el-row>
     <!-- <div> -->
-    <div>
+    <!-- <div>
       <ws-input
         v-model="searchKeyWord"
-        placeholder="可按照合同编号和任务编号进行查找"
+        placeholder="可按销售计划编号和标题查找"
         clearable
         maxlength="500"
         type="input"
@@ -32,17 +16,44 @@
           width="16"
           height="16"
           style="
+            vertical-align: text-top;
+            position: relative;
+            top: 0px;
+            left: -8px;
+          "
+          src="../../../public/img/sousuo.png"
+          alt
+        />
+      </ws-button>
+    </div> -->
+  
+     <BaseHeaderLayout :leftSpan="10">
+      <template slot="left">  <ws-button type="primary" @click="handleAdd()">添加</ws-button> </template>
+      <!-- 接单开始 -->
+      <template slot="right">
+        <ws-input
+          v-model="searchKeyWord"
+          placeholder="可按销售计划编号和标题查找"
+          clearable
+          maxlength="500"
+          type="input"
+          class="findValue"
+        ></ws-input>
+        <ws-button class="find" type="primary" @click="find()"
+          ><img
+            width="16"
+            height="16"
+            style="
               vertical-align: text-top;
               position: relative;
               top: 0px;
               left: -8px;
             "
-          src="../../../public/img/sousuo.png"
-          alt
-        />
-      </ws-button>
-    </div>
-    <ws-button type="primary" @click="handleAdd()">添加</ws-button>
+            src="../../../public/img/sousuo.png"
+            alt=""
+        /></ws-button>
+      </template>
+    </BaseHeaderLayout>
     <el-table
       class="wenzi"
       :data="warehouseList.records"
@@ -50,14 +61,77 @@
       height="780"
     >
       <el-table-column type="index" label="序号" width="80"></el-table-column>
-      <el-table-column class="table_td" prop="inOutTaskNo" label="销售计划编号"></el-table-column>
-      <el-table-column class="table_td" prop="contractNo" label="标题"></el-table-column>
-      <el-table-column class="table_td" prop="warehouseName" label="货名"></el-table-column>
-      <el-table-column class="table_td" prop="inOutType" label="重量(吨)"></el-table-column>
-      <el-table-column class="table_td" prop="weight" label="基差(元/吨)"></el-table-column>
-      <el-table-column class="table_td" prop="send" label="单价(元/吨)"></el-table-column>
-      <el-table-column class="table_td" prop="predictDate" label="出货库"></el-table-column>
-      <el-table-column prop="taskStatus" label="状态">
+      <el-table-column
+        class="table_td"
+        prop="procurementPlanNo"
+        label="销售计划编号"
+      ></el-table-column>
+      <el-table-column
+        class="table_td"
+        prop="title"
+        label="标题"
+      ></el-table-column>
+      <el-table-column
+        class="table_td"
+        prop="goodsName"
+        label="货名"
+      ></el-table-column>
+      <el-table-column
+        class="table_td"
+        prop="plannedPurchaseVolume"
+        label="重量(吨)"
+      ></el-table-column>
+      <el-table-column class="table_td" prop="basisPrice" label="基差(元/吨)">
+        <template slot-scope="scope">
+          <div v-if="scope.row.procurementPlanType == '期货'">
+            <div class="inputChenge">
+              <el-input
+                v-model="scope.row.basisPrice"
+                @change="varietyClick(scope.row)"
+                class="inputs"
+              ></el-input>
+            </div>
+            <img
+              width="17"
+              height="18"
+              style="vertical-align: text-top; position: relative; top: -1px"
+              src="../../../public/img/edit.png"
+              @click="varietyClick(scope.row)"
+              alt=""
+            />
+          </div>
+          <div v-else>—</div>
+        </template>
+      </el-table-column>
+      <el-table-column class="table_td" prop="unitPrice" label="单价(元/吨)">
+        <template slot-scope="scope">
+          <div v-if="scope.row.procurementPlanType == '现货'">
+            <div class="inputChenge">
+              <!-- readonly -->
+              <el-input
+                v-model="scope.row.unitPrice"
+                v-bind:class="inputs"
+                @change="varietyClick(scope.row)"
+              ></el-input>
+            </div>
+            <img
+              width="17"
+              height="18"
+              style="vertical-align: text-top; position: relative; top: -1px"
+              src="../../../public/img/edit.png"
+              @click="varietyClick(scope.row)"
+              alt=""
+            />
+          </div>
+          <div v-else>—</div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        class="table_td"
+        prop="receiveWarehouse"
+        label="出货库"
+      ></el-table-column>
+      <el-table-column prop="status" label="状态">
         <template slot-scope="scope">
           <el-popover
             placement="left"
@@ -68,17 +142,30 @@
           >
             <template>
               <span slot="reference">
-                <span v-if="scope.row.taskStatus == '展示中'" class="executory"></span>
-                <span v-if="scope.row.taskStatus == '已隐藏'" class="inExecution"></span>
+                <span v-if="scope.row.showFlag == 1">
+                  <span class="executory"></span>展示中</span
+                >
+                <span v-if="scope.row.showFlag == 0">
+                  <span class="inExecution"></span>已隐藏</span
+                >
               </span>
             </template>
             <div>
               <!-- <p style="margin-top: 0; padding-left: 10px">历史记录</p> -->
-              <div v-for="(item, index) in historyList" class="flex" :key="index">
-                <div class="vertical-text vertical-text-left">{{ item.updateDate }}</div>
+              <div
+                v-for="(item, index) in historyList"
+                class="flex"
+                :key="index"
+              >
+                <div class="vertical-text vertical-text-left">
+                  {{ item.updateDate }}
+                </div>
                 <div>
                   <div class="vertical-circle"></div>
-                  <div v-if="index != historyList.length - 1" class="vertical-line"></div>
+                  <div
+                    v-if="index != historyList.length - 1"
+                    class="vertical-line"
+                  ></div>
                 </div>
                 <div class="vertical-text">
                   {{ item.operateUser }}
@@ -88,9 +175,21 @@
               </div>
             </div>
           </el-popover>
+          <img
+            width="17"
+            height="18"
+            style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/edit.png"
+            @click="editClick(scope.row)"
+            alt=""
+          />
         </template>
       </el-table-column>
-      <el-table-column class="table_td" label="更新时间" prop="establishDate"></el-table-column>
+      <el-table-column
+        class="table_td"
+        label="更新时间"
+        prop="updateDate"
+      ></el-table-column>
       <el-table-column prop="seller" label="操作" width="300">
         <template slot-scope="scope">
           <div class="record" @click="handleLook(scope.row)">查看</div>
@@ -104,15 +203,20 @@
       @size-change="handleSizeChange"
       @current-change="handleCurrentChange"
       :current-page="currentPage"
-      :page-size="pageSize"
+      :page-size="deptCircularPage.pageSize"
       layout="total, sizes, prev, pager, next, jumper"
       :total="deptBudgetTotal"
-    ></el-pagination>
+    >
+    </el-pagination>
   </div>
   <!-- </div> -->
 </template>
 <script>
-import { taskList } from '@/model/warehouse/index'
+import {
+  procurementPlan,
+  procurementDel,
+  procurementEditOther,
+} from '@/model/purchasingManagement/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -121,7 +225,7 @@ export default {
   name: 'viewSpareMoney',
   components: {
     WsUpload,
-    Pagination
+    Pagination,
   },
   watch: {
     vesselId(val) {
@@ -129,7 +233,7 @@ export default {
     },
     isShow(val) {
       this.showType = val
-    }
+    },
   },
   data() {
     return {
@@ -147,33 +251,35 @@ export default {
       year: '',
       pickerOptions: {},
       value2: '',
+      handleSizeChange: '',
       deptBudgetTotal: 0,
       currentPage: 1,
-      tranTypeKey: 1,
+      // tranTypeKey: 1,
       pageSize: 10,
       searchType: 1,
       searchTypeText: '未完成',
       searchKeyWord: '',
       contractType: 2,
-
+      pcFlag: 1,
       // 提交类型
       submitType: true,
       size: 10,
       spanArr: [],
       contractNo: '',
-      inOutTaskNo: '',
+      // inOutTaskNo: '',
       compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
       warehouseList: [],
       deptBudgetList: {},
-      pcFlag:1,
+      pcFlag: 1,
       historyList: [],
       pickerBeginDateBefore: {
-        disabledDate: time => {
+        disabledDate: (time) => {
           return time.getTime() > Date.now()
-        }
+        },
       },
-      accessoryTFs: false
+      accessoryTFs: false,
+      inputs: 'inputs1',
     }
   },
   activated() {
@@ -182,20 +288,18 @@ export default {
   },
   methods: {
     getList() {
-      console.log(123456)
-      taskList({
+      procurementPlan({
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         contractType: this.contractType,
         tranTypeKey: this.tranTypeKey,
-        searchType: this.searchType,
         contractNo: this.contractNo,
         pcFlag: this.pcFlag,
-        inOutTaskNo: this.inOutTaskNo
+        searchKeyWord:this.searchKeyWord
       })
         .toPromise()
-        .then(response => {
+        .then((response) => {
           this.warehouseList = response
         })
     },
@@ -203,16 +307,11 @@ export default {
       this.searchType = state
       this.getList()
     },
-    delivery(item) {
+    //编辑
+    handleEdit(row) {
       this.$router.push({
-        path: 'warehouseManagementDelivery',
-        query: {
-          baseId: item.warehouseId,
-          positionId: item.binNumberId,
-          warehouseName: item.warehouseName,
-          binNumber: item.binNumber,
-          capacity: item.capacity
-        }
+        name: 'salesPlanEdit',
+        query: { id: row.id },
       })
     },
     getSpanArr(data) {
@@ -246,15 +345,48 @@ export default {
         }
       })
     },
+    //添加
+    handleAdd() {
+      this.$router.push({
+        name: 'salesPlanAdd',
+      })
+    },
     //查看
     handleLook(row) {
       this.$router.push({
-        path: 'warehouseManagementPutOutLook',
+        name: 'salesPlanLook',
         query: {
-          relevanceId: row.relevanceId
-        }
+          id: row.id,
+        },
       })
     },
+    handleDelete(row) {
+      var handleDelete = ' '
+      if (row.handleDelete == '') {
+      }
+      this.$confirm(`销售计划删除后不可恢复,是否确定删除?`, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+      })
+        .then(() => {
+          procurementDel({ id: row.id })
+            .toPromise()
+            .then((response) => {
+              this.$notify.success({
+                title: '成功',
+                message: '删除成功',
+              })
+              this.getList()
+            })
+            .catch((response) => {
+              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            })
+        })
+        .catch(() => {
+          return false
+        })
+    },
     //返回
     revert() {
       this.$router.push({ path: 'warehouseManagementList' })
@@ -265,7 +397,7 @@ export default {
         'Y+': date.getFullYear().toString(), // 年
         'm+': (date.getMonth() + 1).toString(), // 月
         'd+': date.getDate().toString(), // 日
-        'H+': date.getHours().toString() // 时
+        'H+': date.getHours().toString(), // 时
         // "M+": date.getMinutes().toString(),         // 分
         // "S+": date.getSeconds().toString()          // 秒
         // 有其他格式化字符需求可以继续添加,必须转化成字符串
@@ -296,34 +428,67 @@ export default {
     },
     editClick(row) {
       var status = ''
-      if (row.status == '待审核' || row.status == '已完成') {
-        status = '执行中'
-      } else if (row.status == '执行中') {
-        status = '已完成'
-      }
-      //cancelButtonClass: "btn-custom-cancel"
-      this.$confirm(`是否将状态改为${status}`, {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          alsostate({ id: row.id })
-            .toPromise()
-            .then(response => {
-              this.$notify.success({
-                title: '成功',
-                message: '状态修改成功'
-              })
-              this.getList()
-            })
-            .catch(response => {
-              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-            })
+      var num = 1
+      if (row.showFlag == 1) {
+        status = '已隐藏'
+        num = 0
+        this.$confirm(`隐藏后交易信息不 再展示给客户,是否确定隐藏?`, {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
         })
-        .catch(() => {
-          return false
+          .then(() => {
+            procurementEditOther({
+              flag: 0,
+              showFlag: num,
+              id: row.id,
+            })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '状态修改成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      } else if (row.showFlag == 0) {
+        status = '展示中'
+        num = 1
+        this.$confirm(`确定展示交易信息?`, {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
         })
+          .then(() => {
+            procurementEditOther({
+              flag: 0,
+              showFlag: num,
+              id: row.id,
+            })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '状态修改成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      }
+      //cancelButtonClass: "btn-custom-cancel"
     },
     selecttaskType(e) {
       for (var i = 0; i < this.taskTypeList.length; i++) {
@@ -349,7 +514,7 @@ export default {
     handleExamine(row) {
       this.$router.push({
         name: 'salesContractExamine',
-        query: { id: row.id }
+        query: { id: row.id },
       })
     },
     // 关闭 dialog时 处理文件url 初始化upload组件
@@ -359,13 +524,13 @@ export default {
     history(row) {
       billoperatehis({ id: row.id })
         .toPromise()
-        .then(response => {
+        .then((response) => {
           this.historyList = response
         })
     },
     //查找
     find() {
-      this.currentPage = 1
+      // this.searchKeyWord = 1
       this.getList()
     },
     async exportlist() {
@@ -378,20 +543,77 @@ export default {
           searchType: this.searchType,
           searchKeyWord: this.searchKeyWord,
           startDate: this.startDate,
-          endDate: this.endDate
+          endDate: this.endDate,
         },
         {},
         { responseType: 'blob' }
       ).toPromise()
       downloadFile({
         res: data,
-        fileName: `${this.date.year +
-          (this.date.month ? `-${this.date.month}` : '')}_销售合同`,
-        type: 'xls'
+        fileName: `${
+          this.date.year + (this.date.month ? `-${this.date.month}` : '')
+        }_销售合同`,
+        type: 'xls',
       })
     },
-    total() {}
-  }
+    varietyClick(row) {
+      if (row.procurementPlanType == '期货') {
+        this.$confirm(`确定要修改基差?`, {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+          .then(() => {
+            procurementEditOther({
+              flag: 1,
+              basisPrice: row.basisPrice,
+              id: row.id,
+            })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '状态修改成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      } else if (row.procurementPlanType == '现货') {
+        this.$confirm(`确定要修改单价?`, {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+          .then(() => {
+            procurementEditOther({
+              flag: 2,
+              unitPrice: row.unitPrice,
+              id: row.id,
+            })
+              .toPromise()
+              .then((response) => {
+                this.$notify.success({
+                  title: '成功',
+                  message: '状态修改成功',
+                })
+                this.getList()
+              })
+              .catch((response) => {
+                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      }
+    },
+  },
 }
 </script>
 <style lang="scss" scoped>
@@ -473,9 +695,6 @@ export default {
   height: 12px;
   background: #e9ecf7;
 }
-// .el-row{
-//     height: 150px;
-// }
 .base_header_layout .grid-content {
   margin-top: 80px;
 }
@@ -500,12 +719,15 @@ export default {
 }
 .executory {
   background: #ff9f24;
+  margin-right: 3px;
 }
 .inExecution {
   background: #5878e8;
+  margin-right: 3px;
 }
 .done {
   background: #50cad4;
+  margin-right: 3px;
 }
 .record,
 .adjustment {
@@ -568,7 +790,6 @@ export default {
 .el-button--primary {
   background-color: #5878e8;
   border-color: #5878e8;
-  // margin-left: 85%;
   margin-top: 20px;
 }
 //导航条样式
@@ -589,19 +810,25 @@ export default {
 }
 .but {
   margin-left: 30%;
-  /* margin-top: -32px; */
   overflow: auto;
-  /* float: left; */
-  /* margin-left: 1px; */
   margin-left: -10px;
 }
 .el-input--small {
   font-size: 13px;
   width: 390px;
-  margin-left: 74%;
 }
 /deep/.el-table .el-table__header .cell,
 .el-table .el-table__body .cell {
   text-align: center;
 }
-</style>
+.inputChenge {
+  width: 50%;
+  display: inline-flex;
+}
+.inputs1 {
+  border: none;
+}
+// .inputChenge>>>.el-input__inner{
+// border: none;
+// }
+</style>

+ 2 - 2
src/views/salesManagement/salesPlanLook.vue

@@ -260,7 +260,7 @@ export default {
       this.$router.go(-1)
     },
     returnsales() {
-      this.$router.push({ path: 'procurementPlanList' })
+      this.$router.push({ path: 'salesPlanList' })
     },
     // 获取当前年月日
     getdate() {
@@ -334,7 +334,7 @@ export default {
             .toPromise()
             .then(response => {
               this.$message.success('添加成功')
-              this.$router.push({ path: 'tranManagementWarehouseInOutTask' })
+              this.$router.push({ path: 'salesPlanList' })
             })
         } else {
           EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))