123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401 |
- <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="cbusType" slot-scope="text,record">
- <a-input placeholder="请输入" v-model="record.cbusType" v-if="record.bmanual && showSelect==0"/>
- <span v-else>{{text}}</span>
- </span>
-
- <!-- 成本金额 -->
- <span slot="imoney" slot-scope="text,record">
- <a v-if="(record.cbusType == '转出成本') || (record.cbusType == '转入成本')&& !record.bmanual" @click="imoneyCell(record)">{{text}}</a>
- <span v-if="(record.cbusType !== '转出成本') && (record.cbusType !== '转入成本') && !record.bmanual" >{{text}}</span>
- <a-input placeholder="请输入" v-model="record.imoney" v-if="record.bmanual && showSelect==0" @blur="judageNumber(record)"/>
- <span v-if="record.bmanual && showSelect==1" >{{text}}</span>
- </span>
- <!-- 工厂 -->
- <span slot="cvenAbbName" slot-scope="text,record">
- <a-input placeholder="请输入工厂" v-model="record.cvenAbbName" v-if="(record.cbusType == '转出成本' && showSelect==0) ||(record.bmanual&& 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: '21%', dataIndex: 'cinvName', className: 'replacecolor specel-width'},
- /*
- { 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:'8%' , 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:'6%', className: 'replacecolor' },
- {
- title: '采购数量',
- dataIndex: 'iquantityIn',
- width: '6%',
- className: 'replacecolor',
- customCell: this.purchaseQuantityCustomCell,
- scopedSlots: { customRender: 'purchaseQuantity' }
- },
- { title: '采购供应商', dataIndex: 'cvenAbbName', width: '7%', className: 'replacecolor' },
- { title: '分配数量', dataIndex: 'iquantityOut', width: '5%', className: 'replacecolor' },
- { title: '委外供应商', dataIndex: 'omcVenAbbName', width: '10%', className: 'replacecolor',scopedSlots: { customRender: 'omcVenAbbName' }, },
- {
- title: '余纱',
- dataIndex: 'iquantityLeft',
- width:'5%',
- className: 'replacecolor',
- customCell: this.surplusYarnCustomCell,
- scopedSlots: { customRender: 'surplusYarn' }
- },
- { title: '采购损耗', dataIndex: 'iquantityLeftRate', width: '6%', className: 'replacecolor' }
- ],
- // 委外订单国内 表头
- outsourceOrderColumns: [
- { title: '制造工艺', width: '10%', dataIndex: 'cvcname', className: 'replacecolor' },
- { title: '工厂', width: 80, dataIndex: 'cvenAbbName', className: 'replacecolor' },
- {
- title: '材料出库数量',
- dataIndex: 'iquantityOut',
- width: '5%',
- className: 'replacecolor',
- customCell: this.materialsOutQuantityCustomCell,
- scopedSlots: { customRender: 'materialsOutQuantity' }
- },
- { title: '计划数量', dataIndex: 'iquantity', width: '6%', className: 'replacecolor' },
- {
- title: '单位',
- children: [
- {
- title: '根',
- dataIndex: 'iquantityPCS',
- width: '5%',
- className: 'replacecolor'
- },
- {
- title: '米',
- dataIndex: 'iquantityM',
- width: '5%',
- className: 'replacecolor'
- }
- ]
- },
- {
- title: '采购入库数量',
- dataIndex: 'iquantityIn',
- width: '7%',
- className: 'replacecolor',
- customCell: this.purchaseInQuantityCustomCell,
- scopedSlots: { customRender: 'purchaseInQuantity' }
- },
- { title: '染厂色号', dataIndex: 'ccolorNumber', width:'10%', className: 'replacecolor' },
- { title: '物料编码', dataIndex: 'cinvCode', width: '7%', className: 'replacecolor noprint' },
- { title: '货物名称', dataIndex: 'cinvName', width: '20%',className: 'replacecolor specel-width' },
- { title: '颜色', dataIndex: 'ccolor', width: '7%', className: 'replacecolor' },
- { title: '损耗', dataIndex: 'cquantityLoss', width: '6%',className: 'replacecolor' },
- { title: '多发少发', dataIndex: 'iquantityMoreLess', width: '6%', className: 'replacecolor', scopedSlots: { customRender: 'iquantityMoreLess' }, customCell: this.iquantityMoreLessCell, },
- { title: '附件', dataIndex: 'enclosure', width: '6%', className: 'noprint', scopedSlots: { customRender: 'enclosure' }}
- ],
- // 成本发票 表头
- costInvoiceColumns: [
- { title: '类型', width: 120, dataIndex: 'cvcname', className: 'replacecolor' },
- { title: '采购类型', width: 120, dataIndex: 'cbusType', className: 'replacecolor' , scopedSlots: { customRender: 'cbusType' }},
- { 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: '10%', dataIndex: 'index', className: 'replacecolor' },
- { title: '账套号', width: '10%', dataIndex: 'caccount', className: 'replacecolor' },
- { title: '订单号', width: '10%', dataIndex: 'cpoid', className: 'replacecolor' },
- { title: '供应商', width: '10%', dataIndex: 'cvenAbbName', className: 'replacecolor' },
- { title: ' 类型', width: '13%', dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
- {
- title: '发票数量',
- width: '7%',
- dataIndex: 'iquantityInvoice',
- className: 'replacecolor',
- customCell: this.ingredientsInvoiceQuantityCustomCell,
- scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
- },
- { title: '开票金额(人民币)', width: '10%', dataIndex: 'isum', className: 'replacecolor' },
- { title: '单位', width: '10%', dataIndex: 'ccomUnitName', className: 'replacecolor' },
- { title: '订单数', width: '10%', dataIndex: 'iquantity', className: 'replacecolor' },
- { title: '采购入库数', width: '10%', dataIndex: 'iquantityIn', className: 'replacecolor' }
- ],
- costInvoiceIngredientColumnsAll: [
- { title: '账套号', width: '10%', dataIndex: 'caccount', className: 'replacecolor' },
- { title: '订单号', width: '10%', dataIndex: 'cpoid', className: 'replacecolor' },
- { title: '供应商', width: '10%', dataIndex: 'cvenAbbName', className: 'replacecolor' },
- { title: ' 类型', width: '10%', dataIndex: 'cinvName', className: 'replacecolor',align:"left" },
- {
- title: '发票数量',
- width: '10%',
- dataIndex: 'iquantityInvoice',
- className: 'replacecolor',
- customCell: this.ingredientsInvoiceQuantityCustomCell,
- scopedSlots: { customRender: 'ingredientsInvoiceQuantity' }
- },
- { title: '开票金额(人民币)', width: '10%', dataIndex: 'isum', className: 'replacecolor' },
- { title: '开票金额(美元)', width: '10%', dataIndex: 'ioriSum', className: 'replacecolor',customRender: (text, record, index) => {
- if (record.isum == record.ioriSum)
- return "";
- else
- return record.ioriSum;
- } },
- { title: '单位', width: '10%', dataIndex: 'ccomUnitName', className: 'replacecolor' },
- { title: '订单数', width: '10%', dataIndex: 'iquantity', className: 'replacecolor' },
- { title: '采购入库数', width: '10%', 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(){
- this.showSelect = 1
- this.$nextTick(() => {
- const html = window.document.getElementById('fabricLossTable').innerHTML
- const win = window.open();
- const style = '<style>\n'
- +'.noprint{display:none}'
- +'.specleWidth{width:10% !important}'
- +'.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%}'
- +'.specel-width{width:25% !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'
- }
- })
- },
- judageNumber(record){
- if(isNaN(Number(record.imoney))){
- this.$message.error('必须输入数字,请重新输入!');
- record.imoney = ''
- }
- },
-
- //行样式
- 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>
|