1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648 |
- <template>
- <div class="app-container">
- <div v-if="MainTable == false">
- <MainForm
- ref="MainForm"
- :searchdata="formOption"
- :display="display"
- :form="queryParms"
- :show="show"
- :inDex="inDex"
- />
- <listComponent
- style="clear:both"
- v-if="waitFor"
- :tableData="tableData"
- @selectionbox="selectionbox"
- @see="viewMethod"
- @modify="modification"
- @deletion="deletion"
- @buttonList="buttonList"
- @showSearch="showSearch"
- @getList="getList"
- @feedback="feedback"
- :customButton="customButton"
- :arrow="arrow"
- :hasPermi="hasPermi"
- :tatolLabel="mainTatol"
- :seachButton="seachButton"
- :setRowList="setRowList"
- :listStyle="listStyle"
- :isItHidden="isItHidden"
- :queryList="queryList"/>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParms.pageNum"
- :limit.sync="queryParms.pageSize"
- @pagination="getList"
- />
- </div>
- <div v-if="MainTable == true">
- <el-breadcrumb separator="/" style="display:flex;align-items: center;margin-bottom: 10px">
- <el-breadcrumb-item>仓库入库</el-breadcrumb-item>
- <el-breadcrumb-item>仓库入库详情页</el-breadcrumb-item>
- <el-breadcrumb-item>
- <el-button plain size="mini" type="danger" icon="el-icon-arrow-left" @click="backRules">
- 返回列表
- </el-button>
- </el-breadcrumb-item>
- </el-breadcrumb>
- <h1 style="text-align: center;margin-top: -42px">仓库入库</h1>
- <MainForm
- ref="detailForm"
- :searchdata="detailOption"
- :display="display"
- :form="detailForm"
- :show="show = true"
- :inDex="inDex"
- @backRules="backRules"
- @backSave="backSave"
- @verificationRules="verificationRules"
- @changeWarehouse="changeWarehouse"
- />
- <list-component
- v-if="waitFor"
- :tableData="detailData"
- @selectionbox="selectionbox"
- @see="viewMethod"
- @modify="modification"
- @deletion="deletion"
- @buttonList="buttonList"
- @showSearch="showSearch"
- @getList="getList"
- @deletRows="deletRows"
- @feedback="feedback"
- @totalAmount="totalAmount"
- @change="change"
- :seachButton="confirmButton"
- :customButton="detailButton"
- :listStyle="detailStyle"
- :hasPermi="hasPermi"
- :setRowList="setRowList"
- :tatolLabel="tatolLabel"
- :listData="listData"
- :queryList="detailList"/>
- </div>
- <el-dialog
- title="打印入库"
- :visible.sync="dialogVisible"
- :fullscreen="true"
- style="padding: 0;margin:0"
- width="70%">
- <div ref="print">
- <table class="table table-striped table-bordered" align="center" valign="center" style="font-size: 12px;border-collapse: collapse; border: none;margin-top: 10px;" >
- <tr>
- <td style="font-size: 24px;font-weight:bold" class="column" colspan="15" align="center">入库明细</td>
- </tr>
- <tr>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">入库时间</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">产品名称</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">规格</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">数量</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">供货商</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">供货人</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">联系电话</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">生产日期或批号</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">保质期限</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">保存条件</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">索证索票情况</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">采购人</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" colspan="2">检验结果</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">验收人</td>
- </tr>
- <tr>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >感官</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >数量</td>
- </tr>
- <tr v-for="(item,index) in this.detailData" :key="index">
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.fBsdate}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.feeName}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fFeeunitid}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fQty}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.corpName}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fAmount}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fStltypeid}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.tProductdate}}/{{item.fLotno}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fValidName}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fStoreEnvName}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fIsfillesName}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.fpurchaseName}}</td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
- <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
- </tr>
- </table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="Printing">打印</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { select } from '@/api/system/set'
- import MainForm from '@/combination/MainForm'
- import { listInStock, addSave, getSave, getArea,
- getustomer,getEntry, getwarehouse, getGoodName,
- canBedelet, delRows, getWarehousekeeper, addWarehous,
- deletMain, delFee, copyNew, listQuery} from '@/api/warehouse/inStock'
- import Cookies from 'js-cookie'
- import { getliable } from '@/api/project'
- export default {
- name: 'inStock',
- data(){
- return{
- copyeId:'',
- hasPermi:{
- lookup:['anpin:stockControl:query'],
- disappear:['anpin:stockControl:remove']
- },
- formList:{},
- dialogVisible: false,
- mainTatol:['金额'],
- ids:[],
- listData:{
- fFeeid:[],
- fFeeunitid:[],
- fStltypeid:[],
- fWarehouseid:[],
- fUnits:[],
- fStoreEnv:[],
- fIsfilles:[],
- },
- selection:[],
- isItHidden:true,
- // 非单个禁用
- single: true,
- // 总条数
- total: 0,
- inDex:4,
- tatolLabel:['单价','数量','金额'],
- MainTable:false,
- show: false,
- arrow:'el-icon-arrow-up',
- queryList:{
- tableName:'入库主表',
- columnList:[]
- },
- detailList:{
- tableName:'仓库入库详情',
- columnList:[]
- },
- //判断自定义列是否有值再渲染组件
- waitFor:false,
- display:3,
- queryParms:{
- pageNum: 1,
- pageSize: 10,
- fBilltype:'RK'
- },
- detailForm:{
- },
- setRowList:[],
- //主页面默认显示4个表单数据
- formOption:[
- {
- span:6,
- label: 'fBillno',
- name:"系统编号",
- form:2,
- width:200,
- labelSize:'80',
- rules: { required:false }
- },
- {
- span:6,
- label: 'fWarehouseid',
- name:"仓库",
- form:1,
- width:200,
- labelSize:'80',
- rules: { required:false },
- data:[]
- },
- {
- span:6,
- label: 'fCorpid',
- name:"供应商",
- form:1,
- width:200,
- labelSize:'80',
- rules: { required:false },
- data:[]
- },
- {
- span:6,
- label: 'timeInterval',
- name:"入库日期",
- form:6,
- width:250,
- labelSize:'80',
- rules: { required:false },
- },
- {
- span:6,
- label: 'cLoadDate',
- name:"制单日期",
- form:6,
- width:200,
- labelSize:'80',
- rules: { required:false }
- },
- {
- span:6,
- label: 'moneys',
- name:"金额范围",
- form:5,
- width:200,
- labelSize:'80',
- rules: { required:false }
- },
- {
- span:6,
- label: 'createBy',
- name:"申请人",
- form:2,
- width:200,
- labelSize:'80',
- rules: { required:false }
- },
- {
- span:6,
- label: 'fGoodsid',
- name:"项目名称",
- form:1,
- width:200,
- labelSize:'80',
- rules: { required:false },
- data:[]
- },
- {
- span:6,
- label: 'remark',
- name:"备注",
- form:2,
- width:200,
- labelSize:'80',
- rules: { required:false }
- },
- ],
- //表名称
- tableData:[],
- //从表表名
- detailData:[],
- //传输表
- mainStyle:[],
- //表数据
- listStyle: [
- {
- surface: "1",
- label: "serialNumber",
- name: "序号",
- checked: 0,
- width: 100,
- onabort:''
- },{
- surface: "2",
- label: "fBillno",
- name: "系统编号",
- checked: 0,
- width: 100,
- }, {
- surface: "3",
- label: "fWarehouseName",
- name: "仓库",
- checked: 0,
- width: 200,
- operation:1
- },
- {
- surface: "4",
- label: "corpName",
- name: "供应商",
- checked: 0,
- width: 200,
- operation:1
- },{
- surface: "5",
- label: "fMoney",
- name: "金额",
- checked: 0,
- width: 200,
- operation:1
- },{
- surface: "6",
- label: "createTime",
- name: "制单日期",
- checked: 0,
- width: 200,
- operation:1
- },{
- surface: "7",
- label: "fBsdate",
- name: "入库日期",
- checked: 0,
- width: 200,
- operation:1
- },
- {
- surface: "8",
- label: "createBy",
- name: "申请人",
- checked: 0,
- width: 200,
- operation:1
- },{
- surface: "9",
- label: "fBillstatusName",
- name: "状态",
- checked: 0,
- width: 200,
- operation:1
- },{
- surface: "10",
- label: "fReviewDate",
- name: "审核日期",
- checked: 0,
- width: 200,
- operation:1,
- },
- {
- surface: "11",
- label: "projectName",
- name: "项目名称",
- checked: 0,
- width: 200,
- operation:1
- },{
- surface: "12",
- label: "remark",
- name: "备注",
- checked: 0,
- width: 200,
- operation:1
- },{
- surface: "13",
- label: "fMaterial2",
- name: "操作",
- checked: 0,
- width: 200,
- operation:1,
- fixed:'right'
- }
- ],
- //从表数据
- detailStyle: [
- {
- surface: "1",
- label: "serialNumber",
- name: "序号",
- checked: 0,
- width: 100,
- onabort:''
- },{
- surface: "2",
- label: "fFeeid",
- name: "*品名",
- checked: 0,
- width: 200,
- changeable:1,
- data:[],
- disabled:false
- },
- {
- surface: "3",
- label: "fCurrencyName",
- name: "*规格",
- checked: 0,
- width: 100,
- disabled:false
- },
- {
- surface: "4",
- label: "fUnitprice",
- name: "*单价",
- checked: 0,
- width: 100,
- operation:2,
- changeable:2,
- disabled:false,
- onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
- },{
- surface: "5",
- label: "fQty",
- name: "*数量",
- checked: 0,
- width: 100,
- operation:2,
- changeable:2,
- disabled:false,
- onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
- },{
- surface: "6",
- label: "fFeeunitid",
- name: "*计量单位",
- checked: 0,
- width: 100,
- changeable:1,
- operation:2,
- data:[],
- disabled:false
- },{
- surface: "7",
- label: "fWarehouseid",
- name: "*库区",
- checked: 0,
- width: 100,
- operation:2,
- changeable:1,
- data:[],
- disabled:false
- },{
- surface: "8",
- label: "fAmount",
- name: "*金额",
- checked: 0,
- width: 100,
- operation:2,
- disabled:false
- },{
- surface: "9",
- label: "fStltypeid",
- name: "付费方式",
- checked: 0,
- width: 100,
- operation:2,
- changeable: 1,
- data:[],
- disabled:false
- },
- {
- surface: "10",
- label: "tProductdate",
- name: "生产日期",
- checked: 0,
- width: 100,
- operation:2,
- changeable: 3,
- data:[],
- disabled:false
- },{
- surface: "11",
- label: "fLotno",
- name: "批号",
- checked: 0,
- width: 100,
- operation:2,
- changeable: 2,
- data:[],
- disabled:false
- },
- {
- surface: "12",
- label: "fValid",
- name: "保质期限",
- checked: 0,
- width: 100,
- operation:2,
- changeable: 2,
- data:[],
- disabled:false,
- onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
- },
- {
- surface: "13",
- label: "fUnits",
- name: "单位",
- checked: 0,
- width: 100,
- operation:2,
- changeable: 1,
- data:[],
- disabled:false
- },
- {
- surface: "14",
- label: "fStoreEnv",
- name: "存储环境",
- checked: 0,
- width: 100,
- operation:2,
- changeable: 1,
- data:[],
- disabled:false
- },
- {
- surface: "15",
- label: "fIsfilles",
- name: "索证索票",
- checked: 0,
- width: 100,
- operation:2,
- changeable: 1,
- disabled:false
- },
- {
- surface: "16",
- label: "remark",
- name: "备注",
- checked: 0,
- width: 100,
- operation:2,
- changeable: 2,
- disabled:false
- },{
- surface: "17",
- label: "fReviewDate",
- name: "审核日期",
- checked: 0,
- width: 100,
- operation:2,
- disabled:false
- },
- {
- surface: "18",
- label: "createBy",
- name: "申请人",
- checked: 0,
- width: 100,
- operation:2,
- disabled:false
- },{
- surface: "19",
- label: "fMaterial10",
- name: "操作",
- checked: 0,
- width: 100,
- operation:2,
- disabled:false
- }
- ],
- //详情主表
- detailOption:[
- {
- index:'1',
- span:6,
- label: 'fBillno',
- name:"系统编号",
- form:2,
- width:200,
- labelSize:'80',
- rules:'',
- disabled:true,
- doNot:'1'
- },
- {
- index:'2',
- span:6,
- label: 'fCorpid',
- name:"供应商",
- form:1,
- width:200,
- labelSize:'80',
- rules:{ required: true, message: ' ', trigger: 'blur' },
- data:[],
- disabled:false
- },
- {
- index:'3',
- span:6,
- label: 'fStorekeeper',
- name:"库管员",
- form:1,
- width:200,
- labelSize:'80',
- rules:{ required: true, message: ' ', trigger: 'blur' },
- data:[],
- disabled:false
- },
- {
- index:'4',
- span:6,
- label: 'fPurchase',
- name:"采购人",
- form:1,
- width:200,
- labelSize:'80',
- rules:{ required: true, message: ' ', trigger: 'blur' },
- data:[],
- disabled:false
- },
- {
- index:'5',
- span:6,
- label: 'fWarehouseid',
- name:"仓库",
- form:1,
- width:200,
- labelSize:'80',
- rules:{ required: true, message: ' ', trigger: 'blur' },
- data:[],
- disabled:false
- }, {
- index:'6',
- span:6,
- label: 'fSbu',
- name:"开票公司",
- form:1,
- width:200,
- labelSize:'80',
- rules:{ required: true, message: ' ', trigger: 'blur' },
- data:[],
- disabled:false
- },
- {
- index:'7',
- span:6,
- label: 'fBsdate',
- name:"入库日期",
- form:3,
- width:200,
- labelSize:'80',
- rules:{ required: true, message: ' ', trigger: 'blur' },
- disabled:false
- },
- {
- index:'8',
- span:6,
- label: 'remark',
- name:"备注",
- form:4,
- width:200,
- labelSize:'80',
- rules:'',
- disabled:false
- },
- ],
- //按钮
- customButton:[
- {
- type:'primary',
- size:'mini',
- icon:'el-icon-plus',
- name:'新单',
- disabled:false,
- hasPermi:['anpin:stockControl:anPingApply']
- },{
- type:'success',
- size:'mini',
- icon:'el-icon-edit',
- name:'修改',
- res:0,
- disabled:true,
- hasPermi:['anpin:stockControl:anPingApply']
- },{
- type:'info',
- size:'mini',
- icon:'el-icon-plus',
- name:'复制新增',
- disabled:true,
- hasPermi:['anpin:stockControl:generateReceipts']
- },
- ],
- seachButton:[
- {
- type:'',
- size:'mini',
- icon:'el-icon-search',
- name:'搜索',
- disabled:false,
- },{
- type:'',
- size:'mini',
- icon:'el-icon-refresh',
- name:'重置',
- disabled:false,
- },{
- type:'',
- size:'mini',
- icon:'el-icon-arrow-up',
- name:'展开',
- disabled:false
- }
- ],
- detailButton:[
- // {
- // type:'danger',
- // size:'mini',
- // icon:'el-icon-refresh-left',
- // name:'返回列表',
- // disabled:false,
- // },
- {
- type:'primary',
- size:'mini',
- icon:'el-icon-edit',
- name:'录入明细',
- disabled:false,
- },
- {
- type:'success',
- size:'mini',
- icon:'el-icon-check',
- name:'保存',
- disabled:false
- },
- {
- type:'primary',
- size:'mini',
- icon:'el-icon-edit',
- name:'新单',
- nameTwo:'详情页',
- plain: true,
- disabled:false,
- },
- {
- type:'primary',
- size:'mini',
- icon:'el-icon-edit',
- name:'复制新单',
- copyeRow:true,
- plain: true,
- disabled:false,
- },{
- type:'info',
- size:'mini',
- icon:'el-icon-edit',
- name:'修改',
- disabled:false,
- res:1
- },{
- type:'info',
- size:'mini',
- icon:'el-icon-edit',
- name:'打印',
- disabled:false,
- res:1
- },{
- type:'info',
- size:'mini',
- icon:'el-icon-edit',
- name:'入库确认',
- disabled:false,
- res:1
- },
- {
- type:'warning',
- size:'mini',
- icon:'el-icon-refresh',
- name:'刷新',
- disabled:false,
- res:1
- }
- ],
- confirmButton:[
- {
- type:'cyan',
- size:'mini',
- icon:'',
- name:'打印',
- disabled:false,
- },{
- type:'info',
- size:'mini',
- icon:'',
- name:'入库确认',
- disabled:false
- }
- ]
- }
- },
- activated(){
- if (this.$route.query.open === 'true'){
- // this.detailList.columnList = this.detailStyle
- this.detailForm = {}
- this.detailData = []
- // this.inDex = this.detailOption.length
- //从表修改按钮
- let data = {
- tableName: this.detailList.tableName,
- userId: Cookies.get('userName')
- }
- this.getRow(data,null,1)
- for(let li in this.detailList.columnList){
- if(!this.detailList.columnList[li].doNot){
- this.detailList.columnList[li].disabled = false
- }
- }
- for(let item in this.detailOption){
- if(!this.detailOption[item].doNot){
- this.detailOption[item].disabled = false
- }
- }
- for(let li in this.detailButton){
- this.detailButton[li].disabled = false
- }
- this.MainTable = true
- this.$router.push({ query: {} })
- }
- },
- created() {
- let data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get("userName"),
- };
- this.getRow(data)
- let list = {
- fBilltype:'RK'
- }
- this.query(list)
- this.getList()
- this.selectMethods()
- },
- methods:{
- //返回列表
- goBack(){
- },
- change(scope){
- for(let item in this.detailData){
- for(let li in this.listData.fFeeid){
- if(this.detailData[item].fFeeid == this.listData.fFeeid[li].value){
- this.$set(this.detailData[item],'fFeeunitid',JSON.stringify(this.listData.fFeeid[li].fFeeunitid))
- this.$set(this.detailData[item],'fCurrencyName',this.listData.fFeeid[li].fCurrency)
- }
- }
- }
- },
- //确认打印
- Printing(){
- this.$print(this.$refs.print)
- },
- //查询主页列数据
- query(data){
- listQuery(data).then(res =>{
- this.tableData = res.rows
- })
- },
- //更换仓库
- changeWarehouse(){
- if(this.detailData.length != 0){
- for(let li in this.detailData){
- this.detailData[li].fWarehouseid = ''
- }
- }
- getArea(this.detailForm.fWarehouseid).then(res=>{
- this.listData.fWarehouseid = []
- for(let item in res.data){
- this.listData.fWarehouseid.push({
- label:res.data[item].fWarehouseInformation,
- value:res.data[item].id
- })
- }
- })
- },
- //自动合计金额
- totalAmount(){
- for(let li in this.detailData){
- if(this.detailData[li].fUnitprice && this.detailData[li].fQty){
- this.detailData[li].fAmount = (this.detailData[li].fUnitprice * this.detailData[li].fQty).toFixed(2)
- }
- }
- },
- //搜索、重置、展开
- feedback(res){
- if (res == '展开'){
- if (this.inDex == 4){
- this.inDex = this.formOption.length
- }else {
- this.inDex = 4
- }
- }else if (res == '搜索'){
- this.handleQuery()
- }else if (res == '重置'){
- this.resetQuery()
- }
- },
- selectMethods(){
- this.mainMethods()
- this.detailMethods()
- },
- //主页面下拉获取名称
- mainMethods(){
- for(let li in this.formOption){
- if(this.formOption[li].name == '仓库'){
- let queryParams = { pageNum: 1,}
- getwarehouse(queryParams).then(res=>{
- for(let item in res.rows){
- this.formOption[li].data.push({
- label:res.rows[item].fName,
- value:res.rows[item].fId
- })
- }
- })
- }
- else
- if(this.formOption[li].name == '供应商'){
- let queryParams = { pageNum: 1, fTypeid: 1}
- getustomer(queryParams).then(res => {
- for(let item in res.data){
- this.formOption[li].data.push({
- label:res.data[item].fName,
- value:res.data[item].fId
- })
- }
- })
- }
- }
- },
- //弹窗页获取下拉名称
- detailMethods(){
- for(let li in this.detailOption){
- if(this.detailOption[li].name == '仓库'){
- //获取仓库
- let queryParams = { pageNum: 1 }
- getwarehouse(queryParams).then(res=>{
- for(let item in res.rows){
- this.detailOption[li].data.push({
- label:res.rows[item].fName,
- value:res.rows[item].fId
- })
- }
- })
- }
- if(this.detailOption[li].name == '供应商'){
- //获取供应商
- let queryParams = { pageNum: 1, fTypeid: 1}
- getustomer(queryParams).then(res => {
- for(let item in res.data){
- this.detailOption[li].data.push({
- label:res.data[item].fName,
- value:res.data[item].fId
- })
- }
- })
- }
- if(this.detailOption[li].name == '开票公司'){
- //获取付款单位
- let queryParams = { pageNum: 1, fTypeid: 2}
- getustomer(queryParams).then(res => {
- for(let item in res.data){
- this.detailOption[li].data.push({
- label:res.data[item].fName,
- value:res.data[item].fId
- })
- }
- })
- }
- if(this.detailOption[li].name == '库管员'){
- let queryParams = { pageNum: 1,roleName:'库管'}
- getWarehousekeeper(queryParams).then(res=>{
- for(let item in res.rows){
- this.detailOption[li].data.push({
- label:res.rows[item].userName,
- value:res.rows[item].userId
- })
- }
- })
- }
- if(this.detailOption[li].name == '采购人'){
- getliable().then((res) => {
- for(let item in res.rows){
- this.detailOption[li].data.push({
- label:res.rows[item].userName,
- value:res.rows[item].userId
- })
- }
- })
- }
- }
- //获取计量单位字典表
- this.getDicts('data_unitfees').then((response) => {
- if (response.data) {
- for (let item in response.data) {
- this.listData.fFeeunitid.push({
- label: response.data[item].dictLabel,
- value: response.data[item].dictValue
- })
- }
- }
- })
- //获取浮点单位字典表
- this.getDicts('f_floatunit').then((response) => {
- if (response.data) {
- for (let item in response.data) {
- this.listData.fUnits.push({
- label: response.data[item].dictLabel,
- value: JSON.parse(response.data[item].dictValue)
- })
- }
- }
- })
- //获取存储环境字典表
- this.getDicts('f_StorageEnvironment').then((response) => {
- if (response.data) {
- for (let item in response.data) {
- this.listData.fStoreEnv.push({
- label: response.data[item].dictLabel,
- value: JSON.parse(response.data[item].dictValue)
- })
- }
- }
- })
- this.getDicts('f_evidence').then((response) => {
- if (response.data) {
- for (let item in response.data) {
- this.listData.fIsfilles.push({
- label: response.data[item].dictLabel,
- value: JSON.parse(response.data[item].dictValue)
- })
- }
- }
- })
- //获取品名
- let queryParams = { pageNum: 1 }
- getGoodName(queryParams).then(res=>{
- for(let item in res.rows){
- this.listData.fFeeid.push({
- label:res.rows[item].fName,
- value:res.rows[item].fId,
- fFeeunitid: res.rows[item].fFeeunitid,
- fCurrency: res.rows[item].fCurrency
- })
- }
- })
- //付费方式
- this.getDicts('f_paymode').then((response) => {
- if (response.data) {
- for (let item in response.data) {
- this.listData.fStltypeid.push({
- label: response.data[item].dictLabel,
- value: response.data[item].dictValue
- })
- }
- }
- })
- },
- handleQuery(){
- this.$refs.MainForm.hide()
- this.getList();
- },
- resetQuery(){
- this.queryParms = {}
- this.getList();
- },
- //查询列数据
- getRow(data,list,iem) {
- select(data).then((res) => {
- if (data.tableName === '仓库入库详情') {
- if (res.data.length != 0) {
- this.detailList.columnList = res.data.filter((e) => e.checked == 0);
- this.detailList.columnList = res.data;
- this.setRowList = res.data
- this.detailList.columnList = this.detailList.columnList.filter((e) => e.checked == 0);
- // this.waitFor = true
- console.log("000")
- }else {
- // this.waitFor = true
- this.$set(this.detailList,'columnList',this.$options.data().detailStyle)
- this.setRowList = this.$options.data().detailStyle
- }
- this.isItHidden = false
- this.inDex = this.detailOption.length
- if (iem === undefined){
- console.log("111")
- this.detailList.columnList.forEach(item => item.disabled = true)
- }else if(iem == 1){
- for(let li in this.detailList.columnList){
- if(!this.detailList.columnList[li].doNot){
- this.detailList.columnList[li].disabled = false
- }
- }
- }
- }else {
- if (res.data.length != 0) {
- this.queryList.columnList = res.data.filter((e) => e.checked == 0);
- this.queryList.columnList = res.data;
- this.setRowList = res.data
- this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0);
- this.waitFor = true
- }else {
- this.waitFor = true
- this.$set(this.queryList,'columnList',this.$options.data().listStyle)
- this.setRowList = this.$options.data().listStyle
- }
- this.isItHidden = true
- this.inDex = 4
- }
- if(list){
- console.log("333")
- this.detailForm = list.warehouseBills
- this.detailData = list.tWarehousebillsfees
- this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
- for(let li in this.detailData){
- this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
- this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
- }
- this.detailButton = this.$options.data().detailButton
- for(let li in this.detailButton){
- if(this.detailForm.fBillstatus == '6'){
- if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
- this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
- this.detailButton[li].disabled = true
- }else{
- this.detailButton[li].disabled = false
- }
- } else {
- if (iem === undefined){
- if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
- this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新'){
- this.detailButton[li].disabled = true
- }else{
- this.detailButton[li].disabled = false
- }
- }
- }
- }
- }
- });
- },
- //选择框
- selectionbox(selection){
- this.selection = selection
- this.ids = selection.map((item) => item.fId)
- this.single = selection.length !== 1
- for(let li in this.customButton){
- if(this.customButton[li].name == '修改' || this.customButton[li].name == '复制新增'){
- this.customButton[li].disabled = this.single
- }
- }
- },
- //查看
- viewMethod(scope,res,iem){
- // this.detailList.columnList = this.detailStyle
- let fId = ''
- if(scope){
- fId = scope.row.fId
- for(let item in this.detailOption){
- this.detailOption[item].disabled = true
- }
- }else if(res){
- fId = this.copyeId
- this.detailButton.forEach(item => item.disabled = false)
- this.detailList.columnList.forEach(item => {
- if(!item.doNot){
- item.disabled = false
- }
- })
- this.detailOption.forEach(item => {
- if(!item.doNot){
- item.disabled = false
- }
- })
- } else{
- fId = this.ids
- }
- getSave(fId).then(res=>{
- if(res.code == 200){
- let data = {
- tableName: this.detailList.tableName,
- userId: Cookies.get('userName')
- }
- let list ={
- warehouseBills:res.data.warehouseBills,
- tWarehousebillsfees:res.data.tWarehousebillsfees
- }
- this.getRow(data,list,iem)
- }
- if(res.data.warehouseBills){
- getArea(res.data.warehouseBills.fWarehouseid).then(res=>{
- if(res.code == 200){
- this.listData.fWarehouseid = []
- for(let item in res.data){
- this.listData.fWarehouseid.push({
- label:res.data[item].fWarehouseInformation,
- value:res.data[item].id
- })
- }
- }
- })
- }
- this.MainTable = true
- this.inDex = this.detailOption.length
- })
- },
- //修改
- modification(scope){
- },
- //删除
- deletion(scope){
- const fIds = scope.row.fId || this.ids;
- let tips = "";
- deletMain(fIds).then(res=>{
- switch (res.msg) {
- case "0": {
- this.$message.error("当前数据已被其他操作员操作,请刷新页面");
- break;
- }
- case "1": {
- tips = "当前主表有数据,确认是否删除?";
- this.delete_s(fIds, tips);
- break;
- }
- case "2": {
- tips = "当前主表有数据,从表有数据,确认是否删除?";
- this.delete_s(fIds, tips);
- break;
- }
- default: {
- return this.$message.error("未知错误,无状态");
- }
- }
- })
- },
- delete_s(fIds, tips) {
- this.$confirm(tips, "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- return delFee(fIds);
- })
- .then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- });
- },
- //删除从表行
- deletRows(index,rows){
- if(rows[index].fId){
- let formData = {
- fId:this.detailForm.fId,
- fDateChanged:this.detailForm.fDateChanged
- }
- canBedelet(formData).then(res=>{
- return delRows(rows[index].fId)
- })
- .then(()=>{
- getSave(this.detailForm.fId).then(res=>{
- if(res.code == 200){
- if(res.data.warehouseBills){
- this.detailForm = res.data.warehouseBills
- this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
- }
- if(res.data.tWarehousebillsfees){
- this.detailData = res.data.tWarehousebillsfees
- for(let li in this.detailData){
- this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
- this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
- }
- }
- this.msgSuccess("删除成功");
- }
- })
- })
- .catch(res=>{
- this.$message.error(res)
- })
- }else {
- rows.splice(index, 1)
- }
- },
- //必填项新行
- verificationRules(valid){
- if(valid){
- this.detailData.push({
- serialNumber:null,
- fFeeid:null,
- fUnitprice:null,
- fQty:null,
- fFeeunitid:null,
- fWarehouseid:null,
- fAmount:null,
- fStltypeid:'1',
- tProductdate:null,
- fLotno:null,
- fValid:null,
- fUnits:null,
- fStoreEnv:null,
- fIsfilles:0,
- remark:null,
- fReviewDate:null,
- createBy:null,
- })
- }
- },
- //返回列表是否保存
- backRules(){
- for(let li in this.detailOption) {
- if(this.detailOption[li].name == '供应商'){
- if(this.detailOption[li].disabled == true){
- this.inDex = 4
- this.getList();
- this.isItHidden = true
- this.MainTable = false
- } else {
- this.$confirm("返回列表,是否保存?", "提示", {
- confirmButtonText: "保存",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- this.$refs.detailForm.saveRules('1')
- }).catch(() => {
- this.inDex = 4
- this.isItHidden = true
- this.MainTable = false
- this.getList();
- });
- }
- }
- }
- },
- backSave(valid,i){
- if(valid){
- if(this.detailForm.fBillstatus < 4 || !this.detailForm.fBillstatus){
- this.detailForm.fMoney = 0
- for(let li in this.detailData){
- if(this.detailData[li]){
- this.detailForm.fMoney += Number(this.detailData[li].fAmount)
- }
- }
- let formData = new window.FormData();
- formData.append('tWarehousebills', JSON.stringify(this.detailForm))
- formData.append('tWarehousebillsfees', JSON.stringify(this.detailData))
- formData.append('fBilltype', 'RK')
- addSave(formData).then(res=> {
- if (res.code == 200) {
- this.detailForm = res.data.warehouseBills
- this.$set(this.detailForm, 'fStorekeeper', JSON.parse(this.detailForm.fStorekeeper))
- this.detailData = res.data.tWarehousebillsCntrs
- for (let li in this.detailData) {
- this.$set(this.detailData[li], 'fFeeunitid', JSON.stringify(this.detailData[li].fFeeunitid))
- this.$set(this.detailData[li], 'fStltypeid', JSON.stringify(this.detailData[li].fStltypeid))
- }
- this.getList();
- if(i == 2){
- let data ={
- fBilltype:'RK',
- fId:this.detailForm.fId
- }
- copyNew(data).then(res=>{
- if(res.code == 200) {
- this.$message.success("操作成功")
- this.copyeId = res.data
- this.getList()
- this.viewMethod(null,1,2)
- }
- })
- }else{
- this.$message.success("保存成功")
- }
- }
- })
- } else if(i == 2 && this.detailForm.fBillstatus > 3 ){
- let data = {
- fBilltype:'RK',
- fId:this.detailForm.fId
- }
- copyNew(data).then(res=>{
- if(res.code == 200) {
- this.$message.success("操作成功")
- this.copyeId = res.data
- this.getList()
- this.viewMethod(null,1,2)
- }
- })
- }
- if(i == 1){
- this.isItHidden = true
- this.MainTable = false
- this.inDex = 4
- }
- }
- },
- //所以按钮
- buttonList(row){
- switch (row.name) {
- case '新单':
- if(row.nameTwo == '详情页'){
- if(this.detailForm.fId){
- this.detailList.columnList = this.detailStyle
- this.detailForm = {}
- this.detailData = []
- this.inDex = this.detailOption.length
- //从表修改按钮
- for(let li in this.detailStyle){
- if(!this.detailStyle[li].doNot){
- this.detailStyle[li].disabled = false
- }
- }
- for(let item in this.detailOption){
- if(!this.detailOption[item].doNot){
- this.detailOption[item].disabled = false
- }
- }
- for(let li in this.detailButton){
- this.detailButton[li].disabled = false
- }
- this.MainTable = true
- }else{
- this.$message.error("当前数据为保存,请保存")
- }
- }else{
- this.detailList.columnList = this.detailStyle
- this.detailForm = {}
- this.detailData = []
- this.inDex = this.detailOption.length
- //从表修改按钮
- for(let li in this.detailStyle){
- if(!this.detailStyle[li].doNot){
- this.detailStyle[li].disabled = false
- }
- }
- for(let item in this.detailOption){
- if(!this.detailOption[item].doNot){
- this.detailOption[item].disabled = false
- }
- }
- for(let li in this.detailButton){
- this.detailButton[li].disabled = false
- }
- this.MainTable = true
- }
- break
- case '录入明细':
- this.$refs.detailForm.rules()
- break
- case '返回列表':
- this.backRules()
- break
- case '保存':
- this.$refs.detailForm.saveRules()
- break
- case '入库确认':
- if(this.detailData.length == 0){
- this.$message.error("请维护明细")
- }else{
- for(let item in this.detailData) {
- let num = Number(item) + 1
- if (!this.detailData[item].fFeeid) {
- this.$message.error("请维护第" + num + "行品名")
- return false
- }
- if (!this.detailData[item].fCurrencyName) {
- this.$message.error("请维护第" + num + "行规格")
- return false
- }
- if (!this.detailData[item].fUnitprice) {
- this.$message.error("请维护第" + num + "行单价")
- return false
- }
- if(!this.detailData[item].fQty){
- this.$message.error("请维护第" + num + "数量")
- return false
- }
- if (!this.detailData[item].fFeeunitid) {
- this.$message.error("请维护第" + num + "行计量单位")
- return false
- }
- if (!this.detailData[item].fWarehouseid) {
- this.$message.error("请维护第" + num + "行库区")
- return false
- }
- if (!this.detailData[item].fAmount) {
- this.$message.error("请维护第" + num + "行金额")
- return false
- }
- }
- this.detailForm.fMoney = 0
- for(let li in this.detailData){
- if(this.detailData[li]){
- this.detailForm.fMoney += Number(this.detailData[li].fAmount)
- }
- }
- let formData = new window.FormData();
- formData.append('tWarehousebills', JSON.stringify(this.detailForm))
- formData.append('tWarehousebillsfees', JSON.stringify(this.detailData))
- formData.append('fBilltype', 'RK')
- addWarehous(formData).then(res=>{
- if(res.data.warehouseBills){
- this.detailForm = res.data.warehouseBills
- this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
- }
- if(res.data.tWarehousebillsCntrs){
- this.detailData = res.data.tWarehousebillsCntrs
- for(let li in this.detailData){
- this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
- this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
- }
- }
- this.$message.success("操作成功")
- for(let li in this.detailList.columnList){
- this.detailList.columnList[li].disabled = true
- }
- for(let item in this.detailOption){
- this.detailOption[item].disabled = true
- }
- for(let li in this.detailButton) {
- if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
- this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
- this.detailButton[li].disabled = true
- }else{
- this.detailButton[li].disabled = false
- }
- }
- })
- }
- break
- case '刷新':
- if(this.detailForm.fId){
- getSave(this.detailForm.fId).then(res=>{
- if(res.data.warehouseBills){
- this.detailForm = res.data.warehouseBills
- this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
- }
- if(res.data.tWarehousebillsfees){
- this.detailData = res.data.tWarehousebillsfees
- for(let li in this.detailData){
- this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
- this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
- }
- }
- })
- }
- break
- case '复制新增':
- let formDate = {
- fBilltype:'RK',
- fId:this.selection[0].fId
- }
- copyNew(formDate).then(res=>{
- if(res.code == 200) {
- this.$message.success("操作成功")
- this.copyeId = res.data
- this.getList()
- this.viewMethod(null,1)
- }
- })
- break
- case '复制新单':
- this.$refs.detailForm.saveRules('2')
- break
- case '打印':
- this.formList = this.detailForm
- this.dialogVisible = true
- break
- }
- if(row.name == '修改' && row.res == '0'){
- this.viewMethod()
- }
- if(row.res === 1){
- //从表修改按钮
- for(let li in this.detailList.columnList){
- if(!this.detailList.columnList[li].doNot){
- this.detailList.columnList[li].disabled = false
- }
- }
- for(let item in this.detailOption){
- if(!this.detailOption[item].doNot){
- this.detailOption[item].disabled = false
- }
- }
- for(let li in this.detailButton){
- this.detailButton[li].disabled = false
- }
- }
- },
- // 显示搜索条件、点击后会调用此方法
- showSearch(){
- this.getList()
- },
- //点击刷新会调用此方法
- getList(res){
- this.queryParms.fBilltype = 'RK'
- listInStock(this.queryParms).then(response=>{
- this.tableData = response.rows
- this.total = response.total
- if(res == 1){
- this.copyeId = this.tableData[0].fId
- this.viewMethod(null,1)
- }
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .app-container ::v-deep .el-form-item {
- margin-bottom: 4px;
- }
- .app-container ::v-deep .el-table__body-wrapper{
- z-index: 2;
- }
- </style>
|