12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103 |
- <template>
- <div class="app-container">
- <div class="filter-container">
- <el-select v-model="getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-select v-model="getdataListParm.parammaps.pastureNameIN" style="width: 140px;" clearable placeholder="调入牧场" class="filter-item">
- <el-option v-for="item in findAllPasture2" :key="item.id" :label="item.pastureName" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm.parammaps.applyCode" placeholder="调拨单号" style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm.parammaps.statue" style="width: 140px;" clearable placeholder="调拨状态" class="filter-item">
- <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search1">搜索</el-button>
- <div>
- <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
- <el-button v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
- <el-button class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
- </div>
- </div>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- @selection-change="change_table_selection"
- @current-change="handleCurrentChange"
- >
- <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="调拨单号" min-width="150px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.applyCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="调出牧场" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="调入牧场" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureNameIN }}</span>
- </template>
- </el-table-column>
- <el-table-column label="调拨人" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.emp }}</span>
- </template>
- </el-table-column>
- <el-table-column label="调拨日期" sortable prop="creatTime" min-width="80px" align="center" />
- <el-table-column label="调拨状态" min-width="80px" align="center" :formatter="statue" />
-
- <el-table-column prop="sapStatus" label="sap上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show ="scope.row.sapStatus == 2">上传失败</span>
- <span v-show = "scope.row.sapStatus == 1">上传成功</span>
- <span v-show = "scope.row.sapStatus == 0 || typeof(scope.row.sapStatus)== 'undefined'">未上传</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
- <el-button v-if="row.statue==2 && (row.pastureId == loginPastureid)" type="success" size="mini" style="width:70px;display:inline-block" @click="handleReturn(row)">确认退回</el-button>
- <el-button v-else type="success" size="mini" style="width:70px;display:none" @click="handleReturn(row)">确认退回</el-button>
- <el-button v-if="row.statue==4 && (row.inPastureId == loginPastureid)" type="success" size="mini" style="display:inline-block" @click="handleReject(row)">驳回</el-button>
- <el-button v-else type="success" size="mini" style="display:none" @click="handleReject(row)">驳回</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
- <!-- 弹出层新增or修改 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
- <div class="app-container">
- <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 90%;margin:0 auto;">
- <el-row>
- <el-col :span="8">
- <el-form-item label="调拨单号:" prop="applyCode">
- <el-input ref="applyCode" v-model="createTemp.applyCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="调出牧场:" prop="pastureId">
- <el-select v-model="createTemp.pastureId" placeholder="调出牧场" class="filter-item" style="width:100%">
- <el-option
- v-for="item in findAllPasture"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="调入牧场:" prop="inPastureId">
- <el-select v-model="createTemp.inPastureId" placeholder="调入牧场" class="filter-item" style="width:100%">
- <el-option
- v-for="item in findAllPasture2"
- :key="item.id"
- :label="item.pastureName"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="调拨人:" prop="empId">
- <el-select v-model="createTemp.empId" placeholder="调拨人" class="filter-item" style="width:100%" @change="changeEmp">
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="调拨日期:" prop="applyDate">
- <el-date-picker
- v-model="createTemp.applyDate"
- :picker-options="pickerOptions"
- type="date"
- placeholder="调拨日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width:100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购组:" prop="groupName">
- <el-input ref="groupName" v-model="createTemp.groupName" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="16">
- <el-form-item label="备件:" prop="partCode">
- <el-autocomplete
- v-model="createTemp.partCode"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="sparePartSearch"
- placeholder="请输入备件编号或备件名称或备件规格"
- style="width:100%"
- @select="handleSelectSparePart"
- >
- <template slot-scope="{ item }">
- <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>
- | <b>备件名称:</b><span class="addr">{{ item.partName }}</span>
- | <b>备件规格:</b><span class="addr">{{ item.specification }}</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="listAdd"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:30px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" prop="providerName" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="现有库存" prop="reportery" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span>
- </template>
- </el-table-column>
- <el-table-column label="调拨数量" min-width="120px" align="center" valign="middle">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="amount">
- <el-input v-model="scope.row.amount" style="margin-top:15px" />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总价" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ (scope.row.amount * scope.row.price) | keepTwoNum }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <el-input v-model="scope.row.note" />
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <a class="del" @click="partDelete(row)">删除</a>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():add_dialog_save()">保存并关闭</el-button>
- <el-button @click="dialogFormVisible = false;getList()">取消并关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 查看 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisibleSee" :close-on-click-modal="false" width="90%">
- <div class="app-containerSee">
- <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="100px" style="width: 90%;margin:0 auto;">
- <el-row>
- <el-col :span="8">
- <el-form-item label="调拨单号:" prop="applyCode">
- <el-input ref="applyCode" v-model="seeTemp.applyCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="调出牧场:" prop="pastureName">
- <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
- <!-- <el-select v-model="seeTemp.pastureId" disabled placeholder="调出牧场" class="filter-item" style="width:100%">
- <el-option
- v-for="item in findAllPasture"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select> -->
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="调入牧场:" prop="inPastureId">
- <el-select v-model="seeTemp.inPastureId" disabled placeholder="调入牧场" class="filter-item" style="width:100%">
- <el-option
- v-for="item in findAllPasture2"
- :key="item.id"
- :label="item.pastureName"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="调拨人:" prop="emp">
- <el-input ref="emp" v-model="seeTemp.emp" disabled />
- <!-- <el-select v-model="seeTemp.empId" placeholder="调拨人" disabled class="filter-item" style="width:100%" @change="changeEmp">
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select> -->
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="调拨日期:" prop="applyDate">
- <el-date-picker
- v-model="seeTemp.applyDate"
- :picker-options="pickerOptions"
- type="date"
- disabled
- placeholder="调拨日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width:100%"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKey"
- v-loading="listLoadingSee"
- element-loading-text="给我一点时间"
- :data="listSee"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:30px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable"
- @sort-change="tableSort"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" prop="brandName" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" prop="providerName" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="调拨数量" sortable prop="amount" min-width="120px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" sortable prop="price" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总价" sortable prop="sumPrice" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备注" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.note }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" style="bottom:5px;">
- <el-button @click="dialogFormVisibleSee = false">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- // / 引入
- import { GetDataByName, GetDataByNames, PostDataByName, ExecDataByConfig, checkButtons, failproccess, SapTrans } from '@/api/common'
- import waves from '@/directive/waves' // waves directive
- import { parseTime, sortChange } from '@/utils/index.js'
- // eslint-disable-next-line no-unused-vars
- import { validateEMail } from '@/utils/validate.js'
- import Pagination from '@/components/Pagination' // secondary package based on el-pagination
- import { MessageBox } from 'element-ui'
- import Cookies from 'js-cookie'
- import { getToken } from '@/utils/auth'
- export default {
- name: 'Allot',
- components: { Pagination },
- directives: { waves },
- filters: {
- keepTwoNum(value) {
- value = Number(value)
- return value.toFixed(2)
- }
- },
- data() {
- return {
- isSap:1,
- isSrm:1,
- selectList: [],
- isAllotsap: [],
- currentRow:{},
- loginPastureid: Cookies.get('pastureid'),
- isokDisable: false,
- findAllProvider: [],
- findAllPasture: [],
- findAllPasture2: [],
- findAllDepart: [],
- findAllEmploye: [],
- statues: [{ id: '0', name: '调拨中' }, { id: '1', name: '调拨完成' }, { id: '2', name: '驳回中' }, { id: '3', name: '退回完成' }],
- requestParams: [
- { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
- { name: 'getPastureList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}},
- { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
- ],
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now()// 当天之前的时间可选
- }
- },
- textMap: {
- create: '新增',
- see: '查看'
- },
- rules: {
- inPastureId: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- getdataListParm: {
- name: 'getBigPartTransferList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- applyCode: '',
- statue: '',
- pastureNameIN: '',
- inputDatetime: '',
- startTime: '',
- stopTime: ''
- }
- },
- tableKey: 0,
- listLoading: true,
- total: 0,
- list: [],
- dialogStatus: '',
- dialogFormVisible: false,
- dialogFormVisibleSee: false,
- listLoadingSee: true,
- listSee: [],
- totalSee: 0,
- seeTemp: {},
- getdataListSee: {
- name: 'getPartTransferbybigid',
- returntype: 'Map',
- parammaps: {}
- },
- createTemp: {
- pastureId: this.$store.state.user.pastureid,
- departmentId: this.$store.state.user.departmentid,
- empId: this.$store.state.user.employeid,
- employeId: this.$store.state.user.employeid,
- applyDate: parseTime(new Date(), '{y}-{m}-{d}'),
- groupName:''
- },
- requestSparePart: {
- name: 'getPartsListLY',
- page: 1,
- offset: 1,
- pagecount: 20,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 0,
- offset: 0,
- pagecount: 0,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'DB'
- }
- },
- // getParmCreateAmount: {
- // name: 'getPartsAmountList',
- // page: 0,
- // offset: 0,
- // pagecount: 0,
- // returntype: 'Map',
- // parammaps: {}
- // },
- listAdd: [],
- postDataPramas: {},
- requestParam: {},
- dialogFormVisible_Examine: false,
- examineTemp: {
- statue: 1
- },
- statueReason: false,
- activeList: [],
- active: 3
- }
- },
- created() {
- this.getDownList()
- this.getList()
- },
- methods: {
- handleCurrentChange(val) {
- this.currentRow = val;
- console.log("currentRow",this.currentRow)
- },
- checkboxInit(row,index){
- // console.log(row)
-
- var data1 = new Date(row.creatTime)
- var data2 = new Date('2022-10-25')
- if(data1 > data2){ return 1 } else {return 0}
-
- },
- //监听 - 表格 - 勾选
- change_table_selection(val) {
- this.selectList = val
- console.log('勾选数据selectList', this.selectList)
- },
- sapUpload(){
- const that = this
- console.log("currentRow ProofCode",this.currentRow.ProofCode)
- var send_data = this.selectList
- if(send_data.length == 0){
- that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
- return false
- }
- console.log(that.isSap)
- if(that.isSap == 1){
- that.isSap = 0
- SapTrans(send_data).then(response => {
- console.log('response', response)
-
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.getList()
- } else {
- that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- }
- })
-
-
- } else {
- that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
- }
- setTimeout(() => {
- that.isSap = 1
- }, 3000)
-
-
- // if(true){
- //sapStatus 0 或没有 未同步,1 同步成功,2同步失败
- // if(this.currentRow.sapStatus){
- // console.log("currentRow sapStatus 这个值说明已经上传了 传")
- // if(this.currentRow.sapStatus == 1){
- // } else {
- // var send_data = {
- // "code":applyCode,
- // "pastureid":Cookies.get('pastureid')
-
- // }
- // SapTrans(send_data).then(response => {
- // console.log('response', response)
-
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.getList()
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
- // })
- // }
- // //如果有这个值说明已经上传了,不用上传
- // } else {
- // console.log("currentRow sapStatus没有这个值")
-
-
-
- // console.log("applyCode",applyCode)
- // var send_data = {
- // "code":applyCode,
- // "pastureid":Cookies.get('pastureid')
-
- // }
- // SapTrans(send_data).then(response => {
- // console.log('response', response)
-
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.getList()
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
- // })
-
- // }
- },
- tableSort(column) {
- sortChange(column, this.listSee)
- },
- getList() {
- this.listLoading = true
- if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
- this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
- this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
- } else {
- this.getdataListParm.parammaps.startTime = ''
- this.getdataListParm.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm).then(response => {
- console.log('table数据', response.data.list)
- this.list = response.data.list
- this.pageNum = response.data.pageNum
- this.pageSize = response.data.pageSize
- if (response.data.total) {
- this.total = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading = false
- }, 100)
- })
- },
- statue: function(cellValue) {
- // console.log(cellValue.isZeroStock)
- if (cellValue.statue == 0) {
- return '调拨中'
- } else if (cellValue.statue == 1) {
- return '调拨完成'
- } else if (cellValue.statue == 2) {
- return '驳回中'
- } else if (cellValue.statue == 3) {
- return '退回完成'
- } else if (cellValue.statue == 4) {
- return '调拨中'
- }
- },
- form_search1() {
- console.log('点击了table搜索')
- if (this.getdataListParm.parammaps.inputDatetime === null) {
- this.getdataListParm.parammaps.inputDatetime = ''
- }
- this.listLoading = true
- this.getdataListParm.offset = 1
- this.getList()
- },
- resetCreateTemp() {
- this.createTemp.pastureId = this.$store.state.user.pastureid
- this.createTemp.departmentId = this.$store.state.user.departmentid
- this.createTemp.employeId = this.$store.state.user.employeid
- this.createTemp.empId = this.$store.state.user.employeid
- this.createTemp.createTime = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp.applyCode = ''
- this.createTemp.groupName = ''
- this.listAdd = []
- },
- form_add() {
- this.resetCreateTemp()
- this.createTemp.applyCode = ''
- this.dialogStatus = 'create'
- this.dialogFormVisible = true
- this.getCreateNumber()
- },
- getCreateNumber() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('新增申购单号', response.data.list[0].orderCode)
- this.createTemp.applyCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- changeEmp(val) {
- this.createTemp.emp = this.findAllEmploye.find(obj => obj.id == val).name
- },
- sparePartSearch(queryString, cb) {
- console.log('备件模糊查询输入值', queryString)
- this.requestSparePart.parammaps['partCode'] = queryString
- GetDataByName(this.requestSparePart).then(response => {
- console.log('备件模糊查询搜索data', response.data.list)
- if (response.data.list == null) {
- cb([])
- } else {
- cb(response.data.list)
- }
- })
- },
- handleSelectSparePart(item) {
- console.log('备件模糊查询选中值', item)
- console.log('备件模糊查询选中值', item.id)
- console.log(this.listAdd)
- if (this.listAdd.length > 0) {
- // eslint-disable-next-line no-redeclare
- if (this.listAdd.find(obj => obj.id === item.id)) {
- this.$message({
- type: 'warning',
- message: '此备件已存在,请重新选择备件'
- })
- } else {
- if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
- this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
- this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
- } else {
- item.srcpath = ''
- item.picpath = ''
- }
- this.listAdd.unshift(item)
- // this.getParmCreateAmount.parammaps.partCode = item.partCode
- // GetDataByName(this.getParmCreateAmount).then(response => {
- // this.$nextTick(() => {
- // console.log('新增根据编号获取备件库存数量', response.data.list[0].reporteryNum)
- // item.reportery = response.data.list[0].reporteryNum
- // this.listAdd.unshift(item)
- // this.$forceUpdate()
- // })
- // })
- }
- } else {
- if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
- this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
- this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
- } else {
- item.srcpath = ''
- item.picpath = ''
- }
- this.listAdd.unshift(item)
- // this.getParmCreateAmount.parammaps.partCode = item.partCode
- // GetDataByName(this.getParmCreateAmount).then(response => {
- // this.$nextTick(() => {
- // console.log('新增根据编号获取备件库存数量', response.data.list[0].reporteryNum)
- // item.reportery = response.data.list[0].reporteryNum
- // this.listAdd.unshift(item)
- // this.$forceUpdate()
- // })
- // })
- }
- this.$forceUpdate()
- },
- add_dialog_save() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- console.log(this.listAdd)
- if (this.createTemp.applyCode == '' || this.createTemp.applyCode == null || this.createTemp.applyCode == undefined) {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('新增申购单号', response.data.list[0].orderCode)
- this.createTemp.applyCode = response.data.list[0].orderCode
- this.$forceUpdate()
- this.add_dialog_saveSave()
- })
- })
- } else {
- this.add_dialog_saveSave()
- }
- }
- })
- },
- add_dialog_saveSave() {
- if (this.listAdd.length !== 0) {
- for (var j = 0; j < this.listAdd.length; j++) {
- console.log(this.listAdd[j].amount)
- // eslint-disable-next-line use-isnan
- if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
- this.$message({
- type: 'warning',
- message: '请检查调拨数量是否未填写',
- duration: 2000
- })
- return false
- } else if (parseFloat(this.listAdd[j].amount) > parseFloat(this.listAdd[j].reportery)) {
- this.$message({
- type: 'error',
- message: '调拨数量不可大于现有库存数量',
- duration: 2000
- })
- return false
- } else {
- var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
- if (!rulesAmount.test(parseFloat(this.listAdd[j].amount))) {
- this.$message({
- type: 'error',
- message: '调拨数量请输入正数,且最多保留两位小数',
- duration: 2000
- })
- return false
- }
- }
- }
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'insertBigPartTransfer', 'type': 'e', 'parammaps': {
- pastureId: this.createTemp.pastureId,
- inPastureId: this.createTemp.inPastureId,
- applyCode: this.createTemp.applyCode,
- empId: this.createTemp.empId,
- emp: this.createTemp.emp,
- applyDate: this.createTemp.applyDate,
- groupName:this.createTemp.groupName
- }}
- // eslint-disable-next-line no-irregular-whitespace
- this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[1].children = []
- this.postDataPramas.data[1].children[0] = { 'name': 'insertParttTransfer', 'type': 'e', 'parammaps': {
- bigId: '@insertBigPartTransfer.LastInsertId',
- pastureId: '@insertSpotList.pastureId',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- brandId: '@insertSpotList.brandId',
- brandName: '@insertSpotList.brand',
- amount: '@insertSpotList.amount',
- providerName: '@insertSpotList.providerName',
- providerId: '@insertSpotList.providerId',
- note: '@insertSpotList.note',
- partRepId: '@insertSpotList.partRepId'
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('新增保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible = false
- this.getdataListParm.parammaps.inputDatetime = ''
- this.getList()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- return true
- } else {
- this.$message({
- title: '',
- message: '请选择备件',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- },
- partDelete(row) {
- console.log(this.listAdd)
- MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- // console.log(this.list2)
- for (var i = 0; i < this.listAdd.length; i++) {
- console.log(this.listAdd[i])
- if (this.listAdd[i].id === row.id) {
- var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
- }
- if (listAddIndex > -1) {
- this.listAdd.splice(listAddIndex, 1)
- return
- }
- }
- })
- },
- // 查看
- form_see(row) {
- this.dialogStatus = 'see'
- this.dialogFormVisibleSee = true
- row.pastureId = String(row.pastureId)
- console.log(row.pastureId)
- this.seeTemp = Object.assign({}, row)
- console.log('查看上方数据(从table读取)', this.seeTemp)
- this.getdataListSee.parammaps.id = this.seeTemp.id
- this.getSeeList()
- },
- getSeeList() {
- GetDataByName(this.getdataListSee).then(response => {
- console.log('查看下方table数据', response.data.list)
- this.listSee = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listSee[i].srcpath = ''
- this.listSee[i].picpath = ''
- }
- }
- }
- this.seeTemp.providerName = response.data.list.providerName
- this.pageNumSee = response.data.pageNum
- this.pageSizeSee = response.data.pageSize
- if (response.data.total) {
- this.totalSee = response.data.total
- }
- setTimeout(() => {
- this.listLoadingSee = false
- }, 100)
- })
- },
- getDownList() {
- GetDataByNames(this.requestParams).then(response => {
- this.findAllProvider = response.data.findAllProvider.list
- this.findAllPasture = response.data.findAllPasture.list
- this.findAllPasture2 = response.data.getPastureList.list
- this.findAllDepart = response.data.findAllDepart.list
- this.findAllEmploye = response.data.findAllEmploye.list
- })
- },
- handleDownload() {
- alert('点击了导出')
- },
- handleReturn(row) {
- console.log('点击了确认退回')
- this.seeTemp = Object.assign({}, row)
- this.getdataListSee.parammaps.id = this.seeTemp.id
- this.getSeeList()
- MessageBox.confirm('是否确认将调拨单备件退回至库存', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'updateBigPartTransfer', 'type': 'e', 'parammaps': {
- id: row.id,
- statue: 3
- }}
- this.postDataPramas.data[1] = { 'name': ' getPartTransferbybigid', 'type': 'e', 'parammaps': {
- id: row.id,
- statue: 3
- }}
- this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listSee }}
- this.postDataPramas.data[2].children = []
- this.postDataPramas.data[2].children[0] = { 'name': 'updatePartRepertoryDB', 'type': 'e', 'parammaps': {
- amount: '@insertSpotList.amount',
- partRepId: '@insertSpotList.partRepId'
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- this.getList()
- this.$notify({
- title: '成功',
- message: '退回成功',
- type: 'success',
- duration: 2000
- })
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消确认退回'
- })
- })
- },
- handleReject(row) {
- console.log('点击了驳回')
- MessageBox.confirm('是否确认将调拨单驳回', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.requestParam.name = 'updateBigPartTransfer'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.id = row.id
- this.requestParam.parammaps.statue = 2
- PostDataByName(this.requestParam).then(() => {
- this.getList()
- this.dialogFormVisible = false
- this.$notify({
- title: '成功',
- message: '驳回成功',
- type: 'success',
- duration: 2000
- })
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消驳回'
- })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .pagination-container{
- display: block !important;
- }
- </style>
- <style lang="scss">
- .el-step__head.is-success {
- color: #409EFF;
- border-color: #409EFF;
- }
- .el-step__title.is-success{
- color: #409EFF;
- }
- .el-step__head.is-process{
- color: #409EFF;
- border-color: #409EFF;
- .el-step__icon.is-text{
- background: #409EFF;
- color: #fff;
- }
- }
- .step-row{
- color: #000;
- }
- </style>
|