12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406 |
- <template>
- <!-- 面料损耗表 -->
- <div id="fabricLossTable" >
- <div >
- <!-- 主要信息 点击搜索后 全部回显-->
- <a-card title="主要信息" >
- <a-row :gutter="24" >
- <div class="table-page-search-wrapper" >
- <a-form-model layout="inline" ref="form" :model="fabricLoss" :rules="validatorRules" class="kk">
- <a-col :md="6" :sm="8">
- <a-form-model-item label="计划单号">
- <a-input-search
- placeholder="请输入计划单号"
- v-model="planNO"
- enter-button
- @search="onSearch($event,'0')"
- v-show='showSelect==0'
- />
- <a-input-search
- placeholder="请输入计划单号"
- v-text="planNO"
- enter-button
- @search="onSearch($event,'0')"
- v-show='showSelect==1'
- />
- <a-button type="primary" :disabled="edit == '0'" @click="onSearch(planNO,'1')" class="noprint">更新</a-button>
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="款号" has-feedback>
- {{fabricLoss.cdefine22}}
- <!-- <a-input v-model="fabricLoss.styleNum"></a-input> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="计划员">
- {{fabricLoss.planner}}
- <!-- <a-input v-model="fabricLoss.planner"></a-input> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="成衣合同号">
- {{fabricLoss.contractNo}}
- <!-- <a-input v-model="fabricLoss.garmentContractNo"></a-input> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="排单数量">
- {{fabricLoss.number}}
- <!-- <a-input v-model="fabricLoss.singleRowNum"></a-input> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="业务员">
- {{fabricLoss.cpersonName}}
- <!-- <a-input v-model="fabricLoss.salesman"></a-input> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="总成本">
- {{fabricLoss.actualMoney}}
- <!-- <a-input v-model="fabricLoss.actualUnitCost"></a-input> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="实际出库数量">
- {{fabricLoss.outboundNumber}}
- <!-- <a-input v-model="fabricLoss.actualOutQuantity"></a-input> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="制单人">
- {{fabricLoss.makingPeople}}
- <!-- <a-input v-model="fabricLoss.preparedBy"></a-input> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-model-item label="查询日期">
- {{fabricLoss.dateTime}}
- <!-- <a-date-picker style="width: 100%" v-model="fabricLoss.queryDate"></a-date-picker> -->
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8" class="noprint">
- <a-button type="primary" @click="openEnclosure">附件</a-button>
- </a-col>
- </a-form-model>
- </div>
- </a-row>
- </a-card>
- </div>
- <div >
- <!-- 子表 -->
- <a-card style="margin:10px 0;">
- <!-- 采购订单 -->
- <div class="purchase-order-table">
- <h6 class="table-title">采购订单</h6>
- <a-table
- :row-key="record => record.id"
- :loading="loading"
- :columns="purchaseOrderColumns"
- :data-source="fabricLoss.fabricPoOrderList"
- bordered
- :pagination="false"
- :rowClassName="setRowClassName"
- >
- <template slot="omcVenAbbName" slot-scope="text, record, index">
- <div v-for="(item,index) in record.omcVenAbbNameArray" :key="index">
- {{item}}
- </div>
- </template>
- <!-- 采购数量 弹框-->
- <span slot="purchaseQuantity" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- <!-- 余纱 -->
- <span slot="surplusYarn" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- <!-- 来源余纱 -->
- <span slot="fromSurplusYarn" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- <!-- 其他入库的纱 -->
- <span slot="surplusYarn" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- <!-- 分配数量 -->
- <span slot="slotIquantityOut" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- </a-table>
- </div>
- <!-- 委外订单国内 -->
- <div class="outsource-orders-table" style="margin:40px 0" id="mm">
- <h6 class="table-title">委外订单国内</h6>
- <a-table
- id="print1"
- ref="form"
- :row-key="record => record.id"
- :columns="outsourceOrderColumns"
- :data-source="fabricLoss.fabricOMOrderList1"
- bordered
- :pagination="false"
- :scroll="{ x: 1500 }"
- :loading="loading">
- <!-- 材料出库数量 -->
- <span slot="materialsOutQuantity" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- <!-- 采购入库数量 -->
- <span slot="purchaseInQuantity" slot-scope="text">
- <a>{{ text }}</a>
- </span>
-
- <!-- 多发少发 -->
- <span slot="iquantityMoreLess" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- <!-- 附件 -->
- <span slot="enclosure" slot-scope="text, record">
- <a-button type="primary" @click="openItemOnclosure(record)" :disabled="record.buttonStatus">附件</a-button>
- </span>
- </a-table>
- </div>
- <!-- 委外订单国外 -->
- <div class="outsourceOrder-abroad-table" id="cb">
- <h6 class="table-title">委外订单国外</h6>
- <a-table
- :row-key="record => record.id"
- :loading="loading"
- :columns="outsourceOrderColumns"
- :data-source="fabricLoss.fabricOMOrderList2"
- :scroll="{ x: 1500 }"
- bordered
- :pagination="false"
- >
- <!-- 材料出库数量 -->
- <span slot="materialsOutQuantity" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- <!-- 采购入库数量 -->
- <span slot="purchaseInQuantity" slot-scope="text">
- <a>{{ text }}</a>
- </span>
-
- <!-- 多发少发 -->
- <span slot="iquantityMoreLess" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- <!-- 附件 -->
- <span slot="enclosure" slot-scope="text, record">
- <a-button type="primary" @click="openItemOnclosure(record)" :disabled="record.buttonStatus">附件</a-button>
- </span>
- </a-table>
- </div>
- <!-- 成本发票 -->
- <div class="cost-invoice-table" style="margin:40px 0">
- <h6 class="table-title">成本发票</h6>
- <a-table
- :row-key="record => record.id"
- :loading="loading"
- :columns="costInvoiceColumns"
- :data-source="fabricLoss.fabricCostInvoiceList"
- bordered
- :pagination="false"
- >
-
- <!-- 成本金额 -->
- <span slot="imoney" slot-scope="text,record">
- <a v-if="(record.cbusType == '转出成本')|| (record.cbusType == '转入成本')" @click="imoneyCell(record)">{{text}}</a>
- <span v-else >{{text}}</span>
- </span>
- <!-- 工厂 -->
- <span slot="cvenAbbName" slot-scope="text,record">
- <a-input placeholder="请输入工厂" v-model="record.cvenAbbName" v-if="(record.cbusType == '转出成本' && showSelect==0)"/>
- <span v-else>{{text}}</span>
- </span>
- </a-table>
- </div>
- <!-- 开票成本-面料 -->
- <div class="costInvoice-fabric-table">
- <h6 class="table-title">开票成本-面料</h6>
- <!-- ref="" -->
- <a-table
- :row-key="record => record.id"
- :loading="loading"
- :columns="costInvoiceFabricColumns"
- :data-source="fabricLoss.fabricCostClothList"
- bordered
- :pagination="false"
- >
- <!-- 发票号码明细 -->
- <span slot="invoiceNum" slot-scope="text">
- <a v-if="text!=='合计'">{{ text }}</a>
- <span v-else>{{text}}</span>
- </span>
- </a-table>
- </div>
- <!-- 开票成本-成衣 :footer="clothesFooterShow"-->
- <div class="costInvoice-clothes-table" style="margin:40px 0">
- <h6 class="table-title">开票成本-成衣</h6>
- <a-table
- :row-key="record => record.id"
- :loading="loading"
- :columns="costInvoiceClothesColumns"
- :data-source="fabricLoss.fabricCostClothesList"
- bordered
- :pagination="false"
- >
- <!-- 发票数量 -->
- <span slot="clInvoiceQuantity" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- </a-table>
- </div>
- <!-- 开票成本-辅料 -->
- <div class="costInvoice-ingredient-table">
- <h6 class="table-title">开票成本-辅料</h6>
- <a-table
- :row-key="record => record.id"
- :loading="loading"
- :columns="costInvoiceIngredientColumns"
- :data-source="fabricLoss.fabricCostAssistList"
- bordered
- :pagination="false"
- >
- <!-- 发票数量 -->
- <span slot="ingredientsInvoiceQuantity" slot-scope="text, record">
- <a v-if="record.caccount!=='合计'">{{ text }}</a>
- <span v-else>{{text}}</span>
- </span>
- </a-table>
- </div>
- <!-- 费用支出 -->
- <div class="costPay-table noprint" style="margin:40px 0">
- <h6 class="table-title">费用支出</h6>
- <a-table
- :row-key="record => record.id"
- :loading="loading"
- :columns="costPayColumns"
- :data-source="fabricLoss.fabricExpensesList"
- bordered
- :pagination="false"
- :footer="costPayFooterShow"
- >
- </a-table>
- </div>
- <!-- 事故单 -->
- <div class="accidentBill-table">
- <h6 class="table-title">事故单</h6>
- <a-table
- :row-key="record => record.id"
- :loading="loading"
- :columns="accidentListColumns"
- :data-source="fabricLoss.fabricAccidentList"
- bordered
- :pagination="false"
- >
- <!-- 事故单 -->
- <span slot="accidentNum" slot-scope="text">
- <a>{{ text }}</a>
- </span>
- </a-table>
- </div>
-
- <!-- 备注信息 1 根据角色判断 显示备注 1 或备注 2-->
- <div class="note-one" style="marginTop:40px;">
- <h6 class="table-title">备注</h6>
- <div class="noteDetail">
- <a-form-model ref="form" :model="fabricLoss" :rues="validatorRules">
- <a-form-model-item prop="noteOne">
- <a-input type="textarea" v-model="fabricLoss.noteOne" style="minHeight:160px;" v-show='showSelect==0'/>
- <a-input type="textarea" v-text="fabricLoss.noteOne" style="minHeight:160px;" v-show='showSelect==1'/>
- </a-form-model-item>
- </a-form-model>
- </div>
- </div>
- <!-- 采购订单 -->
-
- <!-- 备注信息 2 根据角色判断 显示备注 1 或备注 2-->
- <!-- <div class="note-one" style="marginTop:40px;">
- <h6 class="table-title">备注信息 2</h6>
- <div class="noteDetail">
- <a-form-model ref="form" :model="fabricLoss" :rues="validatorRules">
- <a-form-model-item prop="noteOne">
- <a-input
- type="textarea"
- v-model="fabricLoss.noteTwo"
- placeholder="请输入备注"
- style="minHeight:100px;"
- />
- </a-form-model-item>
- </a-form-model>
- </div>
- </div> -->
- <!-- 页面底部保存 -->
- <a-row :gutter="24" style="marginTop:40px;float:right" class="noprint">
- <a-col :md="12" :sm="12" style="display:flex">
- <a-button type="primary" @click="daYin" style="margin-right:6px" :disabled ="PrintButton">
- 打印
- </a-button>
- <a-button type="primary" @click="save" :loading="loadingBtn">
- 保存
- </a-button>
- </a-col>
- </a-row>
- <!-- 弹框 -->
- <div>
- <!-- 采购数量弹框 @ok="modalFormOk"-->
- <purchaseAmount-modal ref="purchaseAmountModal" :father="aa"></purchaseAmount-modal>
- <!-- 来源余纱 -->
- <surplusYarn-modal ref="surplusYarnModal" :father="bb"></surplusYarn-modal>
- <!-- 余纱 -->
- <purchaseLeft-modal ref="purchaseLeftModal"></purchaseLeft-modal>
- <!-- 其他入库的纱 -->
- <otherYarnsIn-modal ref="otherYarnsInModal" ></otherYarnsIn-modal>
- <!-- 多发少发 -->
- <iquantityMoreLess-modal ref="iquantityMoreLessModal"></iquantityMoreLess-modal>
- <!-- 委外订单国内弹框 -->
- <materialsOutQuantity-modal ref="materialsOutQuantityModal" :father="cc"></materialsOutQuantity-modal>
- <!-- 采购入库数量弹框 -->
- <purchaseInQuantity-modal ref="purchaseInQuantityModal" :father="dd"></purchaseInQuantity-modal>
- <!-- 发票号码弹框 -->
- <invoiceNum-modal ref="invoiceNumModal" :father="ee"></invoiceNum-modal>
- <!-- 发票数量弹框 -->
- <invoiceQuantity-modal ref="invoiceQuantityModal" :father="ff"></invoiceQuantity-modal>
- <!-- 事故单 -->
- <accidentList-modal ref="accidentListModal" :father="gg"></accidentList-modal>
- <!-- 附件 -->
- <attachment-display ref="attachmentDisplay"></attachment-display>
- <imoney-cell ref="imoneyCell"></imoney-cell>
- </div>
- </a-card>
- </div>
- </div>
- </template>
- <script>
- import PurchaseAmountModal from '@views/reportForms/fabric-loss-table/purchaseAmountModal.vue'
- import materialsOutQuantityModal from '@views/reportForms/fabric-loss-table/materialsOutQuantityModal.vue'
- import purchaseInQuantityModal from '@views/reportForms/fabric-loss-table/purchaseInQuantityModal.vue'
- import invoiceNumModal from '@views/reportForms/fabric-loss-table/invoiceNumModal.vue'
- import invoiceQuantityModal from '@views/reportForms/fabric-loss-table/invoiceQuantityModal.vue'
- import accidentListModal from '@views/reportForms/fabric-loss-table/accidentListModal.vue'
- import surplusYarnModal from '@views/reportForms/fabric-loss-table/surplusYarnModal.vue'
- import purchaseLeftModal from '@views/reportForms/fabric-loss-table/purchaseLeftModal.vue'
- import imoneyCell from '@views/reportForms/fabric-loss-table/imoneyCell.vue'
- import iquantityMoreLessModal from '@views/reportForms/fabric-loss-table/iquantityMoreLessModal.vue'
- import otherYarnsInModal from '@views/reportForms/fabric-loss-table/otherYarnsInModal.vue'
- import AttachmentDisplay from '@views/reportForms/fabric-loss-table/attachment-display.vue'
- import { getFabricLossDatas,saveFabricLossData } from '@api/reportForms/fabric-loss-table'
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- export default {
- name: 'FabricLossTable', // 面料损耗表
- mixins: [JeecgListMixin],
- components: {
- // 面料损耗表 所有弹框
- PurchaseAmountModal,
- otherYarnsInModal,
- materialsOutQuantityModal,
- purchaseInQuantityModal,
- invoiceNumModal,
- invoiceQuantityModal,
- iquantityMoreLessModal,
- accidentListModal,
- surplusYarnModal,
- purchaseLeftModal,
- JEllipsis,
- moment,
- AttachmentDisplay,
- imoneyCell
- },
- data() {
- return {
- PrintButton:true,//打印按钮
- showSelect:0,//计划号是否是输入框
- fabricLoss: {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[],fabricAccidentList:[]}, // 主表信息
- loading: false, // 表格加载
- loadingBtn:false, //保存按钮加载
- validatorRules: {
- planNum: [{ required: true, message: '请输入计划单号进行搜索', trigger: 'blur' }]
- },
- edit:'0',
- planNO:'',//计划单号
- // 采购订单 表头
- purchaseOrderColumns: [
- { title: '货物名称', width: 180, dataIndex: 'cinvName', className: 'replacecolor', align:'left'},
- /*
- { title: '批号', width: 80, dataIndex: 'cbatch', className: 'replacecolor',
- customRender:function(text,record,index){
- if (text == null || text == undefined){
- return "";
- }
- if (text.indexOf(",")>-1){
- const arr = text.split(',');
- return (<div>
- {
- arr.map(t=>{
- return (<li>{t}</li>)
- })
- }
- </div>)
- }else{
- return text;
- }
- }
- },*/
- { title: '订单号', width: 80, dataIndex: 'cpoid', className: 'replacecolor',
- customRender:function(text,record,index){
- if (text == null || text == undefined){
- return "";
- }
- if (text.indexOf(",")>-1){
- const arr = text.split(',');
- return (<div>
- {
- arr.map(t=>{
- return (<li>{t}</li>)
- })
- }
- </div>)
- }else{
- return text;
- }
- }
- },
- { title: '计划数量', dataIndex: 'iquantity', width: 80, className: 'replacecolor' },
- {
- title: '采购数量',
- dataIndex: 'iquantityIn',
- width: 80,
- className: 'replacecolor',
- customCell: this.purchaseQuantityCustomCell,
- scopedSlots: { customRender: 'purchaseQuantity' }
- },
- { title: '采购供应商', dataIndex: 'cvenAbbName', width: 100, className: 'replacecolor' },
- { title: '分配数量', dataIndex: 'iquantityOut', width: 80, className: 'replacecolor' },
- { title: '委外供应商', dataIndex: 'omcVenAbbName', width: 100, className: 'replacecolor',scopedSlots: { customRender: 'omcVenAbbName' }, },
- {
- title: '余纱',
- dataIndex: 'iquantityLeft',
- width: 80,
- className: 'replacecolor',
- customCell: this.surplusYarnCustomCell,
- scopedSlots: { customRender: 'surplusYarn' }
- },
- { title: '采购损耗', dataIndex: 'iquantityLeftRate', width: 80, className: 'replacecolor' }
- ],
- // 委外订单国内 表头
- outsourceOrderColumns: [
- { title: '制造工艺', width: 100, dataIndex: 'cvcname', className: 'replacecolor' },
- { title: '工厂', width: 80, dataIndex: 'cvenAbbName', className: 'replacecolor' },
- {
- title: '材料出库数量',
- dataIndex: 'iquantityOut',
- width: 100,
- className: 'replacecolor',
- customCell: this.materialsOutQuantityCustomCell,
- scopedSlots: { customRender: 'materialsOutQuantity' }
- },
- { title: '计划数量', dataIndex: 'iquantity', width: 100, className: 'replacecolor' },
- {
- title: '单位',
- children: [
- {
- title: '根',
- dataIndex: 'iquantityPCS',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '米',
- dataIndex: 'iquantityM',
- width: 100,
- className: 'replacecolor'
- }
- ]
- },
- {
- title: '采购入库数量',
- dataIndex: 'iquantityIn',
- width: 100,
- className: 'replacecolor',
- customCell: this.purchaseInQuantityCustomCell,
- scopedSlots: { customRender: 'purchaseInQuantity' }
- },
- { title: '染厂色号', dataIndex: 'ccolorNumber', width: 120, className: 'replacecolor' },
- { title: '物料编码', dataIndex: 'cinvCode', width: 120, className: 'replacecolor' },
- { title: '货物名称', dataIndex: 'cinvName', width: 200, className: 'replacecolor', align:'left' },
- { title: '颜色', dataIndex: 'ccolor', width: 110, className: 'replacecolor' },
- { title: '损耗', dataIndex: 'cquantityLoss', width: 100,className: 'replacecolor' },
- { title: '多发少发', dataIndex: 'iquantityMoreLess', width: 100, className: 'replacecolor', scopedSlots: { customRender: 'iquantityMoreLess' }, customCell: this.iquantityMoreLessCell, },
- { title: '附件', dataIndex: 'enclosure', width: 100, className: 'noprint', scopedSlots: { customRender: 'enclosure' }}
- ],
- // 成本发票 表头
- costInvoiceColumns: [
- { title: '类型', width: 120, dataIndex: 'cvcname', className: 'replacecolor' },
- { title: '采购类型', width: 120, dataIndex: 'cbusType', className: 'replacecolor' },
- { title: '工厂', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor', scopedSlots: { customRender: 'cvenAbbName' } },
- { title: '成本金额', dataIndex: 'imoney', width: 120, className: 'replacecolor',scopedSlots: { customRender: 'imoney' } }
- ],
- costInvoiceData: [
- { costInvoiceType: '纱款', factory: '17TW-C-17B', costAmount: '5081.72' },
- { costInvoiceType: '纱款', factory: '17TW-C-17C', costAmount: '127754.31' },
- { costInvoiceType: '织款', factory: '18TW-C-8', costAmount: '17045.48' },
- { costInvoiceType: '染款', factory: '福隆', costAmount: '59762.4' },
- { costInvoiceType: '织款', factory: '江阴美纶', costAmount: '20482.95' }
- ],
- // 开票成本-面料 表头
- costInvoiceFabricColumns: [
- { title: '序号', width: 80, dataIndex: 'index', className: 'replacecolor' },
- {
- title: '发票号码',
- width: 120,
- dataIndex: 'csbvcode',
- className: 'replacecolor',
- customCell: this.invoiceNumCustomCell,
- scopedSlots: { customRender: 'invoiceNum' }
- },
- { title: '供应商', width: 120, dataIndex: 'cvenName', className: 'replacecolor' },
- { title: '采购发票金额', width: 120, dataIndex: 'inatSum', className: 'replacecolor' },
- { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' }
- ],
- costInvoiceFabricData: [
- { invoiceNum: '18TW-MYA-44', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-04' },
- { invoiceNum: '18TW-MYA-78', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-05-18' },
- { invoiceNum: '18TW-MYA-34', supplier: '供应商1', PurchaseinvoiceCost: '888.88', outData: '2018-06-1' }
- ],
- costInvoiceClothesColumns:[],
- // 开票成本-成衣 表头无美元
- costInvoiceClothesColumnsM1:[
- { title: '序号', width: 80, dataIndex: 'index', className: 'replacecolor' },
- { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
- { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
- { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
-
- { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
- { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
- {
- title: '发票数量',
- dataIndex: 'ipbvquantity',
- width: 120,
- className: 'replacecolor',
- customCell: this.clInvoiceQuantityCustomCell,
- scopedSlots: { customRender: 'clInvoiceQuantity' }
- }
- ],
- // 开票成本-成衣 表头
- costInvoiceClothesColumnsAll: [
- { title: '序号', width: 80, dataIndex: 'index', className: 'replacecolor' },
- { title: '发票号码', width: 120, dataIndex: 'cpbvcode', className: 'replacecolor' },
- { title: '委外供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
- { title: '成衣加工费(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
- { title: '成衣加工费(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor' },
- { title: '出运日期', width: 120, dataIndex: 'cshipTime', className: 'replacecolor' },
- { title: '入库数量', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
- {
- title: '发票数量',
- dataIndex: 'ipbvquantity',
- width: 120,
- className: 'replacecolor',
- customCell: this.clInvoiceQuantityCustomCell,
- scopedSlots: { customRender: 'clInvoiceQuantity' }
- }
- ],
- // 开票成本-辅料 表头
- costInvoiceIngredientColumns:[],
- costInvoiceIngredientColumnsM1:[
- { title: '序号', width: 80, dataIndex: 'index', className: 'replacecolor' },
- { title: '账套号', width: 80, dataIndex: 'caccount', className: 'replacecolor' },
- { title: '订单号', width: 140, dataIndex: 'cpoid', className: 'replacecolor' },
- { title: '供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
- { title: ' 类型', width: 330, dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
- {
- title: '发票数量',
- width: 120,
- dataIndex: 'iquantityInvoice',
- className: 'replacecolor',
- customCell: this.ingredientsInvoiceQuantityCustomCell,
- scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
- },
- { title: '开票金额(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
- { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
- { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
- { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
- ],
- costInvoiceIngredientColumnsAll: [
- { title: '账套号', width: 80, dataIndex: 'caccount', className: 'replacecolor' },
- { title: '订单号', width: 140, dataIndex: 'cpoid', className: 'replacecolor' },
- { title: '供应商', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
- { title: ' 类型', width: 330, dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
- {
- title: '发票数量',
- width: 120,
- dataIndex: 'iquantityInvoice',
- className: 'replacecolor',
- customCell: this.ingredientsInvoiceQuantityCustomCell,
- scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
- },
- { title: '开票金额(人民币)', width: 120, dataIndex: 'isum', className: 'replacecolor' },
- { title: '开票金额(美元)', width: 120, dataIndex: 'ioriSum', className: 'replacecolor',customRender: (text, record, index) => {
- if (record.isum == record.ioriSum)
- return "";
- else
- return record.ioriSum;
- } },
- { title: '单位', width: 120, dataIndex: 'ccomUnitName', className: 'replacecolor' },
- { title: '订单数', width: 120, dataIndex: 'iquantity', className: 'replacecolor' },
- { title: '采购入库数', width: 120, dataIndex: 'iquantityIn', className: 'replacecolor' }
- ],
- costInvoiceIngredientData: [
- { factory: '森加', type: '主标', ingredientsInvoiceQuantity: '45900', invoiceAmountCNY: '259.42' },
- { factory: '森加', type: '尺码标', ingredientsInvoiceQuantity: '3670', invoiceAmountCNY: '1475.6' }
- ],
- // 费用支出 表头
- costPayColumns: [
- { title: '账套号', width: 120, dataIndex: 'caccount', className: 'replacecolor' },
- { title: '支出单号', width: 120, dataIndex: 'cspvcode', className: 'replacecolor' },
- { title: '费用项目', dataIndex: 'cexpName', width: 120, className: 'replacecolor' },
- { title: '支出人民币金额', dataIndex: 'inatMoney', width: 120, className: 'replacecolor' },
- { title: '支出美元金额', dataIndex: 'imoney', width: 120, className: 'replacecolor',customRender: (text, record, index) => {
- if (record.imoney == record.inatMoney)
- return "";
- else
- return record.imoney;
- } },
- { title: '发票号', dataIndex: 'cinvoinceNo', width: 120, className: 'replacecolor' },
- { title: '制单人', dataIndex: 'cmaker', width: 120, className: 'replacecolor' }
- ],
- costPayData: [{}],
- // 事故单 表头
- accidentListColumns: [
- {
- title: '单号',
- width: 120,
- dataIndex: 'cpbvcode',
- className: 'replacecolor',
- // customCell: this.accidentListCustomCell,
- scopedSlots: { customRender: 'cpbvcode' }
- },
- {
- title: '事故单号',
- width: 120,
- dataIndex: 'cpbvmemo',
- className: 'replacecolor',
- // customCell: this.accidentListCustomCell,
- // scopedSlots: { customRender: 'cpbvcode' }
- },
- { title: '事故承担方', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor' },
- { title: '金额', dataIndex: 'ioriSum', width: 120, className: 'replacecolor' }
- ],
- accidentListData: [{ accidentNum: '1100011' }, { accidentNum: '3540011' }],
- noteOne: '', // 备注 1
- noteTwo: '' // 备注 2
- }
- },
- methods: {
- daYin(){
- // printJS({
- // printable:this.fabricLoss.fabricOMOrderList1,
- // properties:[
- // {field:'cvcname',displayName:'制造工艺',columnSize:1},
- // {field:'cvenAbbName',displayName:'工厂',columnSize:1},
- // {field:'iquantityOut',displayName:'材料出库数量',columnSize:1},
- // {field:'iquantity', displayName:'计划数量',columnSize:1},
- // {field:'iquantityIn', displayName:'采购入库数量',columnSize:1},
- // {field:'cinvCode', displayName:'物料编码',columnSize:1},
- // {field:'cinvName', displayName:'货物名称',columnSize:1},
- // {field:'ccolor', displayName:'颜色',columnSize:1},
- // {field:'cquantityLoss', displayName:'损耗',columnSize:1},
- // {field:'iquantityMoreLess', displayName:'多发少发',columnSize:1},
- // ],
- // type:'json',
- // header:'C001',
- //样式设置
- // gridStyle:'border:2px solid #3971A5;text-align: center',
- // gridHeaderStyle:'color:red; border:2px solid #3971A5;'
- // })
- this.showSelect = 1
- this.$nextTick(() => {
- const html = window.document.getElementById('fabricLossTable').innerHTML
- const win = window.open();
- const style = '<style>\n'
- +'.noprint{display:none}'
- +'.ant-table-body{overflow-x: hidden !important }' //去除滚动条
- +'.kk{display:flex;flex-wrap: wrap}' //主要信息并排
- +'.ant-col-sm-8{width:40%;margin-bottom: 6px;}'
- +'.ant-form-item-label{width:45%;font-size: 12px;}'
- +'.ant-form-item-children{font-size: 12px}'
- +'.ant-card-head-title{font-weight: bold;font-size: 0.67em;margin-bottom: 9px;}'
- +'.ant-form-item-control-wrapper{width:100%}'
- +'.ant-input{width:100%}'
- +'.ant-form-item{display:flex}'
- + 'table{width: 100% !important;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
- + 'th,td{width:5%;height: 18px;border: 1px solid #999;font-size: 12px;color: #666;max-width:2000px;text-align: center;}\n'
- +'.ant-table-row-cell-break-word{width:5% !important}'
- + 'th{color: #333}\n'
- + 'a{color: #666; text-decoration:none;}\n'
- + '</style>';
- win.document.write(style+html);
- win.focus();
- win.print();
- win.close();
- this.showSelect = 0
- })
-
- },
- // 【计划单号】 搜索
- onSearch(value,update) {
- if (value == "" || value == null){
- this.$message.error('请输入计划号!');
- }else{
- this.loading = true;
- this.$nextTick(() => {
- getFabricLossDatas({csocode:value,update:update}).then(res => {
- this.loading = false;
- if (res.success) {
- this.PrintButton = false
- this.fabricLoss = res.result;
- this.edit = this.fabricLoss.edit
- // 开票成本成衣:获取原币和本币金额是否完全相同,完全相同隐藏美元列
- var findList = this.fabricLoss.fabricCostClothesList.filter(e=>e.ioriSum!=e.isum);
- if (findList.length == 0)
- this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsM1;
- else
- this.costInvoiceClothesColumns = this.costInvoiceClothesColumnsAll;
- // 开票成本辅料:获取原币和本币金额是否完全相同,完全相同隐藏美元列
- findList = this.fabricLoss.fabricCostAssistList.filter(e=>e.ioriSum!=e.isum);
- if (findList.length == 0)
- this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsM1;
- else
- this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsAll;
- // 委外订单国内附件按钮状态
- this.fabricLoss.fabricOMOrderList1.map(item=>{
- item.buttonStatus = false
- if(!item.accessorItemList||item.accessorItemList.length == 0 ){
- item.buttonStatus = true
- }
- })
- // 委外订单国外附件按钮状态
- this.fabricLoss.fabricOMOrderList2.map(item=>{
- item.buttonStatus = false
- if(!item.accessorItemList||item.accessorItemList.length == 0 ){
- item.buttonStatus = true
- }
- })
- this.fabricLoss.fabricCostClothesList.map((item,index) => {item.index = index +1})
- this.fabricLoss.fabricCostClothList.map((item,index) => {item.index = index +1})
- this.fabricLoss.fabricCostAssistList.map((item,index) => {item.index = index +1})
- this.fabricLoss.fabricPoOrderList.map(item => {
- item["omcVenAbbNameArray"] = item.omcVenAbbName ? (item.omcVenAbbName.split(",")) : ''
- })
- if (this.fabricLoss.fabricAccidentList == null){
- this.fabricLoss.fabricAccidentList = [];
- }
- this.calculateTotal()
- }else{
- this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[],fabricAccidentList:[]};
- this.$message.info(res.message);
- }
- this.judgeListLength()
- })
- })
- }
- },
- //计算合计行
- calculateTotal(){
- //计算成本发票合计
- var imoney = 0;
- for (let row of this.fabricLoss.fabricCostInvoiceList){
- imoney += row.imoney*1;
- }
- if(this.fabricLoss.fabricCostInvoiceList.length !==0){
- this.fabricLoss.fabricCostInvoiceList.push({
- cvcname:'',
- cbusType:'合计',
- cvenAbbName:'',
- imoney:parseFloat(imoney.toFixed(2))
- })
- }
- //计算开票成本-面料合计
- var inatSum = 0;
- for (let row of this.fabricLoss.fabricCostClothList){
- inatSum += row.inatSum*1;
- }
- if(this.fabricLoss.fabricCostClothList.length !==0){
- this.fabricLoss.fabricCostClothList.push({
- index:'',
- csbvcode:'合计',
- cvenName:'',
- inatSum:parseFloat(inatSum.toFixed(2)),
- cshipTime:''
- })
- }
- //计算开票成本-成衣合计
- var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
- for (let row of this.fabricLoss.fabricCostClothesList){
- isum += row.isum*1;
- ioriSum += row.ioriSum*1;
- iquantity += row.iquantity*1;
- ipbvquantity += row.ipbvquantity*1;
- }
- if(this.fabricLoss.fabricCostClothesList.length!==0){
- this.fabricLoss.fabricCostClothesList.push({
- cpbvcode:'合计',
- isum: parseFloat(isum.toFixed(2)),
- ioriSum: parseFloat(ioriSum.toFixed(2)),
- iquantity: parseFloat(iquantity.toFixed(4)),
- ipbvquantity: parseFloat(ipbvquantity.toFixed(4)),
- })
- }
- //开票成本-辅料合计
- var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
- for (let row of this.fabricLoss.fabricCostAssistList){
- isum += row.isum*1;
- iquantity += row.iquantity*1;
- iquantityIn += row.iquantityIn*1;
- iquantityInvoice += row.iquantityInvoice*1;
- if(row.isum!==row.ioriSum){
- ioriSum += row.ioriSum*1;
- }
- }
- if(this.fabricLoss.fabricCostAssistList.length !== 0){
- this.fabricLoss.fabricCostAssistList.push({
- caccount:'合计',
- isum:parseFloat(isum.toFixed(2)),
- ioriSum:parseFloat(ioriSum.toFixed(2)),
- iquantity:parseFloat(iquantity.toFixed(4)),
- iquantityIn:parseFloat(iquantityIn.toFixed(4)),
- iquantityInvoice:parseFloat(iquantityInvoice.toFixed(4))
- })
- }
- //事故单合计
- var item = {
- "cvenAbbName":"合计"
- };
- var ioriSum = 0
- for (let row of this.fabricLoss.fabricAccidentList){
- ioriSum += row.ioriSum*1
- }
- if(this.fabricLoss.fabricAccidentList.length !== 0){
- this.fabricLoss.fabricAccidentList.push({
- cvenAbbName:"合计",
- ioriSum:parseFloat(ioriSum.toFixed(4))
- })
- }
- },
- //判断哪个列表为空
- judgeListLength(){
- var data = [
- {List:this.fabricLoss.fabricPoOrderList,class:'.purchase-order-table'},
- {List:this.fabricLoss.fabricOMOrderList1,class:'.outsource-orders-table'},
- {List:this.fabricLoss.fabricOMOrderList2,class:'.outsourceOrder-abroad-table'},
- {List:this.fabricLoss.fabricCostInvoiceList,class:'.cost-invoice-table'},
- {List:this.fabricLoss.fabricCostClothList,class:'.costInvoice-fabric-table'},
- {List:this.fabricLoss.fabricCostClothesList,class:'.costInvoice-clothes-table'},
- {List:this.fabricLoss.fabricCostAssistList,class:'.costInvoice-ingredient-table'},
- // {List:this.fabricLoss.fabricExpensesList,class:'.costPay-table'},
- {List:this.fabricLoss.fabricAccidentList,class:'.accidentBill-table'},
- ]
- data.map(item=>{
- if(item.List.length == 0){
- var bb =document.querySelector(item.class)
- bb.className = 'noprint'
- }
- })
- },
- //行样式
- setRowClassName(record) {
- return(record.iquantityLeft!==0&&record.fabricPoOrderOutList.length == 0) ? "inputRowStyl" : "inputRowSty2";//赋予点击行样式
- },
- // 【采购数量】单元格 弹框
- purchaseQuantityCustomCell(record) {
- return {
- on: {
- click: event => {
- if (record.cpoid == '来源余料') {
- this.$refs.surplusYarnModal.surplusYarnData = record.fabricPoOrderOutList;
- this.$refs.surplusYarnModal.allDataList = record.fabricPoOrderOutList;
- this.$refs.surplusYarnModal.surplusYarnModVis = true
- }else if (record.cpoid == '其他入库') {
- this.$refs.otherYarnsInModal.otherYarnsInData = record.fabricPoOrderOutList;
- this.$refs.otherYarnsInModal.allDataList = record.fabricPoOrderOutList;
- this.$refs.otherYarnsInModal.otherYarnsInModVis = true
- } else {
- this.$refs.purchaseAmountModal.purchaseAmountData = record.fabricPoOrderInList;
- this.$refs.purchaseAmountModal.allDataList = record.fabricPoOrderInList;
- this.$refs.purchaseAmountModal.purchaseAmountModVis = true
- }
- }
- }
- }
- },
- // 余纱
- surplusYarnCustomCell(record) {
- return {
- on: {
- click: event => {
- this.$refs.purchaseLeftModal.surplusYarnData = record.fabricPoOrderOutList;
- this.$refs.purchaseLeftModal.allDataList = record.fabricPoOrderOutList;
- this.$refs.purchaseLeftModal.surplusYarnModVis = true
- }
- }
- }
- },
- iquantityMoreLessCell(record){
- return {
- on: {
- click: event => {
- this.$refs.iquantityMoreLessModal.surplusYarnData = record.fabricPoOrderOutList;
- this.$refs.iquantityMoreLessModal.allDataList = record.fabricPoOrderOutList;
- this.$refs.iquantityMoreLessModal.surplusYarnModVis = true
- }
- }
- }
- },
- //成本金额弹窗
- imoneyCell(record){
- this.$refs.imoneyCell.imoneyModVis = true
- this.$refs.imoneyCell.imoneyData = record.costInvoiceDetailList
- },
- // 【材料出库数量】 弹框
- materialsOutQuantityCustomCell(record) {
- return {
- on: {
- click: event => {
- this.$refs.materialsOutQuantityModal.materialsOutQuantityData = record.fabricMoOrderCKList;
- this.$refs.materialsOutQuantityModal.allDataList = record.fabricMoOrderCKList;
- this.$refs.materialsOutQuantityModal.queryParam = {};
- this.$refs.materialsOutQuantityModal.materialsOutQuantityModVis = true
- }
- }
- }
- },
- // 采购入库数量
- purchaseInQuantityCustomCell(record) {
- return {
- on: {
- click: event => {
- this.$refs.purchaseInQuantityModal.purchaseInQuantityData = record.fabricMoOrderRKList;
- this.$refs.purchaseInQuantityModal.allDataList = record.fabricMoOrderRKList;
- this.$refs.purchaseInQuantityModal.queryParam = {};
- this.$refs.purchaseInQuantityModal.purchaseInQuantityModVis = true
- }
- }
- }
- },
- // 开票成本-面料弹框
- invoiceNumCustomCell(record) {
- if(record.csbvcode!=='合计'){
- return {
- on: {
- click: event => {
- this.$refs.invoiceNumModal.invoiceNumData = record.fabricCostClothDetailList;
- this.$refs.invoiceNumModal.allDataList = record.fabricCostClothDetailList;
- this.$refs.invoiceNumModal.queryParam = {};
- this.$refs.invoiceNumModal.invoiceNumModVis = true;
- }
- }
- }
- }
- },
- //成本发票 -----合计行
- // costFooterShow(data){
- // return (
- // <a-table
- // rowKey={Math.random}
- // bordered={false}
- // pagination={false}
- // columns={this.costInvoiceColumns}
- // dataSource={this.costFooterDataSource || []}
- // showHeader={false}
- // ></a-table>
- // )
- // },
-
- // 开票成本-成衣 ----合计行
- // clothesFooterShow(data) {
- // return (
- // <a-table
- // rowKey={Math.random}
- // bordered={false}
- // pagination={false}
- // columns={this.costInvoiceClothesColumns}
- // dataSource={this.clothesFooterDataSource || []}
- // showHeader={false}
- // ></a-table>
- // )
- // },
- // 开票成本-辅料 ----合计行
- // assistFooterShow(data) {
- // return (
- // <a-table
- // rowKey={Math.random}
- // bordered={false}
- // pagination={false}
- // columns={this.costInvoiceIngredientColumns}
- // dataSource={this.assistFooterDataSource || []}
- // showHeader={false}
- // ></a-table>
- // )
- // },
- //费用支出 ----合计行
- costPayFooterShow(){
- return (
- <a-table
- rowKey={Math.random}
- bordered={false}
- pagination={false}
- columns={this.costPayColumns}
- dataSource={this.costPayFooterDataSource || []}
- showHeader={false}
- ></a-table>
- )
- },
- //事故单 -----合计
- // accidentFooterShow(){
- // return (
- // <a-table
- // rowKey={Math.random}
- // bordered={false}
- // pagination={false}
- // columns={this.accidentListColumns}
- // dataSource={this.accidentFooterDataSource || []}
- // showHeader={false}
- // ></a-table>
- // )
- // },
- // 开票成本-面料 ----合计行
- clothFooterShow(data) {
- return (
- <a-table
- rowKey={Math.random}
- bordered={false}
- pagination={false}
- columns={this.costInvoiceFabricColumns}
- dataSource={this.clothFooterDataSource || []}
- showHeader={false}
- ></a-table>
- )
- },
- // 开票成本成衣-弹框
- clInvoiceQuantityCustomCell(record) {
- return {
- on: {
- click: event => {
- this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostClothesDetailList;
- this.$refs.invoiceQuantityModal.allDataList = record.fabricCostClothesDetailList;
- this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true;
- }
- }
- }
- },
- // 开票成本辅料-弹框
- ingredientsInvoiceQuantityCustomCell(record) {
- if(record.caccount!=='合计'){
- return {
- on: {
- click: event => {
- this.$refs.invoiceQuantityModal.invoiceQuantityData = record.fabricCostAssistDetailList;
- this.$refs.invoiceQuantityModal.allDataList = record.fabricCostAssistDetailList;
- this.$refs.invoiceQuantityModal.queryParam = {};
- this.$refs.invoiceQuantityModal.invoiceQuantityModVis = true
- }
- }
- }
- }
- },
- // 事故单 单号 弹框
- accidentListCustomCell(record) {
- return {
- on: {
- click: event => {
- console.log('this:', this)
- this.$refs.accidentListModal.accidentListModVis = true
- }
- }
- }
- },
- save() {
- const that = this
- if (this.fabricLoss.makingPeople == null){
- that.$message.info('没有可保存的数据,请先查询数据');
- return;
- }
- this.loadingBtn = true;
- console.log(this.fabricLoss);
- saveFabricLossData(this.fabricLoss).then(res => {
- that.loadingBtn = false;
- if (res.success) {
- this.$message.success(res.message);
- this.onSearch(this.planNO,'0')
- // that.fabricLoss = res.result;
- }else{
- this.$message.error(res.message)
- }
- });
- },
- // 附件
- openEnclosure(){
- this.$refs.attachmentDisplay.AttachmentModVis = true
- var attachList = [];
- if (this.fabricLoss != null && this.fabricLoss.accessorItemList != null){
- this.fabricLoss.accessorItemList.forEach(e=>{
- var attach = {};
- attach.name = e.filename;
- attach.src=e.fileurl;
- attachList.push(attach);
- });
- }
- this.$refs.attachmentDisplay.attachmentData = attachList;
- },
- openItemOnclosure(record){
- var attachList = [];
- record.accessorItemList.forEach(e=>{
- var attach = {};
- attach.name = e.filename;
- attach.src=e.fileurl;
- attachList.push(attach);
- });
- this.$refs.attachmentDisplay.AttachmentModVis = true
- this.$refs.attachmentDisplay.attachmentData = attachList;
- },
- // father
- aa() {},
- bb() {},
- cc() {},
- dd() {},
- ee() {},
- ff() {},
- gg() {}
- },
- // 出现滚动条,合计栏跟随 table 滚动
- // watch: {
- // dataSource(val) {
- // console.log(val)
- // // 同步表与footer滚动
- // let dom = this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[0]
- // dom.addEventListener(
- // 'scroll',
- // () => {
- // this.$refs.TableInfo.$el.querySelectorAll('.ant-table-body')[1].scrollLeft = dom.scrollLeft
- // console.log('走到这')
- // },
- // true
- // )
- // }
- // },
- // 构建合计数据 --合计
- computed: {
- // costFooterDataSource(){
- // //成本发票 合计
- // var item = {
- // "cbusType":"合计"
- // };
- // var imoney = 0;
- // for (let row of this.fabricLoss.fabricCostInvoiceList){
- // imoney += row.imoney*1;
- // }
-
- // item.imoney= parseFloat(imoney.toFixed(2));
- // return [item];
- // },
-
- // clothFooterDataSource() {
- // // 开票成本-面料 合计
- // var item = {
- // "csbvcode":"合计"
- // };
- // var inatSum = 0;
- // for (let row of this.fabricLoss.fabricCostClothList){
- // inatSum += row.inatSum*1;
- // }
-
- // item.inatSum= parseFloat(inatSum.toFixed(2));
- // return [item];
- // },
- // clothesFooterDataSource() {
- // // 开票成本-衬衣 合计
- // var item = {
- // "cpbvcode":"合计"
- // };
- // var isum = 0,ioriSum=0,iquantity=0,ipbvquantity=0;
- // for (let row of this.fabricLoss.fabricCostClothesList){
- // isum += row.isum*1;
- // ioriSum += row.ioriSum*1;
- // iquantity += row.iquantity*1;
- // ipbvquantity += row.ipbvquantity*1;
- // }
-
- // item.isum= parseFloat(isum.toFixed(2));
- // item.ioriSum = parseFloat(ioriSum.toFixed(2));
- // item.iquantity = parseFloat(iquantity.toFixed(4));
- // item.ipbvquantity = parseFloat(ipbvquantity.toFixed(4));
- // return [item];
- // },
- // assistFooterDataSource() {
- // // 开票成本-辅料 合计
- // var item = {
- // "caccount":"合计"
- // };
- // var isum = 0,ioriSum=0,iquantity=0,iquantityIn=0,iquantityInvoice=0;
- // for (let row of this.fabricLoss.fabricCostAssistList){
- // isum += row.isum*1;
- // ioriSum += row.ioriSum*1;
- // iquantity += row.iquantity*1;
- // iquantityIn += row.iquantityIn*1;
- // iquantityInvoice += row.iquantityInvoice*1;
- // }
-
- // item.isum= parseFloat(isum.toFixed(2));
- // item.ioriSum = parseFloat(ioriSum.toFixed(2));
- // item.iquantity = parseFloat(iquantity.toFixed(4));
- // item.iquantityIn = parseFloat(iquantityIn.toFixed(4));
- // item.iquantityInvoice = parseFloat(iquantityInvoice.toFixed(4));
- // return [item];
- // },
- costPayFooterDataSource(){
- //费用支出 合计
- var item = {
- "cspvcode":"合计"
- };
- var inatMoney = 0,imoney=0
- for (let row of this.fabricLoss.fabricExpensesList){
- inatMoney += row.inatMoney*1;
- if(row.inatMoney == row.imoney ){
- imoney += 0
- }else{
- imoney += row.imoney*1
- }
-
- }
- item.inatMoney = parseFloat(inatMoney.toFixed(4));
- item.imoney = parseFloat(imoney.toFixed(4));
- return [item];
- },
- // accidentFooterDataSource(){
- // //事故单 合计
- // var item = {
- // "cvenAbbName":"合计"
- // };
- // var ioriSum = 0
- // for (let row of this.fabricLoss.fabricAccidentList){
- // ioriSum += row.ioriSum*1
- // }
- // item.ioriSum = parseFloat(ioriSum.toFixed(4));
- // return [item];
- // }
- }
- }
- </script>
- <style lang="less" scoped>
- @import '~@assets/less/common.less';
- @import '~@assets/less/overwriter.less';
- /deep/ .ant-table-thead > tr > th {
- text-align: center;
- // font-weight: 700;
- }
- /deep/ .ant-table-tbody {
- text-align: center;
- }
- // /deep/ th.replacecolor {
- // background-color: #ccc;
- // }
- /deep/ .ant-table-footer .ant-table.body {
- // overflow: hidden !important;
- }
- /deep/ .ant-table.ant-table-bordered .ant-table-footer {
- border: none;
- padding: 0;
- }
- /deep/ .ant-form-item-children {
- display: flex;
- }
- /deep/ form :not(.ant-input-group-wrapper) > .ant-input-group, form .ant-input-group-wrapper{
- width: 65% !important;
- }
- /deep/ .ant-input-group{
- padding-right: 6px !important;
- }
- /deep/ .ant-table .ant-table-row-indent + .ant-table-row-expand-icon{
- display: none !important;
- }
- </style>
|