caojunjie 2 éve
szülő
commit
247bd8eb41

+ 1 - 1
src/components/goodsTypeQX/index.vue

@@ -96,7 +96,7 @@ export default {
     },
     //修改时的修改按钮点击触发
     rowUpdate(row, index, done, loading) {
-      typeSave(row).then(
+      goodsTypeProjectSubmit(row).then(
         () => {
           this.$message({
             type: "success",

+ 237 - 137
src/views/EquipmentArchives/detailsPage.vue

@@ -33,14 +33,7 @@
             <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
               :disabled="detailData.status == 1" circle></el-button>
           </template>
-          <template slot="cname" slot-scope="{ row, index }">
-            <el-select v-if="row.$cellEdit" v-model="row.cname" placeholder="请选择" size="small" filterable
-              @change="cnameChange(row, index)">
-              <el-option v-for="item in goodsoptions" :key="item.itemId" :label="item.cname" :value="item.cname">
-              </el-option>
-            </el-select>
-            <span v-else>{{ row.cname }}</span>
-          </template>
+
             <template slot="code" slot-scope="{ row, index }">
                 <el-input v-if="row.$cellEdit" v-model="row.code"
                                  placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input>
@@ -48,7 +41,7 @@
             </template>
 
           <template slot="menu" slot-scope="{ row, index }">
-              <el-button size="small" type="text" :disabled="detailData.status == 1" @click="imgurlfun(row)">图片
+              <el-button size="small" type="text" @click="imgurlfun(row)">信息码
               </el-button>
             <el-button size="small" type="text" :disabled="detailData.status == 1" @click="rowCell(row, index)">{{
                 row.$cellEdit ? "保存" : "修改"
@@ -59,10 +52,10 @@
         </avue-crud>
       </trade-card>
 
-      <containerTitle title="上传附件"></containerTitle>
-      <c-upload v-loading="loadingBtn" typeUpload="CD"
-        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="orderFilesList" display
-        :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
+      <!--<containerTitle title="上传附件"></containerTitle>-->
+      <!--<c-upload v-loading="loadingBtn" typeUpload="CD"-->
+      <!--  deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="orderFilesList" display-->
+      <!--  :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>-->
       <dictbiz-dialog ref="dictbiz" title="添加单位" code="unit" parentId="1585962784498225154" @closed="getAllWorkDicts">
       </dictbiz-dialog>
 
@@ -71,7 +64,7 @@
 
         <!--图片查看-->
         <el-dialog
-            title="提示"
+            title="信息码"
             :visible.sync="imgfalse"
             width="50%"
             append-to-body
@@ -80,19 +73,65 @@
                 <img :src="imgtext" alt="">
             </div>
         </el-dialog>
+
+        <el-dialog title="导入项目" append-to-body class="el-dialogDeep" :visible.sync="productVisible" width="80%"
+                   :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
+            <el-row>
+                <el-col :span="5" style="height: 100%;overflow-y: auto">
+                    <div>
+                        <el-scrollbar>
+                            <basic-container>
+                                <avue-tree :option="productOption" :data="productDataGoods" @node-click="productnodeClick" />
+                            </basic-container>
+                        </el-scrollbar>
+                    </div>
+                </el-col>
+                <el-col :span="19">
+                    <basic-container>
+                        <avue-crud ref="productCrud" :option="optionTwo" :data="productListShow" :page.sync="productPage"
+                                   :search.sync="productSearch" @selection-change="productSelection" @search-change="goodsSearch"
+                                   @current-change="productCurrent" @size-change="productSize"
+                                   @refresh-change="productRefresh" @on-load="productonLoad" :table-loading="loading"
+                                   @saveColumn="productSave" @resetColumn="productReset" :cell-style="cellStyle">
+                            <template slot="menuLeft" slot-scope="{size}">
+                                <el-tabs v-model="activeName" @tab-click="tabHandle">
+                                    <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
+                                    <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
+                                </el-tabs>
+                            </template>
+                            <template slot-scope="scope" slot="menu">
+                                <el-button type="text" icon="el-icon-edit" size="small"
+                                           @click.stop="importStagList(scope.row, scope.index)" v-if="activeName == 'searchList'"
+                                           :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
+                                </el-button>
+                                <el-button type="text" icon="el-icon-delete" size="small"
+                                           @click.stop="removeStagList(scope.row, scope.index)" v-else>移除
+                                </el-button>
+                            </template>
+                        </avue-crud>
+                    </basic-container>
+                </el-col>
+            </el-row>
+            <span slot="footer" class="dialog-footer">
+            <el-button @click="productVisible = false">取 消</el-button>
+              <el-button type="primary" @click="importGoods">导入</el-button>
+          </span>
+        </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
 import { optionList } from "./js/optionList";
+import { optionTwo } from "./js/optionListTwo";
 import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment, getStoragelist } from "@/api/basicData/salesOrder";
 import reportDialog from "@/components/report-dialog/main";
 import { multiply, sum, subtract } from "@/util/calculate";
 import { getList as KHgetList} from "@/api/basicData/client";
+import { getList } from "@/api/basicData/product";
 import {getList as getListpp } from "@/api/tirePartsMall/basicData/brandPage";
 import {
-    goodsTypeProjectListAll,
+    projectGoodsSubmit
 } from "@/api/basicData/ServiceLtems";
 import {
     corpequipmentarchivesDetail,
@@ -108,7 +147,6 @@ export default {
         imgfalse:false,
         imgtext:'',
       switchDialog: false,
-      activeName: 'first',
       loadingBtn: false,
       addressTitle: null,
       form: {},
@@ -331,7 +369,43 @@ export default {
       optionList: {},
         // 商品产品下拉数据
       goodsoptions: [],
-      orderFilesList: []
+        // 附件
+      orderFilesList: [],
+
+        // 导入项目的弹窗
+        productVisible:false,
+        // 产品左侧类别
+        productOption: {
+            addBtn: false,
+            menu: false,
+            size: "small",
+            props: {
+                labelText: "标题",
+                label: "title",
+                value: "value",
+            }
+        },
+        // 产品左侧是数据
+        productDataGoods:[],
+        // 产品弹窗列表
+        optionTwo:optionTwo,
+        productPage:{
+            pageSize: 20,
+            currentPage: 1,
+            total: 0,
+            pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+        },
+        productListShow:[],
+        // 暂存的数据
+        goodsListSave:[],
+        // 产品弹窗tabs切换
+        activeName:'searchList',
+        // 弹窗选中的数据
+        tableData:[],
+        productSearch:{},
+
+        loading:false,
+
     };
   },
   props: {
@@ -356,9 +430,9 @@ export default {
       this.option2.disabled = true;
     }
       // 获取产品数据
-    getAllgoods().then(res => {
-      this.goodsoptions = res.data.data
-    });
+    // getAllgoods().then(res => {
+    //   this.goodsoptions = res.data.data
+    // });
   },
   methods: {
       // 打印报表按钮事件
@@ -381,40 +455,6 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
-      // 选择产品回调
-    cnameChange(row) {
-      if (row.cname) {
-        this.goodsoptions.forEach(e => {
-          if (e.cname == row.cname) {
-            row.itemId = e.id
-            row.storageInQuantity = 1
-            row.purchasePrice = e.purchasePrice
-            row.storageAmount = e.purchasePrice
-            row.goodsTypeId = e.goodsTypeId
-              row.goodsTypeName = e.goodsTypeName
-              row.specs = e.specs
-              row.brand = e.brand
-            row.remarks = e.remarks
-              row.exitDate = e.exitDate
-              row.repairReportDate = row.repairReportDate
-          }
-        })
-      } else {
-        row.itemId = null
-        row.storageInQuantity = null
-        row.purchasePrice = null
-        row.storageAmount = null
-          row.goodsTypeId = null
-          row.goodsTypeName = null
-          row.specs = null
-          row.brand = null
-          row.remarks = null
-          row.exitDate = null
-          row.repairReportDate = null
-      }
-
-      // this.countChange(row)
-    },
 
     amountChange() {
       let val = 0
@@ -441,7 +481,7 @@ export default {
         .then(res => {
           this.form = res.data.data;
           this.data = res.data.data.corpEquipmentArchivesItemList;
-          this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
+          // this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
         })
         .finally(() => {
           this.loadingBtn = false;
@@ -462,7 +502,12 @@ export default {
        this.$refs["form"].validate((valid, done) => {
           done();
           if (valid) {
-             this.data.push({ $cellEdit: true, storageId: this.form.storageId })
+             // this.data.push({ $cellEdit: true, storageId: this.form.storageId })
+              this.tableData = []
+              this.goodsListSave = []
+              // 获取产品弹窗的左侧类型
+              this.getGoodstypefun()
+              this.productVisible = true
           } else {
              return false;
           }
@@ -547,29 +592,28 @@ export default {
                 }
             })
             const obj = {
+                id:this.form.id?this.form.id:null,
                 corpId:this.form.corpId,
                 corpName:this.form.corpName,
                 sysNo:null,
                 equipmentNumber:this.data.length,
-                maintenanceSecond:0,
+                maintenanceSecond:this.form.maintenanceSecond?this.form.maintenanceSecond:0,
                 signingDateStart:this.form.signingDateStart,
                 signingDateEnd:this.form.signingDateEnd,
                 remarks:this.form.remarks,
                 corpEquipmentArchivesItemList:arr
             }
             this.loadingBtn = true;
-            console.log(obj,519)
             // 附件
-            console.log(this.orderFilesList,522)
+            // console.log(this.orderFilesList,522)
           corpequipmentarchivesSubmit({
               ...obj,
-              orderFilesList: this.orderFilesList
           })
             .then(res => {
               this.$message.success("保存成功");
               this.form = res.data.data;
               this.data = res.data.data.corpEquipmentArchivesItemList;
-              this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
+              // this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
               this.detailData.status = 1
               this.option.disabled = true;
               this.option2.disabled = true;
@@ -593,78 +637,8 @@ export default {
         this.imgtext = ''
           this.imgfalse = false
       },
-    fixSave() {
-      this.$refs["form"].validate((valid, done) => {
-        done();
-        if (valid) {
-          if (this.data.length == 0) {
-            return this.$message.error('请添加一条商品信息');
-          }
-          this.loadingBtn = true;
-          fixSave({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList, orderFilesList: this.orderFilesList })
-            .then(res => {
-              this.$message.success("修改成功");
-              this.form = res.data.data;
-              this.data = res.data.data.orderItemsList;
-              this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
-            })
-            .finally(() => {
-              this.loadingBtn = false;
-            });
-        } else {
-          return false;
-        }
-      });
-    },
-    submit() {
-      this.$refs["form"].validate((valid, done) => {
-        done();
-        if (valid) {
-          if (this.data.length == 0) {
-            return this.$message.error('请添加一条商品信息');
-          }
-          this.loadingBtn = true;
-          submit({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList, orderFilesList: this.orderFilesList })
-            .then(res => {
-              this.$message.success("提交成功");
-              this.form = res.data.data;
-              this.data = res.data.data.orderItemsList;
-              this.orderFilesList = res.data.data.orderFilesList ? res.data.data.orderFilesList : [];
-              this.$emit("goBack");
-            })
-            .finally(() => {
-              this.loadingBtn = false;
-            });
-        } else {
-          return false;
-        }
-      });
-    },
-    revoke() {
-      this.$confirm('此操作将会撤销单子, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.loadingBtn = true;
-        revoke({ ...this.form, billType: 'CG', tradeType: 'YPJ', orderItemsList: this.data, settlementList: this.settlementList })
-          .then(res => {
-            this.$message.success("撤销成功");
-            this.form = res.data.data;
-            this.data = res.data.data.orderItemsList;
-            this.openEdit()
-          })
-          .finally(() => {
-            this.loadingBtn = false;
-          });
-      }).catch(() => {
-      });
-    },
     async saveColumn() {
-      const inSave = await this.saveColumnData(
-        this.getColumnName(214),
-        this.optionList
-      );
+      const inSave = optionList
       if (inSave) {
         this.$nextTick(() => {
           this.$refs.crud.doLayout();
@@ -676,10 +650,7 @@ export default {
     },
     async resetColumn() {
       this.optionList = optionList;
-      const inSave = await this.delColumnData(
-        this.getColumnName(214),
-        optionList
-      );
+      const inSave = optionList
       if (inSave) {
         this.$nextTick(() => {
           this.$refs.crud.doLayout();
@@ -698,7 +669,136 @@ export default {
     //返回列表
     backToList() {
       this.$emit("goBack");
-    }
+    },
+      // ---------------------------------产品弹窗----------------------------------------
+      // 产品弹窗导入
+      importGoods(){
+          if (this.goodsListSave.length > 0) {
+              console.log(this.goodsListSave,'445')
+              for (let item of this.goodsListSave) {
+                  this.data.push({
+                      $cellEdit: true,
+                      storageId: this.form.storageId,
+                      ...item
+                  })
+              }
+          }else {
+              console.log('475')
+              for (let item of this.tableData) {
+                  this.data.push({
+                      $cellEdit: true,
+                      storageId: this.form.storageId,
+                      ...item
+                  })
+              }
+          }
+          this.productVisible = false
+      },
+      // 产品选择左侧数据
+      productnodeClick(data){
+          this.productSearch.goodsTypeId = data.value
+          this.productPage.currentPage = 1;
+          this.productonLoad(this.productPage, this.productSearch);
+      },
+      // 产品弹窗的列表数据获取
+      productonLoad(page, params = {}){
+          let data = this.deepClone(Object.assign(params, this.productSearch));
+          this.loading = true;
+          getList(
+              page.currentPage,
+              page.pageSize,
+              data
+          ).then(res=>{
+              // this.productListShow = res.data.data.records ? res.data.data.records : [];
+              this.productListShow = res.data.data.records
+              this.productPage.total = res.data.data.total;
+              this.$nextTick(() => {
+                  this.$refs.productCrud.doLayout();
+              });
+          }).finally(() => {
+              this.loading = false;
+          });
+      },
+      // 标签页切换
+      tabHandle(data) {
+          if (data.name == 'searchList') {
+              this.productListShow = this.data;
+              // this.productSearch.total = this.pageList.total
+              this.productonLoad(this.productPage,this.productSearch);
+          } else if (data.name == 'importStaging') {
+              this.productListShow = this.goodsListSave;
+              this.productSearch.total = 0
+          }
+      },
+      // 获取产品左侧数据
+      getGoodstypefun(){
+          getGoodstype().then(res => {
+              this.productDataGoods = res.data.data;
+              // this.findObject(this.option2.column, "parentId").dicData = res.data.data;
+          });
+      },
+      // 弹窗选中的数据
+      importStagList(row, index) {
+          this.goodsListSave.push(row);
+      },
+      // 产品弹窗移除
+      removeStagList(row, index) {
+          this.goodsListSave.splice(row.$index, 1)
+      },
+      // 产品弹窗刷新触发
+      productRefresh(){
+          // this.treeDeptId = '';
+          this.productPage.currentPage = 1;
+          this.productonLoad(this.productPage,this.productSearch);
+      },
+      // 产品弹窗选择触发
+      productSelection(list) {
+          this.tableData = list
+      },
+      // 产品弹窗搜索按钮触发
+      goodsSearch(params, done) {
+          // this.treeDeptId = '';
+          this.productonLoad(this.productPage,params);
+          done()
+      },
+      // 产品弹窗分页
+      productCurrent(val){
+          this.productPage.currentPage = val;
+      },
+      productSize(val){
+          this.productPage.currentPage = 1;
+          this.productPage.pageSize = val;
+      },
+      // 产品弹窗的重置和保存
+      productSave(){
+          const inSave = optionTwo
+          if (inSave) {
+              this.$nextTick(() => {
+                  this.$refs.productCrud.doLayout();
+              });
+              this.$message.success("保存成功");
+              //关闭窗口
+              this.$refs.productCrud.$refs.dialogColumn.columnBox = false;
+          }
+      },
+      productReset(){
+          this.optionTwo = optionTwo;
+          const inSave = option
+          if (inSave) {
+              this.$nextTick(() => {
+                  this.$refs.productCrud.doLayout();
+              });
+              this.getAllWorkDicts()
+              this.$message.success("重置成功");
+              this.$refs.productCrud.$refs.dialogColumn.columnBox = false;
+          }
+      },
+      // 关闭弹窗的回调
+      closeGoods() {
+          this.productDataGoods = [];
+          // this.treeDeptId = "";
+          this.activeName = "searchList";
+      },
   },
   watch: {
     // data: function (rows) {

+ 94 - 0
src/views/EquipmentArchives/js/optionListTwo.js

@@ -0,0 +1,94 @@
+import { number } from "echarts"
+
+export const optionTwo = {
+  searchShow: true,
+  searchMenuSpan: 8,
+  align: "center",
+  searchSpan: 8,
+  tip: false,
+  border: true,
+  index: true,
+  addBtn: false,
+  viewBtn: false,
+  editBtn: false,
+  delBtn: false,
+  menuWidth: 70,
+  searchIcon: true,
+  searchIndex: 2,
+  selection:true,
+  column: [
+    {
+      label: "商品名称",
+      prop: "cname",
+      // type: "select",
+      // dicUrl:"/api/blade-client/goodsdesc/descListByCname?cname={{key}}",
+      // filterable:true,
+      // remote:true,
+      // props: {
+      //   label: "cname",
+      //   value: "cname"
+      // },
+      search: true,
+      overHidden: true,
+      index: 1
+    },
+    {
+      label: "产品分类",
+      prop: "goodsTypeName",
+      overHidden: true,
+      index: 2
+    },
+    {
+      label: "单位",
+      prop: "unit",
+      type: "select",
+      filterable:true,
+      props: {
+        label: "dictValue",
+        value: "dictValue"
+      },
+      dicData:[],
+      search: true,
+      overHidden: true,
+      index: 4
+    },
+    {
+      label: "参考售价",
+      prop: "standardPrice",
+      overHidden: true,
+      index: 5
+    },
+    {
+      label: "厂家",
+      prop: "corpId",
+      type: "select",
+      props: {
+        label: "cname",
+        value: "id"
+      },
+      dicData: [],
+      span: 6,
+      index: 13
+    },
+    {
+      label: "规格",
+      prop: "specs",
+      span: 6,
+      index: 15
+    },
+    {
+      label: "品牌",
+      prop: "brand",
+      span: 6,
+      index: 16
+    },
+
+    {
+      label: "备注",
+      prop: "remarks",
+      search: true,
+      overHidden: true,
+      index: 17
+    }
+  ]
+}

+ 0 - 3
src/views/ServiceLtems/index.vue

@@ -87,9 +87,6 @@
           <span slot="footer" class="dialog-footer">
             <el-button @click="productVisible = false">取 消</el-button>
               <el-button type="primary" @click="importGoods">导入</el-button>
-            <!--<el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>-->
-            <!--<el-button type="primary" @click="importChoice" v-if="commodityData === true"-->
-            <!--       :disabled="tableData.length !== 1">导入</el-button>-->
           </span>
       </el-dialog>
 

+ 9 - 0
src/views/product/detailsPage.vue

@@ -490,6 +490,15 @@ export default {
     }
     if (this.detailData.id) {
       this.getDetail(this.detailData.id);
+    }else {
+        let arr = localStorage.getItem('roleName').split(',')
+        // this.whetherIntegralChange(this.form.whetherIntegral)
+        if (arr.indexOf('admin') != -1) {
+            this.findObject(this.option.column, "storeIntegral").disabled = false
+            this.findObject(this.option.column, "referenceIntegral").disabled = false
+            this.findObject(this.option.column, "salesmanIntegral").disabled = false
+            this.findObject(this.option.column, "integral").disabled = false
+        }
     }
     if (this.detailData.status == 1) {
       this.option.disabled = true;