shish 2 yıl önce
ebeveyn
işleme
f5377de118
2 değiştirilmiş dosya ile 1296 ekleme ve 1024 silme
  1. 218 1024
      ghs/src/views/in/add.vue
  2. 1078 0
      ghs/src/views/in/confirm.vue

Dosya farkı çok büyük olduğundan ihmal edildi
+ 218 - 1024
ghs/src/views/in/add.vue


+ 1078 - 0
ghs/src/views/in/confirm.vue

@@ -0,0 +1,1078 @@
+<template>
+  <div v-if="form.ghsId == 0" style="text-align:left;margin-top:10vh;margin-left:10vw;">
+    <span style="font-size:20px;">供货商</span>
+    <el-select @change="selectGhsFn" v-model="selectGhsName" filterable remote reserve-keyword placeholder="输入拼音首字母,光标插入 Ctrl + C" clearable ref="ghsRef" @blur="getGhsBlur"
+				:remote-method="selectGhsInfo" :loading="loading" style="width:300px;margin-left:20px;" size="big">
+    				<el-option v-for="item in customInfoList" :key="item.id" :label="`${item.name}`" :value="item"></el-option>
+  				</el-select>
+
+          <el-button :type="location == 0?'primary':''" @click="location=0" size="medium" style="margin-left:50px;" round>上游</el-button>
+					<el-button :type="location == 1?'primary':''" @click="location=1" size="medium" round>本地</el-button>
+          <el-button type="primary" @click="addGhs()" style="margin-left:20px;" size="medium">添加</el-button>
+  </div>
+  <div class="app-list-content" v-else>
+    <div class="left_box">
+      <p class="tor">
+        <span style="color:black;font-weight:bold;">供货商:{{form.ghsName}}</span>
+        <span>全屏:F11</span>
+        <span>修改:回车</span>
+        <span>删除:Delete</span>
+        <span>删除所有:Page Down</span>
+      </p>
+      <audio ref="hitPlay"><source src="@/static/hit.mp3" type="audio/mpeg"></audio>
+      <audio ref="noStockPlay"><source src="@/static/noStock.mp3" type="audio/mpeg"></audio>
+      <audio ref="successPlay"><source src="@/static/success1.mp3" type="audio/mpeg"></audio>
+      <el-table ref="singleTable" :data="selectList" highlight-current-row border :header-cell-style="{background:'#fdfdfd', color: '#01060a', fontWeight:800}" 
+      class="tableBox active" @row-click="pickModifyItem" height="70vh" style="width:70vw;margin:0 auto;">
+        <el-table-column prop="id" label="编号" width="110" align="center"></el-table-column>
+
+        <el-table-column prop="cover" label="图片" align="center" width="110">
+          <template slot-scope="scope">
+            <img :src="scope.row.cover" style="width:40px;margin:0 auto;" />
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="name" label="名称" align="center"></el-table-column>
+        <el-table-column prop="bigCount" label="数量" width="110" align="center">
+          <template slot-scope="scope">
+            <span v-if="cgUnitType == 0">
+              {{ scope.row.bigCount }}{{ scope.row.bigUnit }}
+            </span>
+            <span v-else>
+              {{ scope.row.smallCount }}{{ scope.row.smallUnit }}
+            </span>
+          </template>          
+        </el-table-column>
+        <el-table-column prop="userPrice" label="单价" width="110" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.aboutPrice == 1 ? '约' : '' }} {{ scope.row.userPrice }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="sumPrice" label="金额" width="110" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.totalPrice }}
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="ratioType" label="单位比" align="center" width="110">
+          <template slot-scope="scope">
+            <span v-if="scope.row.ratioType == 0">{{ scope.row.ratio }}{{ scope.row.smallUnit }}/{{ scope.row.bigUnit }}</span>
+            <span v-else>若干{{ scope.row.smallUnit }}/{{ scope.row.bigUnit }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="addTime" label="操作" align="center" width="110">
+          <template slot-scope="scope">
+            <el-button type="primary" size="mini" @click.stop="delItem(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+
+      </el-table>
+    </div>
+    <div class="seek-list-box" v-if="!$util.isEmpty(getItemList) && showGetItemList == true">
+      <el-table ref="showItemRef" :data="getItemList" highlight-current-row style="width:60vw" border :header-cell-style="{background:'#fdfdfd', color: '#666'}" 
+      class="tableBox active" height="70vh" @row-click="pickAddItem">
+        <el-table-column prop="className" label="分类" align="center" width="130"></el-table-column>
+        <el-table-column prop="cover" label="图片" align="center" width="110">
+          <template slot-scope="scope">
+            <img :src="scope.row.cover" style="width:26px;margin:0 auto;" />
+          </template>
+        </el-table-column>
+        <el-table-column prop="name" label="名称" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.name }}
+            <span v-if="scope.row.selectedNum && Number(scope.row.selectedNum)>0" style="color:blue;font-weight:bold;">
+              (已选{{ scope.row.selectedNum }}{{ cgUnitType == 0 ? scope.row.bigUnit : scope.row.smallUnit }})
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="price" label="价格" width="100" align="center">
+          <template slot-scope="scope">
+            <span>¥{{ scope.row.price?parseFloat(scope.row.price):0 }}</span>
+          </template>          
+        </el-table-column>
+        <el-table-column prop="stock" label="库存" width="100" align="center">
+          <template slot-scope="scope">
+            <span style="color:green;font-weight:bold;">{{ scope.row.stock?parseFloat(scope.row.stock):0 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="ratioType" label="单位比" align="center" width="110">
+          <template slot-scope="scope">
+            <span v-if="scope.row.ratioType == 0">{{ scope.row.ratio }}{{ scope.row.smallUnit }}/{{ scope.row.bigUnit }}</span>
+            <span v-else>若干{{ scope.row.smallUnit }}/{{ scope.row.bigUnit }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="selectedNum" label="已选数量" align="center" width="120">
+          <template slot-scope="scope">
+            <span v-if="scope.row.selectedNum && Number(scope.row.selectedNum)>0" style="color:blue;font-weight:bold;font-size:15px;">
+            {{ scope.row.selectedNum }}{{ cgUnitType == 0 ? scope.row.bigUnit : scope.row.smallUnit }}
+            </span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div class="bottom_input">
+        <span style="margin-right:10px;font-weight: 700;">花材</span>
+        <el-input style="width: 280px;font-size:13px" @input="beginSearchItem" @keyup.enter.native="pickAddCurrentItem" @focus="clearSeachVal" placeholder="这里搜索,光标插入 Ctrl + Q" type="text" ref="itemSearchRef" v-model="searchVal"></el-input>
+        <div style="display: inline-block;" class="allPrice">{{allCount.kind}}种</div>
+        <div style="display: inline-block;" class="allPrice">{{ allCount.bigLength }}扎</div>
+        <div style="display: inline-block;" class="allPrice">¥{{ allPrice }}</div>
+        <el-button type="primary" size="medium" style="margin-left:50px;" @click="commitOrder()">提交(Ctrl + / )</el-button>
+        <el-button size="medium" style="margin-left:50px;" @click="comeBack()">返回</el-button>
+    </div>
+
+    <el-dialog :title="currentItem.name" :visible.sync="showConfirmNum" width="30%" center>
+      <div class="el-dialog-center">
+
+        <template v-if="cgUnitType == 0">
+          <el-input ref="countInput" style="width: 90px;margin-left: 15px;text-align:center;" placeholder="数量" @keyup.enter.native="confirmNumPrice()" @input="bigCountChange"
+          type="number" v-model="customData.bigCount"></el-input>
+          <span style="padding:0 0 0 4px;">{{currentItem.bigUnit}}</span>
+        </template>
+        <template v-else>
+          <el-input ref="countInput" style="width: 90px;margin-left: 15px;text-align:center;" placeholder="数量" @keyup.enter.native="confirmNumPrice()" @input="smallCountChange"
+          type="number" v-model="customData.smallCount"></el-input>
+          <span style="padding:0 0 0 4px;">{{currentItem.smallUnit}}</span>
+        </template>
+
+        <span style="padding:0 2px 0 15px;color:red;font-weight:bold;"v-if="customData.aboutPrice == 1">约</span>
+        <span style="padding:0 2px 0 15px;color:green;font-weight:bold;" v-else>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+        <el-input style="width: 90px;margin-left:0px;text-align:center;" center placeholder="单价" @keyup.enter.native="confirmNumPrice()" @input="userPriceChange"
+        type="number" v-model="customData.userPrice"></el-input>
+        <span style="padding:0 0 0 4px;">元</span>
+        <el-input style="width: 90px;margin-left: 15px;text-align:center;" placeholder="总价" @keyup.enter.native="confirmNumPrice()" @input="totalPriceChange"
+        type="number" v-model="customData.totalPrice"></el-input>
+        <span style="padding:0 0 0 4px;">元</span>
+      </div>
+      <div style="text-align:center;margin:20px 0 5px 0;font-weight:bold;font-size:18px;">剩 {{ currentItem.stock ? parseFloat(currentItem.stock) : 0 }} {{ currentItem.bigUnit}}</div>
+      <div class="remark">
+        <el-button @click="backToSearchItem()">取消</el-button>
+        <el-button type="primary" @click="confirmNumPrice()">确认</el-button>
+      </div>
+      <div class="remark">Esc 取消,Enter 确认</div>
+    </el-dialog>
+
+    <el-dialog title="确认提交" v-if="showCommitPop" :visible.sync="showCommitPop" width="655px" center :close-on-click-modal="false">
+      <div>
+        <div class="accounts-list">
+          供货商
+          <div class="accounts-center">{{form.ghsName}}</div>
+        </div>
+        <div class="accounts-list">
+          采购人
+          <el-select ref="cgStaffRef" style="width:80%" v-model="form.cgStaffName" placeholder="请选择" @change="changeCgStaff">
+            <el-option v-for="item in staffList" :key="item.id" :label="item.name" :value="item"> </el-option>
+          </el-select>
+        </div>
+        <div class="accounts-list">
+          入库日期
+          <el-date-picker v-model="form.entryTime" style="width: 80%" value-format="yyyy-MM-dd" type="date" placeholder="请选择"> </el-date-picker>
+        </div>
+        <div class="accounts-list">
+          货位号
+          <div class="accounts-center">
+            <el-input placeholder="请填写货位号" @input="inputFn" v-model="form.seatSn"></el-input>
+          </div>    
+        </div>
+        <div class="accounts-list">
+          打包费
+          <div class="accounts-center">
+            <el-input placeholder="请填写打包费" @input="inputFn" v-model="form.packingCharge"></el-input>
+          </div>    
+        </div>
+        <div class="accounts-list">
+          运费支付
+          <div class="accounts-center">
+          <el-button :type="form.yfPayWay == 1?'primary':''" @keyup.enter.native="form.yfPayWay == 1" @click="changeYfPayWay(1)" size="small">寄付</el-button>
+            <el-button :type="form.yfPayWay == 2?'primary':''" @keyup.enter.native="form.yfPayWay == 2" @click="changeYfPayWay(2)" size="small">到付</el-button>
+          </div>
+        </div>
+        <div class="accounts-list">
+          短途运费
+          <div class="accounts-center">
+            <el-input @input="inputFn" placeholder="请填写" v-model="form.shortCharge"></el-input>
+          </div>    
+        </div>
+        <div class="accounts-list">
+          长途运费
+          <div class="accounts-center">
+            <el-input @input="inputFn" placeholder="请填写" v-model="form.longCharge"></el-input>
+          </div>    
+        </div>
+        <div class="accounts-list">
+          提货费
+          <div class="accounts-center">
+            <el-input @input="inputFn" placeholder="请填写" v-model="form.pickCharge"></el-input>
+          </div>    
+        </div>
+        <div class="accounts-list">
+          本地运费
+          <div class="accounts-center">
+            <el-input @input="inputFn" placeholder="请填写" v-model="form.localCharge"></el-input>
+          </div>    
+        </div>
+        <div class="accounts-list">
+          总金额
+          <div class="accounts-center" style="color:black;">¥{{totalPrice}}</div>
+        </div>
+        <div class="accounts-list">
+          应付金额
+          <el-input style="width: 80%" v-model="modifyPrice" @focus="modifyPrice=''"></el-input>
+        </div>
+        <div class="accounts-list" style="font-size:25upx;margin-left:20upx;color:green;font-weight:bold;" v-if="parseFloat((totalPrice - modifyPrice).toFixed(2))>0">
+          减免金额
+          <div class="accounts-center">¥{{ parseFloat((totalPrice - modifyPrice).toFixed(2)) }}</div>
+        </div>
+        <div class="accounts-list">
+          物流费用
+          <div class="accounts-center">
+          <el-button :type="form.isCost == 1?'primary':''" @keyup.enter.native="form.isCost == 1" @click="form.isCost = 1" size="small">算成本</el-button>
+            <el-button :type="form.isCost == 0?'primary':''" @keyup.enter.native="form.isCost == 0" @click="form.isCost = 0" size="small">不算成本</el-button>
+          </div>
+        </div>
+        <div class="accounts-list">
+          备注
+          <div class="accounts-center">
+            <el-input type="textarea" :rows="1" placeholder="这里写备注" v-model="form.remark" ref="remarkRef"> </el-input>
+          </div>
+        </div>
+        <div class="accounts-list">
+          总运费
+          <div class="accounts-center" style="color:black;">¥{{totalFreight}}</div>
+        </div>
+        <div class="accounts-list">
+          总重量
+          <div class="accounts-center" style="color:black;">¥{{calcTotalWeight}}</div>
+        </div>
+        <div class="accounts-list">
+          每公斤运费
+          <div class="accounts-center" style="color:black;">¥{{perKgFreight}}</div>
+        </div>
+        <div class="accounts-list">
+          <span></span>
+          <div class="accounts-center">
+            <el-button @click="showCommitPop = false">取消(Esc)</el-button>
+            <el-button type="primary" @click="createOrder">下一步(Ctrl+Enter)</el-button>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+import productMins from "@/mixins/product2";
+export default {
+  name: 'add',
+  data() {
+    return {
+      staffList:[],
+			form: {
+        ghsId:0,
+				packingCharge: "",
+				seatSn:'',
+				shortCharge: "",
+				longCharge: "",
+				pickCharge: "",
+				localCharge: "",
+				entryTime: "",
+				yfPayWay:1,
+				remark:"",
+				avgKgWeight:'',
+				needPrint:2,
+				fistWcPrintNum:1,
+				cgStaffId:0,
+				cgStaffName:'',
+				isCost:1
+			},
+			detailsInfo: {},
+			totalFreight:0,
+			perKgFreight:0,
+			location:0,
+			wcPrintList:[],
+      printAmount:1,
+      checked:true,
+      type:'自提',//取货方式
+      payType:'欠款',//结算方式
+      showConfirmNum:false,//选择扎和支的弹窗
+      showCommitPop:false,//结账弹窗
+      priceAmend:0,//修改单价弹窗
+      desk:'',//操作桌面
+      totalMoney:0,//总价
+      modifyPrice:0,//实际收款
+      searchVal:'',//搜索值
+      searchOldVal:'',//上一次搜索值
+      getIndex:0,
+      getItemList:[],//搜索展示的列表
+      selectIndex:0,
+      kdStaffVal:'www',
+      freight:'',//运费
+      remark:'',//备注
+      number: 0,
+      customInfoList:[],
+      loading: false,
+      selectGhsName:'',
+      t:null,
+      currentShop:{default:0,pfLevel:0},
+      showGetItemList:false,
+      currentItem:{},
+      classList:[],
+      changeType:'add',
+      TT:null,
+			selectJobType: "purchase",
+      globalCheckStock:false,
+      cgUnitType:0,//采购入库使用单位
+    };
+  },
+	mixins: [productMins],
+  computed: {
+    ...mapGetters(['shopInfo']),
+		totalItemNum(){
+			let big = 0
+			let small = 0
+			if(!this.$util.isEmpty(this.selectList)){
+				for(const ele of this.selectList){
+					if(Number(ele.bigCount)>0){
+						big = Number(big)+Number(ele.bigCount)
+						big = big.toFixed(0)
+					}
+					if(Number(ele.smallCount)){
+						small = Number(small) + Number(ele.smallCount)
+						small = small.toFixed(0)
+					}
+				}
+			}
+			return {big:big,small:small}
+		},
+		selectAllPrice(){
+			let price = 0;
+			if (this.selectList) {
+				for (const item of this.selectList) {
+					if(this.cgUnitType == 0){
+            if(item.aboutPrice && item.aboutPrice == 1){
+              price += Number(item.totalPrice)
+            }else{
+              price += Number(item.userPrice)*Number(item.bigCount);
+            }
+					}else{
+            if(item.aboutPrice && item.aboutPrice == 1){
+              price += Number(item.totalPrice)
+            }else{
+              price += Number(item.userPrice)*Number(item.smallCount);
+            }
+					}
+				}
+			}
+			let finalPrice = price.toFixed(2);
+			finalPrice = parseFloat(finalPrice)
+			this.modifyPrice = finalPrice
+			let newPrice = price.toFixed(2);
+			newPrice = parseFloat(newPrice)
+			return newPrice
+		},
+		calcTotalWeight(){
+			let realityWeight = 0;
+			if (this.selectList) {
+				for (const item of this.selectList) {
+					realityWeight += Number(item.weight)*Number(item.bigCount);
+				}
+			}
+			let calcWeight = realityWeight.toFixed(2);
+			return calcWeight
+		},
+		totalPrice(){
+			let price = Number(this.selectAllPrice);
+			//打包费
+			if(Number(this.form.packingCharge) > 0){
+				price	 = Number(price) + Number(this.form.packingCharge)
+			}
+			//到付的,长途和短途运费不能算在要结账的订单金额里。寄付的则要算。
+			if(this.form.yfPayWay == 1){
+				//短途运费
+				if(Number(this.form.shortCharge) > 0){
+					price	 = Number(price) + Number(this.form.shortCharge)
+				}
+				//长途运费
+				if(Number(this.form.longCharge) > 0){
+					price	 = Number(price) + Number(this.form.longCharge)
+				}
+			}
+			let currentPrice = price.toFixed(2)
+      return currentPrice
+		}
+  },
+  created() {
+
+  },
+  mounted() {
+
+    if (this.$route.query.ghsId && this.$route.query.ghsName) {
+      let id = this.$route.query.ghsId
+      let name = this.$route.query.ghsName
+      this.beginSelect(id,name)
+    }
+
+    if(this.form.ghsId == 0){
+      this.$nextTick(() => {
+        this.$refs.ghsRef.focus()
+      })
+    }
+    let that = this;
+    document.onkeydown=function(e) {
+      console.log(e)
+      if(e && e.key == 'Enter' && e.ctrlKey && e.altKey){
+        if(that.showCommitPop == true){
+          that.diffConfirm()
+        }else{
+          that.$message({message: '不在结算页',type: 'warning'})
+        }
+      }
+      if(e && e.key == 'Enter' && e.ctrlKey){
+        if(that.showCommitPop == true){
+          that.createOrder()
+        }else{
+          that.$message({message: '不在结算页',type: 'warning'})
+        }
+      }
+      if(e && e.key && e.key.toLowerCase() =='c' && e.ctrlKey){
+        that.$refs['ghsRef'].focus();
+      }
+      if(e && e.key && e.key.toLowerCase() =='q' && e.ctrlKey){
+        that.$refs['itemSearchRef'].focus();
+      }
+      if(e && e.key == 'ArrowUp'){
+        that.goUp();
+      }
+      if(e && e.key =='ArrowDown'){
+        that.goDown();
+      }
+      if(e && e.key=='Delete'){
+        if(that.selectList[that.selectIndex]){
+          let current = that.selectList[that.selectIndex]
+          that.delItem(current)
+        }
+      }
+      if(e && e.key=='PageDown'){
+        that.removeFromSave()
+      }
+      if( e && e.key=='Escape'){
+        if(that.showCommitPop){
+          that.showCommitPop = false;
+          that.backToSearchItem();
+        }
+        if(that.desk == 'confirmPriceNum'){
+          that.desk = 'selectedList'
+          that.$refs['itemSearchRef'].focus()
+        }
+      }
+      if(e && e.key && e.key.toLowerCase() =='/' && e.ctrlKey){
+        if(that.$util.isEmpty(that.selectList)){
+          that.$message({message: '请选择花材',type: 'warning'});
+          return;
+        }
+        that.$refs['itemSearchRef'].blur()
+        that.showCommitPop = true
+      }
+      if(e && e.key=='F8'){
+        that.$nextTick(() => {
+          that.$refs.remarkRef.focus()
+        })
+      }
+    }
+    //门店信息
+    this.$service.common.shopInfo().then(res => {
+        that.currentShop = res.shopInfo
+        that.$service.shopAdmin.getAllStaff().then(res => {
+          that.staffList = res.list
+        })
+        that.cgUnitType = res.shopInfo.cgUnitType ? res.shopInfo.cgUnitType : 0
+		})
+
+    this.$service.itemClass.getAllClassIndex().then(data => {
+      this.classList = data
+    })
+
+  },
+  methods: {
+    getGhsBlur(){
+      this.selectGhsName = this.$refs.ghsRef.selectedLabel
+    },
+    addGhs(){
+      if(this.$util.isEmpty(this.selectGhsName)){
+        this.$message({message: '请填写名称',type: 'warning'});
+        return false
+      }
+      this.$confirm('确认添加?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => {
+        this.$service.ghs.add({name:this.selectGhsName,location:this.location,mobile:''}).then(data=>{
+          this.$notify({ title: '成功', message: '添加成功', type: 'success'})
+          this.$refs.ghsRef.focus()
+        })
+      })
+    },
+		inputFn(e) {
+			let price = Number(this.selectAllPrice);
+			//打包费
+			if(Number(this.form.packingCharge) > 0){
+				price	 = Number(price) + Number(this.form.packingCharge)
+			}
+			//到付的,长途和短途运费不能算在要结账的订单金额里。寄付的则要算。
+			if(this.form.yfPayWay == 1){
+				//短途运费
+				if(Number(this.form.shortCharge) > 0){
+					price	 = Number(price) + Number(this.form.shortCharge)
+				}
+				//长途运费
+				if(Number(this.form.longCharge) > 0){
+					price	 = Number(price) + Number(this.form.longCharge)
+				}
+			}
+			this.modifyPrice = price.toFixed(2);
+			let packingCharge = Number(this.form.packingCharge) > 0 ? Number(this.form.packingCharge) : 0
+			let longCharge = Number(this.form.longCharge) > 0 ? Number(this.form.longCharge) : 0
+			let shortCharge = Number(this.form.shortCharge) > 0 ? Number(this.form.shortCharge) : 0
+			let localCharge = Number(this.form.localCharge) > 0 ? Number(this.form.localCharge) : 0
+			let pickCharge = Number(this.form.pickCharge) > 0 ? Number(this.form.pickCharge) : 0
+			this.totalFreight = (packingCharge+longCharge+shortCharge+localCharge+pickCharge).toFixed(2)
+			this.perKgFreight = (this.totalFreight / this.calcTotalWeight).toFixed(2)
+		},
+		changeYfPayWay(index){
+			this.form.yfPayWay = index
+			this.inputFn()
+		},
+    hitPlay() {
+      const hitPlay = this.$refs.hitPlay;
+      hitPlay.play()
+    },
+    noStockPlay() {
+      const noStockPlay = this.$refs.noStockPlay;
+      noStockPlay.play()
+    },
+    successPlay() {
+      const successPlay = this.$refs.successPlay;
+      successPlay.play()
+    },
+    delItem(current){
+      let that = this
+        that.$refs['itemSearchRef'].blur()
+        that.$confirm('确定删除 '+current.name+'?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+          current.bigCount = 0
+          current.smallCount = 0
+          that.replaceItemFn(current,1,'sub')
+          that.selectIndex = 0
+          that.$refs.singleTable.setCurrentRow(that.selectList[0])
+          setTimeout(function(){
+            that.$refs['itemSearchRef'].focus()
+          },900)
+        }).catch(()=>{
+          that.$refs['itemSearchRef'].focus()
+        })
+    },
+    changeCgStaff(info){
+      this.form.cgStaffId = info.id
+      this.form.cgStaffName = info.name
+    },
+    setTransType(type){
+      this.form.transType = type
+    },
+    commitOrder(){
+        let that = this
+        if(that.$util.isEmpty(that.selectList)){
+          that.$message({message: '请选择花材',type: 'warning'});
+          return;
+        }
+        that.$refs['itemSearchRef'].blur()
+        that.showCommitPop = true
+    },
+    comeBack(){
+      this.form.ghsId = 0
+      this.form.ghsName = ''
+      this.customInfoList = []
+      this.desk = 'searchCustom'
+      this.$nextTick(() => {
+        this.$refs.ghsRef.focus()
+      })
+    },
+    selectGhsFn(e){
+      if(e.id && e.name){
+        this.beginSelect(e.id,e.name)
+      }
+		},
+    beginSelect(id,name){
+        let that = this
+        that.TT = setTimeout(function(){
+          that.desk = 'selectedList'
+        },2300)
+        this.form.ghsId = id
+        this.form.ghsName = name
+        this.selectJobId = id
+        this.getFromStorage(false)
+        this.$nextTick(()=>{
+          this.$refs['itemSearchRef'].focus()
+        })
+    },
+		selectGhsInfo(query) {
+			let that = this
+			if (query !== '') {
+				this.loading = true;
+				this.$service.ghs.list({name:query}).then(res=>{
+					that.loading = false
+					that.customInfoList = res.list	
+				})
+			} else {
+				this.customInfoList = []
+			}
+		},
+    diffConfirm(){
+      this.form.dealPrice = 1
+      this.createOrder()
+    },
+    createOrder(){
+      let that = this
+      if(this.form.ghsId == 0){
+        this.$message({message: '请选择供货商',type: 'warning'})
+        return false
+      }
+      let formData = this.form;
+			const itemInfo = this.selectList.map(ele => {
+				return {
+					classId: ele.classId,
+					productId: ele.id,
+					bigNum: ele.bigCount,
+					smallNum: ele.smallCount,
+					itemId:ele.itemId,
+					itemPrice: ele.userPrice,
+					ratio:ele.ratio,
+					ratioType:ele.ratioType,
+          aboutPrice:ele.aboutPrice,
+          totalPrice:ele.totalPrice
+				}
+			})
+			formData.itemInfo = JSON.stringify(itemInfo)
+      if(Number(this.modifyPrice)<=0){
+        this.$message({message: '应付金额要大于0',type: 'warning'})
+        return false
+      }
+      let params = {...formData,modifyPrice:this.modifyPrice,cgModel:0,inType:0}
+      this.$confirm('确认提交', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
+        that.$service.purchaseOrder.createOrder(params).then(data => {
+            that.$nextTick(()=>{
+              that.selectList = [];
+              that.successPlay()
+              that.removeFromSaveDirect()
+              that.showCommitPop = false;
+              that.$notify({ title: '成功', message: '操作成功', type: 'success'})
+              that.backToSearchItem()
+              setTimeout(function(){
+                that.goChangePrice(data)
+              },900)
+            })
+        })
+      })
+    },
+    goChangePrice(info){
+      let query = {};
+			query.orderSn = info.orderSn
+			query.id = info.id
+      query.backType = 'add'
+      this.$router.push({path:'/in/change',query})
+    },
+    formReset(){
+      this.form.ghsId = 0
+      this.form.ghsName = ''
+      this.$nextTick(() => {
+        this.$refs.ghsRef.focus()
+      })
+    },
+    clearSeachVal(){
+      this.searchVal = ''
+      this.getItemList = []
+    },
+    beginSearchItem(){
+      let that = this
+      if(this.t!=null){
+        clearTimeout(this.t)
+      }
+      if(this.TT != null){
+        clearTimeout(this.TT)
+      }
+      this.t = setTimeout(function(){
+        that.searchItemFn()
+      },250)
+    },
+    sorts_fun(arr) {
+      return function(a, b) {
+          var v1 = a[arr];
+          var v2 = b[arr];
+          return v1 - v2;
+      }
+    },
+    async searchItemFn(){
+      if(this.searchVal==''){
+        this.getItemList = [];
+        this.getIndex = 0;
+        this.desk = 'selectedList'
+        return
+      }
+      let that = this
+      this.getItemList = [];
+      this.getIndex = 0;
+      this.searchOldVal = this.searchVal;
+      this.desk = 'searchList';
+      let hasExists = []
+      await this.$service.item.getItemList({search:this.searchVal,requestType:'cg',pageSize:20}).then(res=>{
+        let list = this.$util.copyObject(res.list)
+        if(!that.$util.isEmpty(list)){
+          list = list.sort(this.sorts_fun('classId'))
+          const newList = list.map(ele => {
+            let cName = '-'
+            if(hasExists[ele.classId]){
+              //无操作
+            }else{
+              let currentClass = this.classList[ele.classId] ? this.classList[ele.classId] : null
+              cName = currentClass.name ? currentClass.name : ''
+              hasExists[ele.classId] = 1
+            }
+            let selectedNum = 0
+            if(that.selectListIndex[ele.id]){
+              if(that.cgUnitType == 0){
+                selectedNum = that.selectListIndex[ele.id].bigCount ? Number(that.selectListIndex[ele.id].bigCount) : 0
+              }else{
+                selectedNum = that.selectListIndex[ele.id].smallCount ? Number(that.selectListIndex[ele.id].smallCount) : 0
+              }
+            }
+	          return {...ele,className:cName,selectedNum:selectedNum}
+          })
+          that.showGetItemList = true
+          that.getItemList = newList
+        }
+      })
+      if(!that.$util.isEmpty(that.getItemList)){
+        that.$refs.showItemRef.setCurrentRow(that.getItemList[0])
+      }
+    },
+    pickModifyItem(e){
+      this.changeType = 'update'
+      this.selectCurrentItem(e)
+    },
+    pickAddItem(e){
+      this.changeType = 'add'
+      this.selectCurrentItem(e)
+    },
+    pickAddCurrentItem(){
+      if(this.desk == 'searchList'){
+        this.changeType = 'add'
+        if(this.getItemList[this.getIndex]){
+          let currentItem = this.getItemList[this.getIndex]
+          this.selectCurrentItem(currentItem)
+        }
+      }
+      if(this.desk == 'selectedList'){
+        if(this.selectList[this.selectIndex]){
+          let currentItem = this.selectList[this.selectIndex]
+          this.pickModifyItem(currentItem)
+        }
+      }
+    },
+    selectCurrentItem(currentItem){
+        this.currentItem = currentItem
+        if(this.cgUnitType == 0){
+          this.customData.bigCount = currentItem.bigCount > 0 ? currentItem.bigCount : 1
+        }else{
+          this.customData.smallCount = currentItem.smallCount > 0 ? currentItem.smallCount : 1
+        }
+        this.customData.aboutPrice = currentItem.aboutPrice ? currentItem.aboutPrice : 0
+        let currentPrice = 0
+        if(currentItem.userPrice && Number(currentItem.userPrice)>0){
+          currentPrice = currentItem.userPrice
+        }else{
+          if(currentItem.price && Number(currentItem.price)>0){
+            currentPrice = currentItem.price
+          }
+        }
+        this.customData.userPrice = parseFloat(currentPrice)
+
+        let total = 0
+        if(currentItem.totalPrice && Number(currentItem.totalPrice)>0){
+          this.customData.totalPrice = Number(currentItem.totalPrice)
+        }else{
+          if(this.cgUnitType == 0){
+            total = Number(this.customData.bigCount)*Number(this.customData.userPrice)
+          }else{
+            total = Number(this.customData.smallCount)*Number(this.customData.userPrice)
+          }
+          total = parseFloat(total.toFixed(2))
+          this.customData.totalPrice = total
+        }
+
+        this.desk = 'confirmPriceNum';
+        this.showGetItemList = false
+        this.showConfirmNum = true;
+        this.$nextTick(()=>{
+          this.$refs['countInput'].focus()
+          this.$refs['countInput'].select()
+        })
+    },
+    totalPriceChange(){
+      if(Number(this.customData.totalPrice)>0){
+        if(this.cgUnitType == 0){
+          if(Number(this.customData.bigCount)>0){
+            let a = Number(this.customData.totalPrice)/Number(this.customData.bigCount)
+            this.customData.userPrice = Math.floor(a*100)/100
+
+            let newNum = Number(this.customData.userPrice)*Number(this.customData.bigCount)
+            newNum = parseFloat(newNum.toFixed(2))
+            if(Number(this.customData.totalPrice) > Number(newNum)){
+              this.customData.aboutPrice = 1
+            }else{
+              this.customData.aboutPrice = 0
+            }
+          }
+        }else{
+          if(Number(this.customData.smallCount)>0){
+            let a = Number(this.customData.totalPrice)/Number(this.customData.smallCount)
+            this.customData.userPrice = Math.floor(a*100)/100
+            let newNum = Number(this.customData.userPrice)*Number(this.customData.smallCount)
+            newNum = parseFloat(newNum.toFixed(2))
+            if(Number(this.customData.totalPrice) > Number(newNum)){
+              this.customData.aboutPrice = 1
+            }else{
+              this.customData.aboutPrice = 0
+            }
+          }
+        }
+      }
+    },
+    userPriceChange(){
+      if(Number(this.customData.userPrice)>0){
+        if(this.cgUnitType == 0){
+          if(Number(this.customData.bigCount)>0){
+            this.customData.totalPrice = Number(this.customData.bigCount)*Number(this.customData.userPrice)
+            this.customData.totalPrice = parseFloat(this.customData.totalPrice.toFixed(2))
+          }
+        }else{
+          if(Number(this.customData.smallCount)>0){
+            this.customData.totalPrice = Number(this.customData.smallCount)*Number(this.customData.userPrice)
+            this.customData.totalPrice = parseFloat(this.customData.totalPrice.toFixed(2))
+          }
+        }
+      }
+    },
+    bigCountChange(){
+      if(Number(this.customData.bigCount)>0){
+        if(Number(this.customData.userPrice)>0){
+          this.customData.totalPrice = Number(this.customData.bigCount)*Number(this.customData.userPrice)
+          this.customData.totalPrice = parseFloat(this.customData.totalPrice.toFixed(2))
+        }
+      }
+    },
+    smallCountChange(){
+      if(Number(this.customData.smallCount)>0){
+        if(Number(this.customData.userPrice)>0){
+          this.customData.totalPrice = Number(this.customData.smallCount)*Number(this.customData.userPrice)
+          this.customData.totalPrice = parseFloat(this.customData.totalPrice.toFixed(2))
+        }
+      }
+    },
+    confirmNumPrice(){
+      let currentItem = this.currentItem;
+      if(Number(this.customData.bigCount)<=0 && Number(this.customData.smallCount)<=0){
+        this.$message({message: '请填写数量',type: 'warning'});
+        return;
+      }
+      if(Number(this.customData.userPrice)<=0){
+        this.$message({message: '请填写金额',type: 'warning'});
+        return;
+      }
+      if(Number(this.customData.totalPrice)<=0){
+        this.$message({message: '总金额错误',type: 'warning'});
+        return;
+      }
+      currentItem = {...currentItem,bigCount:this.customData.bigCount,userPrice:this.customData.userPrice,smallCount:this.customData.smallCount,
+        totalPrice:this.customData.totalPrice,aboutPrice:this.customData.aboutPrice}    
+      this.replaceItemFn(currentItem,1,'add')
+      this.backToSearchItem();
+    },
+    backToSearchItem(){
+      this.desk = 'selectedList'
+      if(this.selectList[0]){
+        this.selectIndex = 0
+        this.$refs.singleTable.setCurrentRow(this.selectList[0])
+      }
+      this.searchVal = '';
+      this.customInfoList = []
+      this.getItemList = [];
+      this.currentItem = {}
+      this.showConfirmNum = false
+      this.$nextTick(()=>{
+        this.$refs['itemSearchRef'].focus();
+      })
+    },
+    backspaceFun(type){
+      switch (type){
+        case 'big':
+          this.big = null;
+          break;
+        case 'price':
+          this.price = null;
+          break;
+      }
+    },
+    amendPrice(){
+      if(this.priceAmend==''){
+        this.$message({message: '请输入大于0的值',type: 'warning'});
+        return;
+      }
+      let currentItem = this.selectList[this.selectIndex];
+      this.selectList[this.selectIndex].price = this.priceAmend;
+      let money = Number(currentItem.price) * (Number(currentItem.big) + Number(currentItem.small) / Number(currentItem.ratio));
+      this.selectList[this.selectIndex].money = money;
+      this.selectList[this.selectIndex].totalMoney = money.toFixed(2);
+      this.priceAmend = 0;
+      this.backToSearchItem();
+    },
+    goDown(){
+      if(this.desk == 'searchList'){
+        let selectListLength = this.getItemList.length-1;
+        if(selectListLength==this.getIndex){
+          this.getIndex = selectListLength
+        }else{
+          this.getIndex++;
+        }
+        this.$refs.showItemRef.setCurrentRow(this.getItemList[this.getIndex]);
+      }
+      if(this.desk == 'selectedList'){
+        let selectListLength = this.selectList.length-1;
+        if(selectListLength==this.selectIndex){
+          this.selectIndex = selectListLength
+        }else{
+          this.selectIndex++;
+        }
+        this.$refs.singleTable.setCurrentRow(this.selectList[this.selectIndex]);
+      }
+    },
+    goUp(){
+      if(this.desk == 'searchList'){
+        if(this.getIndex==0){
+          this.getIndex = 0
+        }else{
+          this.getIndex--;
+        }
+        this.$refs.showItemRef.setCurrentRow(this.getItemList[this.getIndex]);
+      }
+      if(this.desk == 'selectedList'){
+        if(this.selectIndex==0){
+          this.selectIndex = 0
+        }else{
+          this.selectIndex--;
+        }
+        this.$refs.singleTable.setCurrentRow(this.selectList[this.selectIndex]);
+      }
+    },
+    freightInput(){
+       this.totalMoney = Number(this.freight) +  this.number
+       this.modifyPrice = Number(this.freight) +  this.number
+    }
+  }
+};
+</script>
+<style lang="scss">
+.tableBox {
+  th {
+    padding: 0 !important;
+    height: 40px;
+    line-height: 40px;
+  }
+  td {
+    padding: 0 !important;
+    height: 45px;
+    line-height: 45px;
+  }
+}
+.app-list-content {
+  position: relative;
+
+  .right_box {
+    float: right;
+    width: 20%;
+    // margin-top: 40px;
+    // background: #ffffff;
+    // border: 1px solid #ebeef5;
+    box-sizing: border-box;
+    vertical-align: top;
+    margin-left: -1px;
+  }
+
+  .left_box {
+    //float: left;
+    width: 90%;
+    margin: 0 auto;
+    vertical-align: top;
+
+    .tor {
+      line-height: 40px;
+      color: #999;
+      text-align: center;
+      font-size: 15px;
+      span{
+        margin-right:20px;
+      }
+    }
+  }
+  .seek-list-box{
+    position: absolute;
+    bottom: 70px;
+    right: 15vw;
+    min-height: 310px;
+    overflow: hidden;
+    z-index:9999;
+  }
+  .bottom_input {
+    position: absolute;
+    bottom: 18px;
+    width:100%;
+    text-align: center;
+    .allPrice {
+      margin-left:30px;
+      font-size: 16px;
+      font-weight: 700;
+      &.active{
+        margin-left: 200px;
+      }
+    }
+  }
+  .el-dialog-center{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    span{
+      padding: 0 20px;
+    }
+
+  }
+  .accounts-list{
+    width: 80%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 0 auto;
+    padding-bottom: 20px;
+    .accounts-center{
+      width: 80%;
+    }
+  }
+  .remark{
+    margin-top: 20px;
+    text-align: center;
+    color: #999999;
+    font-size: 14px;
+  }
+  .flex{display: flex;align-items: center;}
+  .flex-center{display: flex;align-items: center;justify-content: center;}
+  .flex-center{display: flex;align-items: center;justify-content: space-between;}
+  .print-html {
+    position: fixed;
+    left: 0;
+    top: 9990px;
+  }
+}
+</style>

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor